◆ fiftyoneDegreesOverridable
Array of overridable properties.
These are properties in a data set which a capable of being overridden.
\r\n
Used to override properties values or an entire profile.
Overrides are used to override property values, or an entire profile in a set of results. For example, if the screen size is not known from the HTTP headers alone, it can be fetched using JavaScript and overridden.
An array of overridable properties is created using the fiftyoneDegreesOverridePropertiesCreate method. This returns all the properties which are capable of being overridden.
An array of override value ready to be populated is created using the fiftyoneDegreesOverrideValuesCreate method. This is then ready to be added to and used to override the values in a results structure.
Override values are extracted from an evidence structure using the fiftyoneDegreesOverridesExtractFromEvidence method. This looks through the items of evidence for any items which are overrides, then parses and adds them to the override values ready to be applied.
Override values can also be added using the fiftyoneDegreesOverridesAdd or fiftyoneDegreesOverrideValuesAdd methods which add a single or multiple values respectively to the override values.
Property and value overrides are freed using the fiftyoneDegreesOverridePropertiesFree and fiftyoneDegreesOverrideValuesFree methods.
struct | fiftyoneDegreesOverrideProperty
Index and pointer to a property which can be overridden. More...
|
struct | fiftyoneDegreesOverrideValue
String value which should override the value for the property indicated by the required property index. More...
|
struct | fiftyoneDegreesOverridePropertyArray
Array of items of type fiftyoneDegreesOverrideProperty used to easily access and track the size of the array. More...
|
struct | fiftyoneDegreesOverrideValueArray
An array of properties and values to use when getting override values. More...
|
typedef fiftyoneDegreesOverridePropertyArray | fiftyoneDegreesOverridable
Array of overridable properties. More...
|
typedef void(* | fiftyoneDegreesOverrideProfileIdMethod) (void *state, uint32_t profileId)
Called when a profile Id has been found and should override the one found from another source such as the User-Agent . More...
|
typedef bool(* | fiftyoneDegreesOverridesFilterMethod) (void *state, uint32_t requiredPropertyIndex)
Determines if the required property index is eligible for overriding considering the configuration of the data set. More...
|
fiftyoneDegreesOverrideValueArray * | fiftyoneDegreesOverrideValuesCreate (uint32_t capacity)
Creates a fresh array of override values with the given capacity. More...
|
fiftyoneDegreesOverridePropertyArray * | fiftyoneDegreesOverridePropertiesCreate (fiftyoneDegreesPropertiesAvailable *available, bool prefix, void *state, fiftyoneDegreesOverridesFilterMethod filter)
Returns a list of the evidence keys that are available to support overriding property values. More...
|
void | fiftyoneDegreesOverridePropertiesFree (fiftyoneDegreesOverridePropertyArray *properties)
Frees the resources used by the override properties. More...
|
uint32_t | fiftyoneDegreesOverridesExtractFromEvidence (fiftyoneDegreesOverridePropertyArray *properties, fiftyoneDegreesOverrideValueArray *values, fiftyoneDegreesEvidenceKeyValuePairArray *evidence)
Extracts override values from evidence. More...
|
bool | fiftyoneDegreesOverrideHasValueForRequiredPropertyIndex (fiftyoneDegreesOverrideValueArray *values, uint32_t requiredPropertyIndex)
Gets whether or not the override values contain an override relating to the property identified by the required property index. More...
|
uint32_t | fiftyoneDegreesOverrideValuesAdd (fiftyoneDegreesOverrideValueArray *values, uint32_t requiredPropertyIndex, fiftyoneDegreesList *list)
Adds values from the overrides data structure into the results. More...
|
bool | fiftyoneDegreesOverridesAdd (fiftyoneDegreesOverrideValueArray *values, int requiredPropertyIndex, const char *value)
Add an value override to the override values array. More...
|
fiftyoneDegreesString * | fiftyoneDegreesOverrideValuesGetFirst (fiftyoneDegreesOverrideValueArray *values, uint32_t requiredPropertyIndex, fiftyoneDegreesCollectionItem *item)
Returns the first value for the required property index or NULL of no value exists for the property index. More...
|
int | fiftyoneDegreesOverridesGetOverridingRequiredPropertyIndex (fiftyoneDegreesPropertiesAvailable *available, uint32_t requiredPropertyIndex)
Gets the required property index of a property that MIGHT provide logic such as JavaScript or Regular Expressions that could override the value of the required property index provided. More...
|
void | fiftyoneDegreesOverrideValuesFree (fiftyoneDegreesOverrideValueArray *values)
Frees the memory used for the override values. More...
|
void | fiftyoneDegreesOverrideValuesReset (fiftyoneDegreesOverrideValueArray *values)
Reset override array. More...
|
void | fiftyoneDegreesOverrideProfileIds (fiftyoneDegreesEvidenceKeyValuePairArray *evidence, void *state, fiftyoneDegreesOverrideProfileIdMethod override)
Extracts the profile overrides from the evidence and overrides them using the override method supplied. More...
|
Array of overridable properties.
These are properties in a data set which a capable of being overridden.
typedef void(* fiftyoneDegreesOverrideProfileIdMethod) (void *state, uint32_t profileId) |
Called when a profile Id has been found and should override the one found from another source such as the User-Agent
.
typedef bool(* fiftyoneDegreesOverridesFilterMethod) (void *state, uint32_t requiredPropertyIndex) |
Determines if the required property index is eligible for overriding considering the configuration of the data set.
bool fiftyoneDegreesOverrideHasValueForRequiredPropertyIndex | ( | fiftyoneDegreesOverrideValueArray * | values, |
uint32_t | requiredPropertyIndex | ||
) |
Gets whether or not the override values contain an override relating to the property identified by the required property index.
Note that the required property index MUST be valid when calling this method, so should be checked by the caller.
void fiftyoneDegreesOverrideProfileIds | ( | fiftyoneDegreesEvidenceKeyValuePairArray * | evidence, |
void * | state, | ||
fiftyoneDegreesOverrideProfileIdMethod | override | ||
) |
Extracts the profile overrides from the evidence and overrides them using the override method supplied.
fiftyoneDegreesOverridePropertyArray* fiftyoneDegreesOverridePropertiesCreate | ( | fiftyoneDegreesPropertiesAvailable * | available, |
bool | prefix, | ||
void * | state, | ||
fiftyoneDegreesOverridesFilterMethod | filter | ||
) |
Returns a list of the evidence keys that are available to support overriding property values.
51D_
prefix should be checked for in evidence void fiftyoneDegreesOverridePropertiesFree | ( | fiftyoneDegreesOverridePropertyArray * | properties | ) |
Frees the resources used by the override properties.
bool fiftyoneDegreesOverridesAdd | ( | fiftyoneDegreesOverrideValueArray * | values, |
int | requiredPropertyIndex, | ||
const char * | value | ||
) |
Add an value override to the override values array.
uint32_t fiftyoneDegreesOverridesExtractFromEvidence | ( | fiftyoneDegreesOverridePropertyArray * | properties, |
fiftyoneDegreesOverrideValueArray * | values, | ||
fiftyoneDegreesEvidenceKeyValuePairArray * | evidence | ||
) |
Extracts override values from evidence.
int fiftyoneDegreesOverridesGetOverridingRequiredPropertyIndex | ( | fiftyoneDegreesPropertiesAvailable * | available, |
uint32_t | requiredPropertyIndex | ||
) |
Gets the required property index of a property that MIGHT provide logic such as JavaScript or Regular Expressions that could override the value of the required property index provided.
uint32_t fiftyoneDegreesOverrideValuesAdd | ( | fiftyoneDegreesOverrideValueArray * | values, |
uint32_t | requiredPropertyIndex, | ||
fiftyoneDegreesList * | list | ||
) |
Adds values from the overrides data structure into the results.
fiftyoneDegreesOverrideValueArray* fiftyoneDegreesOverrideValuesCreate | ( | uint32_t | capacity | ) |
Creates a fresh array of override values with the given capacity.
void fiftyoneDegreesOverrideValuesFree | ( | fiftyoneDegreesOverrideValueArray * | values | ) |
Frees the memory used for the override values.
fiftyoneDegreesString* fiftyoneDegreesOverrideValuesGetFirst | ( | fiftyoneDegreesOverrideValueArray * | values, |
uint32_t | requiredPropertyIndex, | ||
fiftyoneDegreesCollectionItem * | item | ||
) |
Returns the first value for the required property index or NULL of no value exists for the property index.
void fiftyoneDegreesOverrideValuesReset | ( | fiftyoneDegreesOverrideValueArray * | values | ) |
Reset override array.
All existing item memory will not be freed by reset with 0s. Remaining values will be reset to default except the allocateds size..