\r\n

51Degrees Device Detection C/C++  4.3

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

property.h

1 /* *********************************************************************
2  * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3  * Copyright 2019 51 Degrees Mobile Experts Limited, 5 Charlotte Close,
4  * Caversham, Reading, Berkshire, United Kingdom RG4 7BY.
5  *
6  * This Original Work is licensed under the European Union Public Licence (EUPL)
7  * 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_PROPERTY_H_INCLUDED
24 #define FIFTYONE_DEGREES_PROPERTY_H_INCLUDED
25 
52 #include <stdint.h>
53 #ifdef _MSC_VER
54 #pragma warning (push)
55 #pragma warning (disable: 5105)
56 #include <windows.h>
57 #pragma warning (default: 5105)
58 #pragma warning (pop)
59 #endif
60 #include "data.h"
61 #include "exceptions.h"
62 #include "collection.h"
63 #include "string.h"
64 
65 #ifdef __cplusplus
66 #define EXTERNAL extern "C"
67 #else
68 #define EXTERNAL
69 #endif
70 
74 typedef enum e_fiftyone_degrees_property_value_type {
85 
89 #pragma pack(push, 1)
90 typedef struct property_t {
91  const byte componentIndex;
92  const byte displayOrder;
94  const byte isMandatory;
96  const byte isList;
98  const byte showValues;
99  const byte isObsolete;
101  const byte show;
102  const byte valueType;
103  const uint32_t defaultValueIndex;
105  const uint32_t nameOffset;
107  const uint32_t descriptionOffset;
109  const uint32_t categoryOffset;
111  const uint32_t urlOffset;
113  const uint32_t firstValueIndex;
114  const uint32_t lastValueIndex;
115  const uint32_t mapCount;
116  const uint32_t firstMapIndex;
119 #pragma pack(pop)
120 
133  fiftyoneDegreesCollection *stringsCollection,
134  fiftyoneDegreesProperty *property,
136  fiftyoneDegreesException *exception);
137 
150  fiftyoneDegreesCollection *stringsCollection,
151  fiftyoneDegreesProperty *property,
153  fiftyoneDegreesException *exception);
154 
167  fiftyoneDegreesCollection *stringsCollection,
168  fiftyoneDegreesProperty *property,
170  fiftyoneDegreesException *exception);
171 
184  fiftyoneDegreesCollection *stringsCollection,
185  fiftyoneDegreesProperty *property,
187  fiftyoneDegreesException *exception);
188 
198  fiftyoneDegreesCollection *properties,
199  uint32_t index,
200  fiftyoneDegreesException *exception);
201 
213  fiftyoneDegreesCollection *properties,
214  uint32_t index,
216  fiftyoneDegreesException *exception);
217 
230  fiftyoneDegreesCollection *properties,
231  fiftyoneDegreesCollection *strings,
232  const char *requiredPropertyName,
234  fiftyoneDegreesException *exception);
235 
240 #endif
const byte valueType
The type of value the property represents.
Definition: property.h:102
Coordinate.
Definition: property.h:82
JavaScript string.
Definition: property.h:79
Single byte value.
Definition: property.h:81
Used to store a handle to the underlying item that could be used to release the item when it's finish...
Definition: collection.h:309
fiftyoneDegreesString * fiftyoneDegreesPropertyGetCategory(fiftyoneDegreesCollection *stringsCollection, fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string category of the property using the item provided.
Double.
Definition: property.h:77
const byte componentIndex
Index of the component.
Definition: property.h:91
const byte isList
True if the property is a list can return multiple values.
Definition: property.h:96
String.
Definition: property.h:75
fiftyoneDegreesString * fiftyoneDegreesPropertyGetDescription(fiftyoneDegreesCollection *stringsCollection, fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string description of the property using the item provided.
const uint32_t urlOffset
The offset in the strings structure to the property URL.
Definition: property.h:111
const uint32_t firstValueIndex
Index of the first possible value.
Definition: property.h:113
String structure containing its value and size.
Definition: string.h:114
fiftyoneDegreesPropertyValueType
Enum of property types.
Definition: property.h:74
const byte show
True if the property should be shown in GUIs.
Definition: property.h:101
const uint32_t firstMapIndex
The first index in the list of maps the property is associated with.
Definition: property.h:116
Integer.
Definition: property.h:76
Single precision floating point value.
Definition: property.h:80
const uint32_t descriptionOffset
The offset in the strings structure to the property description.
Definition: property.h:107
const uint32_t nameOffset
The offset in the strings structure to the property name.
Definition: property.h:105
const byte isObsolete
True if the property is obsolete and will be removed from future data sets.
Definition: property.h:99
fiftyoneDegreesProperty * fiftyoneDegreesPropertyGet(fiftyoneDegreesCollection *properties, uint32_t index, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Gets the property at the requested index from the properties collection provided.
Property structure containing all the meta data relating to a property.
Definition: property.h:90
fiftyoneDegreesString * fiftyoneDegreesPropertyGetName(fiftyoneDegreesCollection *stringsCollection, fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string name of the property using the item provided.
const byte isMandatory
True if the property is mandatory and must be provided.
Definition: property.h:94
const byte showValues
True if the values should be shown in GUIs.
Definition: property.h:98
fiftyoneDegreesString * fiftyoneDegreesPropertyGetUrl(fiftyoneDegreesCollection *stringsCollection, fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string URL of the property using the item provided.
const uint32_t categoryOffset
The offset in the strings structure to the property category.
Definition: property.h:109
const uint32_t defaultValueIndex
The default value index for the property.
Definition: property.h:103
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:116
fiftyoneDegreesProperty * fiftyoneDegreesPropertyGetByName(fiftyoneDegreesCollection *properties, fiftyoneDegreesCollection *strings, const char *requiredPropertyName, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Gets the property with the requested name from the properties collection provided.
byte fiftyoneDegreesPropertyGetValueType(fiftyoneDegreesCollection *properties, uint32_t index, fiftyoneDegreesException *exception)
Gets the value type for the property at the index in the collection.
Boolean.
Definition: property.h:78
Ip Range.
Definition: property.h:83
const uint32_t lastValueIndex
Index of the last possible value.
Definition: property.h:114
const uint32_t mapCount
Number of maps the property is associated with.
Definition: property.h:115
const byte displayOrder
The order the property should be displayed in relative to other properties.
Definition: property.h:92
All the shared methods and fields required by file, memory and cached collections.
Definition: collection.h:409