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

Property

Detailed Description

Property in a data set relating to a single component.

Introduction

A property is stored in a properties collection and contains the meta data for a specific property in a data set.

Get

A property can be fetched from a properties collection in one of two ways:

By Index : The fiftyoneDegreesPropertyGet method return the property at a specified index. This provides a way to access a property at a known index, or iterate over all properties.

By Name : If the index of a property is not known, then the property can be fetched using the fiftyoneDegreesPropertyGetByName method to find the property in a properties collection.

Collaboration diagram for Property:

Structs

struct  fiftyoneDegreesProperty
 Property structure containing all the meta data relating to a property. More...
struct  fiftyoneDegreesPropertyTypeRecord
 Property structure containing stored type of a property. More...

Enumerations

enum  fiftyoneDegreesPropertyText {
  FIFTYONE_DEGREES_PROPERTY_TEXT_NAME = 0 , FIFTYONE_DEGREES_PROPERTY_TEXT_DESCRIPTION = 1 , FIFTYONE_DEGREES_PROPERTY_TEXT_CATEGORY = 2 , FIFTYONE_DEGREES_PROPERTY_TEXT_URL = 3 ,
  FIFTYONE_DEGREES_PROPERTY_TEXT_DEFAULT_VALUE = 4
}
 The text of a property that fiftyoneDegreesPropertyGetText gives. More...

Functions

