◆ fiftyoneDegreesProfileIterateMethod
typedef bool(* fiftyoneDegreesProfileIterateMethod) (void *state, fiftyoneDegreesCollectionItem *item) |
Definition of a callback function which is passed an item of a type determined by the iteration method.
- Parameters
-
- state - pointer to data needed by the method
- item - to store each profile in while iterating
- Returns
- true if the iteration should continue, otherwise false to stop
Function Documentation
◆ fiftyoneDegreesProfileGetByIndex()
fiftyoneDegreesProfile* fiftyoneDegreesProfileGetByIndex ( fiftyoneDegreesCollection * profileOffsets, fiftyoneDegreesCollection * profiles, uint32_t index, fiftyoneDegreesCollectionItem * item, fiftyoneDegreesException * exception ) Gets a pointer to the profile at the index provided.
The index refers to the index in the profile offsets collection as this contains fixed size entities which can be quickly looked up. The variable sized profile is then returned from that.
- Parameters
-
- profileOffsets - collection containing the profile offsets
- profiles - collection containing the profiles referenced by the profile offsets
- index - of the profile to return
- item - to set as the handle to the profile returned
- exception - pointer to an exception data structure to be used if an exception occurs. See exceptions.h
- Returns
- pointer to the profile at the index
◆ fiftyoneDegreesProfileGetByProfileId()
fiftyoneDegreesProfile* fiftyoneDegreesProfileGetByProfileId ( fiftyoneDegreesCollection * profileOffsets, fiftyoneDegreesCollection * profiles, const uint32_t profileId, fiftyoneDegreesCollectionItem * item, fiftyoneDegreesException * exception ) Gets the profile associated with the profileId or NULL if there is no corresponding profile.
- Parameters
-
- profileOffsets - collection containing the profile offsets
- profiles - collection containing the profiles referenced by the profile offsets
- profileId - the unique id of the profile to fetch
- item - to set as the handle to the profile returned
- exception - pointer to an exception data structure to be used if an exception occurs. See exceptions.h
- Returns
- pointer to the profile or NULL
◆ fiftyoneDegreesProfileGetOffsetForProfileId()
uint32_t* fiftyoneDegreesProfileGetOffsetForProfileId ( fiftyoneDegreesCollection * profileOffsets, const uint32_t profileId, uint32_t * profileOffset, fiftyoneDegreesException * exception ) Gets the offset in the profiles collection for the profile with the profileId or NULL if there is no corresponding profile.
- Parameters
-
- profileOffsets - collection containing the profile offsets
- profileId - the unique id of the profile to fetch
- profileOffset - pointer to the integer to set the offset in
- exception - pointer to an exception data structure to be used if an exception occurs. See exceptions.h
- Returns
- pointer to the profile offset or NULL
◆ fiftyoneDegreesProfileIterateProfilesForPropertyAndValue()
uint32_t fiftyoneDegreesProfileIterateProfilesForPropertyAndValue ( fiftyoneDegreesCollection * strings, fiftyoneDegreesCollection * properties, fiftyoneDegreesCollection * values, fiftyoneDegreesCollection * profiles, fiftyoneDegreesCollection * profileOffsets, const char * propertyName, const char * valueName, void * state, fiftyoneDegreesProfileIterateMethod callback, fiftyoneDegreesException * exception ) Iterate all profiles which contain the specified value, calling the callback method for each.
- Parameters
-
- strings - collection containing the strings referenced properties and values
- properties - collection containing all properties
- values - collection containing all values
- profiles - collection containing the profiles referenced by the profile offsets
- profileOffsets - collection containing all profile offsets
- propertyName - name of the property the value relates to
- valueName - name of the value to iterate the profiles for
- state - pointer to data needed by the callback method
- callback - method to be called for each matching profile
- exception - pointer to an exception data structure to be used if an exception occurs. See exceptions.h
- Returns
- the number matching profiles which have been iterated
◆ fiftyoneDegreesProfileIterateValuesForProperty()
uint32_t fiftyoneDegreesProfileIterateValuesForProperty ( fiftyoneDegreesCollection * values, fiftyoneDegreesProfile * profile, fiftyoneDegreesProperty * property, void * state, fiftyoneDegreesProfileIterateMethod callback, fiftyoneDegreesException * exception ) Iterate over all values contained in the profile which relate to the specified property, calling the callback method for each.
- Parameters
-
- values - collection containing all values
- profile - pointer to the profile to iterate the values of
- property - which the values must relate to
- state - pointer containing data needed for the callback method
- callback - method to be called for each value
- exception - pointer to an exception data structure to be used if an exception occurs. See exceptions.h
- Returns
- the number of matching values which have been iterated
◆ fiftyoneDegreesProfileReadFromFile()
void* fiftyoneDegreesProfileReadFromFile ( const fiftyoneDegreesCollectionFile * file, uint32_t offset, fiftyoneDegreesData * data, fiftyoneDegreesException * exception ) Read a profile from the file collection provided and store in the data pointer.
This method is used when creating a collection from file.
- Parameters
-
- file - collection to read from
- offset - of the profile in the collection
- data - to store the resulting profile in
- exception - pointer to an exception data structure to be used if an exception occurs. See exceptions.h
- Returns
- pointer to the profile allocated within the data structure