A device detection library that is used natively or by 51Degrees products

ValueMetaData.hpp

1/* *********************************************************************
2 * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3 * Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
4 * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5 *
6 * This Original Work is licensed under the European Union Public Licence
7 * (EUPL) v.1.2 and is subject to its terms as set out below.
8 *
9 * If a copy of the EUPL was not distributed with this file, You can obtain
10 * one at https://opensource.org/licenses/EUPL-1.2.
11 *
12 * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13 * amended by the European Commission) shall be deemed incompatible for
14 * the purposes of the Work and the provisions of the compatibility
15 * clause in Article 5 of the EUPL shall not apply.
16 *
17 * If using the Work as, or as part of, a network application, by
18 * including the attribution notice(s) required under Article 5 of the EUPL
19 * in the end user terms of the application under an appropriate heading,
20 * such notice(s) shall fulfill the requirements of that article.
21 * ********************************************************************* */
22
23#ifndef FIFTYONE_DEGREES_VALUE_META_DATA_HPP
24#define FIFTYONE_DEGREES_VALUE_META_DATA_HPP
25
26#include <string>
27#include <vector>
28#include "EntityMetaData.hpp"
29#include "value.h"
30
31
32namespace FiftyoneDegrees {
33 namespace Common {
34 FIFTYONE_DEGREES_COMMON_CXX_BEGIN
42 public:
47
53
61 ValueMetaDataKey(string propertyName, string valueName);
62
72 const string &propertyName,
73 const uint8_t *valueName,
74 long valueNameLength);
75
81
86 const string getPropertyName() const;
87
92 const string getValueName() const;
93
99
106 const bool operator< (ValueMetaDataKey other) const;
107
114 const bool operator== (ValueMetaDataKey other) const;
115
119 private:
121 string propertyName;
122
124 string valueName;
125 };
126
130 class ValueMetaData : public EntityMetaData<ValueMetaDataKey> {
131 public:
136
142
150
160 string description,
161 string url);
162
168
174 string getName() const;
175
180 string getDescription() const;
181
186 string getUrl() const;
187
192 std::vector<uint8_t> getUtf8ValueName() const;
193
197 private:
199 string description;
200
202 string url;
203 };
204 FIFTYONE_DEGREES_COMMON_CXX_END
205 }
206}
207
208#endif
EntityMetaData(ValueMetaDataKey key)
Definition EntityMetaData.hpp:58
string getDescription() const
Get the full description of the value.
ValueMetaData()
Default constructor, should not be used externally as it produces an invalid instance.
std::vector< uint8_t > getUtf8ValueName() const
Get the name of the value as a UTF-8 byte vector.
string getName() const
Get the name of the value.
ValueMetaData(ValueMetaData *value)
Construct a new instance of ValueMetaData from an existing instance.
string getUrl() const
Get the URL containing any extra information about the value.
ValueMetaData(ValueMetaDataKey key, string description, string url)
Create a new instance of ValueMetaData.
Key used to store ValueMetaData in a Collection.
Definition ValueMetaData.hpp:41
ValueMetaDataKey(const string &propertyName, const uint8_t *valueName, long valueNameLength)
Construct a new instance of ValueMetaDataKey from the unique combination of property and value names.
ValueMetaDataKey(string propertyName, string valueName)
Construct a new instance of ValueMetaDataKey from the unique combination of property and value names.
const bool operator==(ValueMetaDataKey other) const
Override the equality operator so the unique key can be found in a generic collection.
const bool operator<(ValueMetaDataKey other) const
Override the less than operator so the unique key can be used to order lists.
const string getPropertyName() const
Get the name of the property that the value keyed relates to.
const string getValueName() const
Get the name of the value which is being keyed.
Shared classes.
Definition Collection.hpp:31
A C++ wrapper class for transform.h conversion routines.
Definition ComponentMetaDataBuilderHash.hpp:33