XMDF
2.2
|
Each of the functions returns a negative value if failure and a positive value for success. The following functions will retrieve the entire array of values for a property specified by its name. The id must be the id for the property group. The method to get the property group id will be given later.
The functions below are used to write properties. Property arrays are always one-dimensional arrays but can be any size. The size should be appropriate for the type of data stored. For example, if the property array stores the material property for a dataset of elements, the size of the property array should be the same as the number of elements.
The following functions are used to determine what property names are used in the group or to see if a property exists. The names of all properties are limited to 256 characters.
There may be times when the type of a property is unknown. The following function allows the user to get the type of data that is stored in a property. The function sets the integer ‘type’. The types, associated constants, and associated numbers are given in Table 3.
Table 3 Possible property types and the number associated with them.
If the property type is a string, we need to know the maximum string length used in the array. The following function gets the maximum length for a string data set.
All of the functions to retrieve properties must already be allocated to the correct size. The correct size can be determined using the xfGetPropertyNumber function.
The following function reads property strings with the property ID and allocates the required memory. Calling the function below is easier than calling xfReadPropertyString above, which requires the number and maximum length of the properties and also requires you to allocate memory. a_Properties does not need to be allocated before calling this function. If the function is successful, the memory stored in a_Properties must be free'd after this function is called.