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 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_PROPERTY_H_INCLUDED
24#define FIFTYONE_DEGREES_PROPERTY_H_INCLUDED
25
26#ifdef FIFTYONE_DEGREES_IPI_SYMBOLS
27#include "ipiSymbols.h"
28#endif
29
55
56#include <stdint.h>
57#ifdef _MSC_VER
58#pragma warning (push)
59#pragma warning (disable: 5105)
60#include <windows.h>
61#pragma warning (default: 5105)
62#pragma warning (pop)
63#endif
64#include "data.h"
65#include "exceptions.h"
66#include "collection.h"
67#include "string.h"
68#include "common.h"
69#include "propertyValueType.h"
70
74#pragma pack(push, 1)
75typedef struct property_t {
76 const byte componentIndex;
77 const byte displayOrder;
79 const byte isMandatory;
81 const byte isList;
83 const byte showValues;
84 const byte isObsolete;
86 const byte show;
87 const byte valueType;
88 const uint32_t defaultValueIndex;
90 const uint32_t nameOffset;
92 const uint32_t descriptionOffset;
94 const uint32_t categoryOffset;
96 const uint32_t urlOffset;
98 const uint32_t firstValueIndex;
99 const uint32_t lastValueIndex;
100 const uint32_t mapCount;
101 const uint32_t firstMapIndex;
104#pragma pack(pop)
105
109#pragma pack(push, 1)
110typedef struct property_type_record_t {
111 const uint32_t nameOffset;
113 const byte storedValueType;
115#pragma pack(pop)
116
129 const fiftyoneDegreesCollection *stringsCollection,
130 const fiftyoneDegreesProperty *property,
132 fiftyoneDegreesException *exception);
133
142EXTERNAL fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredType(
143 const fiftyoneDegreesCollection *propertyTypesCollection,
144 const fiftyoneDegreesProperty *property,
145 fiftyoneDegreesException *exception);
146
155EXTERNAL fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredTypeByIndex(
156 const fiftyoneDegreesCollection *propertyTypesCollection,
157 uint32_t index,
158 fiftyoneDegreesException *exception);
159
172 const fiftyoneDegreesCollection *stringsCollection,
173 const fiftyoneDegreesProperty *property,
175 fiftyoneDegreesException *exception);
176
189 const fiftyoneDegreesCollection *stringsCollection,
190 const fiftyoneDegreesProperty *property,
192 fiftyoneDegreesException *exception);
193
207 const fiftyoneDegreesCollection *stringsCollection,
208 const fiftyoneDegreesProperty *property,
210 fiftyoneDegreesException *exception);
211
221 fiftyoneDegreesCollection *properties,
222 uint32_t index,
223 fiftyoneDegreesException *exception);
224
236 fiftyoneDegreesCollection *properties,
237 uint32_t index,
239 fiftyoneDegreesException *exception);
240
253 fiftyoneDegreesCollection *properties,
255 const char *requiredPropertyName,
257 fiftyoneDegreesException *exception);
258
262
263#endif
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetCategory(const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string category of the property using the item provided.
byte fiftyoneDegreesPropertyGetValueType(fiftyoneDegreesCollection *properties, uint32_t index, fiftyoneDegreesException *exception)
Gets the value type for the property at the index in the collection.
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetUrl(const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string URL of the property using the item provided.
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetDescription(const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string description of the property using the item provided.
fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredType(const fiftyoneDegreesCollection *propertyTypesCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesException *exception)
Returns the type the property is stored as.
const 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.
fiftyoneDegreesProperty * fiftyoneDegreesPropertyGet(fiftyoneDegreesCollection *properties, uint32_t index, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Gets the property at the requested index from the properties collection provided.
fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredTypeByIndex(const fiftyoneDegreesCollection *propertyTypesCollection, uint32_t index, fiftyoneDegreesException *exception)
Returns the type the property is stored as.
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetName(const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string name of the property using the item provided.
All the shared methods and fields required by file, memory and cached collections.
Definition collection.h:408
Used to store a handle to the underlying item that could be used to release the item when it's finish...
Definition collection.h:315
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition exceptions.h:115
Property structure containing all the meta data relating to a property.
Definition property.h:75
const uint32_t mapCount
Number of maps the property is associated with.
Definition property.h:100
const uint32_t nameOffset
The offset in the strings structure to the property name.
Definition property.h:90
const byte displayOrder
The order the property should be displayed in relative to other properties.
Definition property.h:77
const byte valueType
The type of value the property represents.
Definition property.h:87
const uint32_t defaultValueIndex
The default value index for the property.
Definition property.h:88
const byte componentIndex
Index of the component.
Definition property.h:76
const byte isMandatory
True if the property is mandatory and must be provided.
Definition property.h:79
const uint32_t categoryOffset
The offset in the strings structure to the property category.
Definition property.h:94
const uint32_t lastValueIndex
Index of the last possible value.
Definition property.h:99
const byte showValues
True if the values should be shown in GUIs.
Definition property.h:83
const byte isObsolete
True if the property is obsolete and will be removed from future data sets.
Definition property.h:84
const byte show
True if the property should be shown in GUIs.
Definition property.h:86
const uint32_t descriptionOffset
The offset in the strings structure to the property description.
Definition property.h:92
const uint32_t firstMapIndex
The first index in the list of maps the property is associated with.
Definition property.h:101
const uint32_t urlOffset
The offset in the strings structure to the property URL.
Definition property.h:96
const uint32_t firstValueIndex
Index of the first possible value.
Definition property.h:98
const byte isList
True if the property is a list can return multiple values.
Definition property.h:81
Property structure containing stored type of a property.
Definition property.h:110
const uint32_t nameOffset
The offset in the strings structure to the property name.
Definition property.h:111
const byte storedValueType
The type of value the property is stored as.
Definition property.h:113
Definition string.h:97