51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

value.h

1 /* *********************************************************************
2  * This Source Code Form 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 Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0.
8  *
9  * If a copy of the MPL was not distributed with this file, You can obtain
10  * one at http://mozilla.org/MPL/2.0/.
11  *
12  * This Source Code Form is "Incompatible With Secondary Licenses", as
13  * defined by the Mozilla Public License, v. 2.0.
14  * ******************************************************************** */
15 
16 #ifndef FIFTYONE_DEGREES_PROPERTY_VALUE_H_INCLUDED
17 #define FIFTYONE_DEGREES_PROPERTY_VALUE_H_INCLUDED
18 
47 #include <stdint.h>
48 #ifdef _MSC_VER
49 #include <windows.h>
50 #endif
51 #include "data.h"
52 #include "exceptions.h"
53 #include "collection.h"
54 #include "string.h"
55 #include "property.h"
56 #include "profile.h"
57 
58 #ifdef __cplusplus
59 #define EXTERNAL extern "C"
60 #else
61 #define EXTERNAL
62 #endif
63 
65 #pragma pack(push, 2)
66 typedef struct fiftyoneDegrees_value_t {
67  const int16_t propertyIndex;
68  const int32_t nameOffset;
70  const int32_t descriptionOffset;
72  const int32_t urlOffset;
75 #pragma pack(pop)
76 
90  fiftyoneDegreesValue *value,
92  fiftyoneDegreesException *exception);
93 
106  fiftyoneDegreesCollection *strings,
107  fiftyoneDegreesValue *value,
109  fiftyoneDegreesException *exception);
110 
123  fiftyoneDegreesCollection *strings,
124  fiftyoneDegreesValue *value,
126  fiftyoneDegreesException *exception);
127 
139  uint32_t valueIndex,
141  fiftyoneDegreesException *exception);
142 
156  fiftyoneDegreesCollection *strings,
157  fiftyoneDegreesProperty *property,
158  const char *valueName,
160  fiftyoneDegreesException *exception);
161 
174  fiftyoneDegreesCollection *strings,
175  fiftyoneDegreesProperty *property,
176  const char *valueName,
177  fiftyoneDegreesException *exception);
178 
183 #endif
const int32_t urlOffset
The offset in the strings structure to the value URL.
Definition: value.h:72
EXTERNAL fiftyoneDegreesValue * fiftyoneDegreesValueGetByName(fiftyoneDegreesCollection *values, fiftyoneDegreesCollection *strings, fiftyoneDegreesProperty *property, const char *valueName, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Get the value for the requested name from the collection provided.
Definition: value.c:119
Used to store a handle to the underlying item that could be used to release the item when it's finish...
Definition: collection.h:302
String structure containing its value and size.
Definition: string.h:80
const int32_t nameOffset
The offset in the strings structure to the value name.
Definition: value.h:68
Value structure containing meta data relating to the value.
Definition: value.h:66
Property structure containing all the meta data relating to a property.
Definition: property.h:75
EXTERNAL fiftyoneDegreesString * fiftyoneDegreesValueGetUrl(fiftyoneDegreesCollection *strings, fiftyoneDegreesValue *value, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string URL of the value using the item provided.
Definition: value.c:73
const int16_t propertyIndex
Index of the property the value relates to.
Definition: value.h:67
EXTERNAL fiftyoneDegreesValue * fiftyoneDegreesValueGet(fiftyoneDegreesCollection *values, uint32_t valueIndex, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Gets the value for the requested index from the collection provided.
Definition: value.c:81
const int32_t descriptionOffset
The offset in the strings structure to the value description.
Definition: value.h:70
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:109
EXTERNAL long fiftyoneDegreesValueGetIndexByName(fiftyoneDegreesCollection *values, fiftyoneDegreesCollection *strings, fiftyoneDegreesProperty *property, const char *valueName, fiftyoneDegreesException *exception)
Get index of the value for the requested name from the collection provided.
Definition: value.c:93
EXTERNAL fiftyoneDegreesString * fiftyoneDegreesValueGetDescription(fiftyoneDegreesCollection *strings, fiftyoneDegreesValue *value, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string description of the value using the item provided.
Definition: value.c:61
All the shared methods and fields required by file, memory and cached collections.
Definition: collection.h:400
EXTERNAL fiftyoneDegreesString * fiftyoneDegreesValueGetName(fiftyoneDegreesCollection *strings, fiftyoneDegreesValue *value, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
Returns the string name of the value using the item provided.
Definition: value.c:53