const fiftyoneDegreesString * fiftyoneDegreesPropertyGetName (const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
 Returns the string name 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.
fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredTypeByIndex (const fiftyoneDegreesCollection *propertyTypesCollection, uint32_t index, fiftyoneDegreesException *exception)
 Returns the type the property is stored as.
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetDescription (const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
 Returns the string description of the property using the item provided.
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetCategory (const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
 Returns the string category of the property using the item provided.
const fiftyoneDegreesString * fiftyoneDegreesPropertyGetUrl (const fiftyoneDegreesCollection *stringsCollection, const fiftyoneDegreesProperty *property, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
 Returns the string URL 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.
fiftyoneDegreesProperty * fiftyoneDegreesPropertyGet (fiftyoneDegreesCollection *properties, uint32_t index, fiftyoneDegreesCollectionItem *item, fiftyoneDegreesException *exception)
 Gets the property at the requested index from the properties collection provided.
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.
int fiftyoneDegreesPropertyGetIndexByName (fiftyoneDegreesCollection *properties, fiftyoneDegreesCollection *strings, const char *propertyName, fiftyoneDegreesException *exception)
 Gets the index in the properties collection of the property with the name provided, which must match exactly.
char * fiftyoneDegreesPropertyGetText (const fiftyoneDegreesCollection *values, const fiftyoneDegreesCollection *strings, const fiftyoneDegreesCollection *propertyTypes, const fiftyoneDegreesProperty *property, fiftyoneDegreesPropertyText text, char *buffer, size_t bufferLength, fiftyoneDegreesException *exception)
 Gets a text of the property as the metadata gives it.
char * fiftyoneDegreesPropertyGetMapText (const fiftyoneDegreesCollection *strings, const fiftyoneDegreesCollection *maps, const fiftyoneDegreesProperty *property, uint32_t mapIndex, char *buffer, size_t bufferLength, fiftyoneDegreesException *exception)
 Gets the name of one of the maps the property is in, which the metadata gives as the data files the property is present in, such as "Lite".
uint32_t fiftyoneDegreesPropertyGetValueCount (const fiftyoneDegreesCollection *values, const fiftyoneDegreesProperty *property)
 Gets the number of values the values collection holds for the property, which are at the indexes from its firstValueIndex to its lastValueIndex.

Enumeration Type Documentation

◆ fiftyoneDegreesPropertyText

The text of a property that fiftyoneDegreesPropertyGetText gives.

Enumerator

FIFTYONE_DEGREES_PROPERTY_TEXT_NAME 

The property's name.

FIFTYONE_DEGREES_PROPERTY_TEXT_DESCRIPTION 

The property's description, empty when it has none.

FIFTYONE_DEGREES_PROPERTY_TEXT_CATEGORY 

The name of the category the property is in, empty when it is in none.

FIFTYONE_DEGREES_PROPERTY_TEXT_URL 

The URL of more about the property, empty when it has none.

FIFTYONE_DEGREES_PROPERTY_TEXT_DEFAULT_VALUE 

The property's default value, as fiftyoneDegreesValueGetDefaultText gives it.

Function Documentation

◆ fiftyoneDegreesPropertyGet()

fiftyoneDegreesProperty * fiftyoneDegreesPropertyGet ( fiftyoneDegreesCollection * properties,
uint32_t index,
fiftyoneDegreesCollectionItem * item,
fiftyoneDegreesException * exception )

Gets the property at the requested index from the properties collection provided.

Parameters
propertiesto get the property from
indexof the property to get
itemto store the property item in
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
the property requested or NULL

◆ fiftyoneDegreesPropertyGetByName()

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.

Parameters
propertiesto get the property from
stringscollection containing the names of the properties
requiredPropertyNamename of the property to get
itemto store the property item in
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
the property requested or NULL

◆ fiftyoneDegreesPropertyGetCategory()

const fiftyoneDegreesString * fiftyoneDegreesPropertyGetCategory ( const fiftyoneDegreesCollection * stringsCollection,
const fiftyoneDegreesProperty * property,
fiftyoneDegreesCollectionItem * item,
fiftyoneDegreesException * exception )

Returns the string category of the property using the item provided.

The collection item must be released when the caller is finished with the string.

Parameters
stringsCollectioncollection of strings retrieved by offsets.
propertystructure for the category required.
itemused to store the resulting string in.
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
a pointer to a string in the collection item data structure.

◆ fiftyoneDegreesPropertyGetDescription()

const fiftyoneDegreesString * fiftyoneDegreesPropertyGetDescription ( const fiftyoneDegreesCollection * stringsCollection,
const fiftyoneDegreesProperty * property,
fiftyoneDegreesCollectionItem * item,
fiftyoneDegreesException * exception )

Returns the string description of the property using the item provided.

The collection item must be released when the caller is finished with the string.

Parameters
stringsCollectioncollection of strings retrieved by offsets.
propertystructure for the description required.
itemused to store the resulting string in.
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
a pointer to a string in the collection item data structure.

◆ fiftyoneDegreesPropertyGetIndexByName()

int fiftyoneDegreesPropertyGetIndexByName ( fiftyoneDegreesCollection * properties,
fiftyoneDegreesCollection * strings,
const char * propertyName,
fiftyoneDegreesException * exception )

Gets the index in the properties collection of the property with the name provided, which must match exactly.

This finds the property that fiftyoneDegreesPropertyGetByName gets.

Parameters
propertiescollection to find the property in
stringscollection containing the names of the properties
propertyNamename of the property to find
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
the 0 based index of the property, or -1 when no property has the name or reading a property or a name sets the exception. A property whose name the strings collection gives nothing for is taken as the one named, so its index is returned.

◆ fiftyoneDegreesPropertyGetMapText()

char * fiftyoneDegreesPropertyGetMapText ( const fiftyoneDegreesCollection * strings,
const fiftyoneDegreesCollection * maps,
const fiftyoneDegreesProperty * property,
uint32_t mapIndex,
char * buffer,
size_t bufferLength,
fiftyoneDegreesException * exception )

Gets the name of one of the maps the property is in, which the metadata gives as the data files the property is present in, such as "Lite".

The name is written as fiftyoneDegreesPropertyGetText writes a text.

Parameters
stringscollection containing the names of the maps
mapscollection of the offsets in strings of the map names
propertythe property to get the name of a map of
mapIndexthe 0 based place of the map among the property's mapCount maps
buffermemory the name is written into when it fits
bufferLengththe bytes buffer holds
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
the null terminated name, or NULL. NULL with no exception set means the strings collection gives nothing at the map's offset, and NULL with the exception set means mapIndex is not less than the property's mapCount or the name cannot be read or written.

◆ fiftyoneDegreesPropertyGetName()

const fiftyoneDegreesString * fiftyoneDegreesPropertyGetName ( const fiftyoneDegreesCollection * stringsCollection,
const fiftyoneDegreesProperty * property,
fiftyoneDegreesCollectionItem * item,
fiftyoneDegreesException * exception )

Returns the string name of the property using the item provided.

The collection item must be released when the caller is finished with the string.

Parameters
stringsCollectioncollection of strings retrieved by offsets.
propertystructure for the name required.
itemused to store the resulting string in.
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
a pointer to a string in the collection item data structure.

◆ fiftyoneDegreesPropertyGetStoredType()

fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredType ( const fiftyoneDegreesCollection * propertyTypesCollection,
const fiftyoneDegreesProperty * property,
fiftyoneDegreesException * exception )

Returns the type the property is stored as.

Parameters
propertyTypesCollectioncollection of property types retrieved by offsets.
propertystructure for the type required.
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
a type the property is stored as.

◆ fiftyoneDegreesPropertyGetStoredTypeByIndex()

fiftyoneDegreesPropertyValueType fiftyoneDegreesPropertyGetStoredTypeByIndex ( const fiftyoneDegreesCollection * propertyTypesCollection,
uint32_t index,
fiftyoneDegreesException * exception )

Returns the type the property is stored as.

Parameters
propertyTypesCollectioncollection of property types retrieved by offsets.
indexof the property to get
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
a type the property is stored as.

◆ fiftyoneDegreesPropertyGetText()

char * fiftyoneDegreesPropertyGetText ( const fiftyoneDegreesCollection * values,
const fiftyoneDegreesCollection * strings,
const fiftyoneDegreesCollection * propertyTypes,
const fiftyoneDegreesProperty * property,
fiftyoneDegreesPropertyText text,
char * buffer,
size_t bufferLength,
fiftyoneDegreesException * exception )

Gets a text of the property as the metadata gives it.

A description, category or URL the property does not have is an empty text, as is a string the strings collection gives nothing for. The text is written into buffer when it fits, and otherwise into memory the caller frees, as fiftyoneDegreesStoredBinaryValueToText describes.

Parameters
valuescollection containing the property's values, which only FIFTYONE_DEGREES_PROPERTY_TEXT_DEFAULT_VALUE reads
stringscollection containing the property's strings
propertyTypescollection of the type each property's values are stored as, or NULL when every value is stored as a string, which only FIFTYONE_DEGREES_PROPERTY_TEXT_DEFAULT_VALUE reads
propertythe property to get the text of
textwhich text of the property to get
buffermemory the text is written into when it fits
bufferLengththe bytes buffer holds
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
the null terminated text, or NULL when it cannot be read or written or text is none of fiftyoneDegreesPropertyText

◆ fiftyoneDegreesPropertyGetUrl()

const fiftyoneDegreesString * fiftyoneDegreesPropertyGetUrl ( const fiftyoneDegreesCollection * stringsCollection,
const fiftyoneDegreesProperty * property,
fiftyoneDegreesCollectionItem * item,
fiftyoneDegreesException * exception )

Returns the string URL of the property using the item provided.

The collection item must be released when the caller is finished with the string.

Parameters
stringsCollectioncollection of strings retrieved by offsets.
propertystructure for the URL required.
itemused to store the resulting string in.
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
a pointer to a string in the collection item data structure, or to an empty string if the property has no URL.

◆ fiftyoneDegreesPropertyGetValueCount()

uint32_t fiftyoneDegreesPropertyGetValueCount ( const fiftyoneDegreesCollection * values,
const fiftyoneDegreesProperty * property )

Gets the number of values the values collection holds for the property, which are at the indexes from its firstValueIndex to its lastValueIndex.

A property whose value indexes are not both in the collection, as when both are -1, has none.

Parameters
valuescollection containing the property's values
propertythe property to count the values of
Returns
the number of values

◆ fiftyoneDegreesPropertyGetValueType()

byte fiftyoneDegreesPropertyGetValueType ( fiftyoneDegreesCollection * properties,
uint32_t index,
fiftyoneDegreesException * exception )

Gets the value type for the property at the index in the collection.

Parameters
propertiescollection to retrieve the property type from
indexof the property in the collection
exceptionpointer to an exception data structure to be used if an exception occurs. See exceptions.h.
Returns
the value type as a byte for the property at the index.