AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
conf.h File Reference

Utilities for parsing configuration data. More...

Go to the source code of this file.

Functions

bool AERConfGetBool (const char *key)
 Parse a boolean value from the configuration data. More...
 
size_t AERConfGetBools (const char *key, size_t bufSize, bool *boolBuf)
 Parse an array of boolean values from the configuration data. More...
 
int64_t AERConfGetInt (const char *key)
 Parse an integer value from the configuration data. More...
 
size_t AERConfGetInts (const char *key, size_t bufSize, int64_t *intBuf)
 Parse an array of integer values from the configuration data. More...
 
double AERConfGetDouble (const char *key)
 Parse a double value from the configuration data. More...
 
size_t AERConfGetDoubles (const char *key, size_t bufSize, double *doubleBuf)
 Parse an array of double values from the configuration data. More...
 
const char * AERConfGetString (const char *key)
 Parse a string from the configuration data. More...
 
size_t AERConfGetStrings (const char *key, size_t bufSize, const char **strBuf)
 Parse an array of strings from the configuration data. More...
 

Detailed Description

Utilities for parsing configuration data.

Special thanks to Josiah Bills for helping design this section of the API.

Since
1.0.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ AERConfGetBool()

bool AERConfGetBool ( const char *  key)

Parse a boolean value from the configuration data.

Parameters
[in]keyConfiguration key.
Returns
Value of the key or false if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain a boolean value.
Since
1.0.0
See also
AERConfManGetBools

◆ AERConfGetBools()

size_t AERConfGetBools ( const char *  key,
size_t  bufSize,
bool *  boolBuf 
)

Parse an array of boolean values from the configuration data.

Warning
Argument boolBuf must be large enough to hold at least bufSize elements.
Note
Argument bufSize may be 0 in which case argument boolBuf may be NULL. This may be used to efficiently query the total number of booleans contained in the configuration data.
Parameters
[in]keyConfiguration key.
[in]bufSizeMaximum number of elements to write to argument boolBuf.
[out]boolBufBuffer to write booleans to.
Returns
Total number of booleans contained in configuration data or 0 if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL or argument boolBuf is NULL and argument bufSize is greater than 0.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain boolean values.
Since
1.0.0
See also
AERConfManGetBool

◆ AERConfGetDouble()

double AERConfGetDouble ( const char *  key)

Parse a double value from the configuration data.

Parameters
[in]keyConfiguration key.
Returns
Value of the key or 0.0 if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain a double value.
Since
1.0.0
See also
AERConfManGetDoubles

◆ AERConfGetDoubles()

size_t AERConfGetDoubles ( const char *  key,
size_t  bufSize,
double *  doubleBuf 
)

Parse an array of double values from the configuration data.

Warning
Argument doubleBuf must be large enough to hold at least bufSize elements.
Note
Argument bufSize may be 0 in which case argument doubleBuf may be NULL. This may be used to efficiently query the total number of doubles contained in the configuration data.
Parameters
[in]keyConfiguration key.
[in]bufSizeMaximum number of elements to write to argument doubleBuf.
[out]doubleBufBuffer to write doubles to.
Returns
Total number of doubles contained in configuration data or 0 if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL or argument doubleBuf is NULL and argument bufSize is greater than 0.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain double values.
Since
1.0.0
See also
AERConfManGetDouble

◆ AERConfGetInt()

int64_t AERConfGetInt ( const char *  key)

Parse an integer value from the configuration data.

Parameters
[in]keyConfiguration key.
Returns
Value of the key or 0 if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain an integer value.
Since
1.0.0
See also
AERConfManGetInts

◆ AERConfGetInts()

size_t AERConfGetInts ( const char *  key,
size_t  bufSize,
int64_t *  intBuf 
)

Parse an array of integer values from the configuration data.

Warning
Argument intBuf must be large enough to hold at least bufSize elements.
Note
Argument bufSize may be 0 in which case argument intBuf may be NULL. This may be used to efficiently query the total number of integers contained in the configuration data.
Parameters
[in]keyConfiguration key.
[in]bufSizeMaximum number of elements to write to argument intBuf.
[out]intBufBuffer to write integers to.
Returns
Total number of integers contained in configuration data or 0 if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL or argument intBuf is NULL and argument bufSize is greater than 0.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain integer values.
Since
1.0.0
See also
AERConfManGetInt

◆ AERConfGetString()

const char * AERConfGetString ( const char *  key)

Parse a string from the configuration data.

Parameters
[in]keyConfiguration key.
Returns
Value of the key or NULL if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain a string.
Since
1.0.0
See also
AERConfManGetStrings

◆ AERConfGetStrings()

size_t AERConfGetStrings ( const char *  key,
size_t  bufSize,
const char **  strBuf 
)

Parse an array of strings from the configuration data.

Warning
Argument strBuf must be large enough to hold at least bufSize elements.
Note
Argument bufSize may be 0 in which case argument strBuf may be NULL. This may be used to efficiently query the total number of strings contained in the configuration data.
Parameters
[in]keyConfiguration key.
[in]bufSizeMaximum number of elements to write to argument strBuf.
[out]strBufBuffer to write strings to.
Returns
Total number of strings contained in configuration data or 0 if unsuccessful.
Exceptions
AER_NULL_ARGif argument key is NULL or argument strBuf is NULL and argument bufSize is greater than 0.
AER_FAILED_LOOKUPif argument key is an invalid configuration key.
AER_FAILED_PARSEif key does not contain strings.
Since
1.0.0
See also
AERConfManGetString