\r\n

51Degrees Device Detection C/C++  4.5

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 2023 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 
32 namespace FiftyoneDegrees {
33  namespace Common {
41  public:
52 
60  ValueMetaDataKey(string propertyName, string valueName);
61 
71  const string &propertyName,
72  const uint8_t *valueName,
73  long valueNameLength);
74 
85  const string getPropertyName() const;
86 
91  const string getValueName() const;
92 
105  const bool operator< (ValueMetaDataKey other) const;
106 
113  const bool operator== (ValueMetaDataKey other) const;
114 
118  private:
120  string propertyName;
121 
123  string valueName;
124  };
125 
129  class ValueMetaData : public EntityMetaData<ValueMetaDataKey> {
130  public:
140  ValueMetaData();
141 
149 
158  ValueMetaDataKey key,
159  string description,
160  string url);
161 
173  string getName() const;
174 
179  string getDescription() const;
180 
185  string getUrl() const;
186 
191  std::vector<uint8_t> getUtf8ValueName() const;
192 
196  private:
198  string description;
199 
201  string url;
202  };
203  }
204 }
205 
206 #endif
const string getPropertyName() const
Get the name of the property that the value keyed relates to.
string getName() const
Get the name of the value.
string getDescription() const
Get the full description of the value.
ValueMetaData()
Default constructor, should not be used externally as it produces an invalid instance.
A C++ wrapper class for transform.h conversion routines.
Definition: ComponentMetaDataBuilderHash.hpp:33
const string getValueName() const
Get the name of the value which is being keyed.
string getUrl() const
Get the URL containing any extra information about the value.
Meta data relating to a value populated by an engine implementation.
Definition: ValueMetaData.hpp:129
const bool operator<(ValueMetaDataKey other) const
Override the less than operator so the unique key can be used to order lists.
Key used to store ValueMetaData in a Collection.
Definition: ValueMetaData.hpp:40
Base class for any entity meta data.
Definition: EntityMetaData.hpp:46
std::vector< uint8_t > getUtf8ValueName() const
Get the name of the value as a UTF-8 byte vector.
const bool operator==(ValueMetaDataKey other) const
Override the equality operator so the unique key can be found in a generic collection.