TORCS  1.3.9
The Open Racing Car Simulator
Parameter List Handling API

Handling of multiple sections or subsections and the elements in parameter sets. More...

Collaboration diagram for Parameter List Handling API:

Functions

int GfParmGetEltNb (void *handle, const char *path)
 Count the number of subsections in a section in the parameter set handle. More...
 
int GfParmListSeekFirst (void *handle, const char *path)
 Go the the first subsection element in the parameter set handle. More...
 
int GfParmListSeekNext (void *handle, const char *path)
 Go the the next subsection element in the parameter set handle. More...
 
int GfParmListClean (void *handle, const char *path)
 Remove all the subsections in a section in the parameter set handle. More...
 
char * GfParmListGetCurEltName (void *handle, const char *path)
 Get current subsection name of the parameter set handle during subsection iteration. More...
 
const char * GfParmGetCurStr (void *handle, const char *path, const char *key, const char *deflt)
 Get a string parameter from the parameter set handle based on subsection iteration. More...
 
tdble GfParmGetCurNum (void *handle, const char *path, const char *key, const char *unit, tdble deflt)
 Get a numerical parameter from the parameter set handle based on subsection iteration. More...
 
int GfParmSetCurStr (void *handle, const char *path, const char *key, const char *val)
 Set a string parameter in the parameter set handle based on subsection iteration. More...
 
int GfParmSetCurNum (void *handle, const char *path, const char *key, const char *unit, tdble val)
 Set a numerical parameter in the parameter set handle based on subsection iteration. More...
 

Detailed Description

Handling of multiple sections or subsections and the elements in parameter sets.

Function Documentation

◆ GfParmGetCurNum()

tdble GfParmGetCurNum ( void *  handle,
const char *  path,
const char *  key,
const char *  unit,
tdble  deflt 
)

Get a numerical parameter from the parameter set handle based on subsection iteration.

The internal state of the parameter set handle must point to a current subsection, this is done using GfParmListSeekFirst or GfParmListSeekNext. If the parameter does not exist the given default value is returned without unit conversion.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in]handleparameter set handle
[in]pathpath of the section used to iterate subsections
[in]keyparameter key name
[in]unitunit to convert the result to (NULL if SI is desired)
[in]defltdefault value
Returns
parameter value
See also
GfParmListSeekFirst
GfParmListSeekNext

Definition at line 2435 of file params.cpp.

Here is the call graph for this function:

◆ GfParmGetCurStr()

const char* GfParmGetCurStr ( void *  handle,
const char *  path,
const char *  key,
const char *  deflt 
)

Get a string parameter from the parameter set handle based on subsection iteration.

The internal state of the parameter set handle must point to a current subsection, this is done using GfParmListSeekFirst or GfParmListSeekNext. If the parameter does not yet exist the given default is returned.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in]handleparameter set handle
[in]pathpath of the section used to iterate subsections
[in]keyparameter key name
[in]defltdefault string
Returns
parameter value
deflt if error or not found
Note
The pointer returned is for immediate use, if you plan to keep the value for a long time, it is necessary to copy the string, because removing the attribute will produce an incoherent pointer.
See also
GfParmListSeekFirst
GfParmListSeekNext

Definition at line 2354 of file params.cpp.

Here is the call graph for this function:

◆ GfParmGetEltNb()

int GfParmGetEltNb ( void *  handle,
const char *  path 
)

Count the number of subsections in a section in the parameter set handle.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in]handleparameter set handle
[in]pathpath of the section containing the subsections to count
Returns
element count

Definition at line 2106 of file params.cpp.

Here is the call graph for this function:

◆ GfParmListClean()

int GfParmListClean ( void *  handle,
const char *  path 
)

Remove all the subsections in a section in the parameter set handle.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in,out]handleparameter set handle
[in]pathpath of the section containing the subsections to remove
Returns
0 Ok
-1 Error

Definition at line 2221 of file params.cpp.

Here is the call graph for this function:

◆ GfParmListGetCurEltName()

char* GfParmListGetCurEltName ( void *  handle,
const char *  path 
)

Get current subsection name of the parameter set handle during subsection iteration.

The internal state of the parameter set handle must point to a current subsection, this is done using GfParmListSeekFirst or GfParmListSeekNext. This call returns the name of the current subsection.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in]handleparameter set handle
[in]pathpath of the section used to iterate subsections
Returns
Name of the current subsection
NULL if failed
Note
The pointer returned is for immediate use, if you plan to keep the value for a long time, it is necessary to copy the string, because removing the section will produce an incoherent pointer.
See also
GfParmListSeekFirst
GfParmListSeekNext

Definition at line 2268 of file params.cpp.

Here is the call graph for this function:

◆ GfParmListSeekFirst()

int GfParmListSeekFirst ( void *  handle,
const char *  path 
)

Go the the first subsection element in the parameter set handle.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in,out]handleparameter set handle, interation state is internally stored
[in]pathpath of the section containing the subsections to iterate through
Returns
0 Ok
-1 Failed
See also
GfParmListSeekNext
GfParmListGetCurEltName

Definition at line 2148 of file params.cpp.

Here is the call graph for this function:

◆ GfParmListSeekNext()

int GfParmListSeekNext ( void *  handle,
const char *  path 
)

Go the the next subsection element in the parameter set handle.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in,out]handleparameter set handle, interation state is internally stored
[in]pathpath of the section containing the subsections to iterate through
Returns
0 Ok
1 End of list reached
-1 Failed
See also
GfParmListSeekFirst
GfParmListGetCurEltName

Definition at line 2184 of file params.cpp.

Here is the call graph for this function:

◆ GfParmSetCurNum()

int GfParmSetCurNum ( void *  handle,
const char *  path,
const char *  key,
const char *  unit,
tdble  val 
)

Set a numerical parameter in the parameter set handle based on subsection iteration.

The internal state of the parameter set handle must point to a current subsection, this is done using GfParmListSeekFirst or GfParmListSeekNext. If the parameter does not yet exist it is created. The value is assigned to the value, min and max.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in,out]handleparameter set handle
[in]pathpath of the section used to iterate subsections
[in]keyparameter key name
[in]unitunit to convert the result to (NULL if SI is desired)
[in]valvalue to set
Returns
0 ok
-1 error
See also
GfParmListSeekFirst
GfParmListSeekNext

Definition at line 2679 of file params.cpp.

Here is the call graph for this function:

◆ GfParmSetCurStr()

int GfParmSetCurStr ( void *  handle,
const char *  path,
const char *  key,
const char *  val 
)

Set a string parameter in the parameter set handle based on subsection iteration.

The internal state of the parameter set handle must point to a current subsection, this is done using GfParmListSeekFirst or GfParmListSeekNext. If the parameter does not yet exist it is created. The within constraint is not checked.

A subsection can have any name and structure, any section element enclosed by the section given in the path is a subsection.

Parameters
[in,out]handleparameter set handle
[in]pathpath of the section used to iterate subsections
[in]keyparameter key name
[in]valvalue (NULL or empty string to remove the parameter)
Returns
0 ok
-1 error
See also
GfParmListSeekFirst
GfParmListSeekNext

Definition at line 2532 of file params.cpp.

Here is the call graph for this function: