AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
|
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... | |
Utilities for parsing configuration data.
Special thanks to Josiah Bills for helping design this section of the API.
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.
bool AERConfGetBool | ( | const char * | key | ) |
Parse a boolean value from the configuration data.
[in] | key | Configuration key. |
false
if unsuccessful.AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain a boolean value. |
size_t AERConfGetBools | ( | const char * | key, |
size_t | bufSize, | ||
bool * | boolBuf | ||
) |
Parse an array of boolean values from the configuration data.
boolBuf
must be large enough to hold at least bufSize
elements.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.[in] | key | Configuration key. |
[in] | bufSize | Maximum number of elements to write to argument boolBuf . |
[out] | boolBuf | Buffer to write booleans to. |
0
if unsuccessful.AER_NULL_ARG | if argument key is NULL or argument boolBuf is NULL and argument bufSize is greater than 0 . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain boolean values. |
double AERConfGetDouble | ( | const char * | key | ) |
Parse a double value from the configuration data.
[in] | key | Configuration key. |
0.0
if unsuccessful.AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain a double value. |
size_t AERConfGetDoubles | ( | const char * | key, |
size_t | bufSize, | ||
double * | doubleBuf | ||
) |
Parse an array of double values from the configuration data.
doubleBuf
must be large enough to hold at least bufSize
elements.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.[in] | key | Configuration key. |
[in] | bufSize | Maximum number of elements to write to argument doubleBuf . |
[out] | doubleBuf | Buffer to write doubles to. |
0
if unsuccessful.AER_NULL_ARG | if argument key is NULL or argument doubleBuf is NULL and argument bufSize is greater than 0 . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain double values. |
int64_t AERConfGetInt | ( | const char * | key | ) |
Parse an integer value from the configuration data.
[in] | key | Configuration key. |
0
if unsuccessful.AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain an integer value. |
size_t AERConfGetInts | ( | const char * | key, |
size_t | bufSize, | ||
int64_t * | intBuf | ||
) |
Parse an array of integer values from the configuration data.
intBuf
must be large enough to hold at least bufSize
elements.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.[in] | key | Configuration key. |
[in] | bufSize | Maximum number of elements to write to argument intBuf . |
[out] | intBuf | Buffer to write integers to. |
0
if unsuccessful.AER_NULL_ARG | if argument key is NULL or argument intBuf is NULL and argument bufSize is greater than 0 . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain integer values. |
const char * AERConfGetString | ( | const char * | key | ) |
Parse a string from the configuration data.
[in] | key | Configuration key. |
NULL
if unsuccessful.AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain a string. |
size_t AERConfGetStrings | ( | const char * | key, |
size_t | bufSize, | ||
const char ** | strBuf | ||
) |
Parse an array of strings from the configuration data.
strBuf
must be large enough to hold at least bufSize
elements.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.[in] | key | Configuration key. |
[in] | bufSize | Maximum number of elements to write to argument strBuf . |
[out] | strBuf | Buffer to write strings to. |
0
if unsuccessful.AER_NULL_ARG | if argument key is NULL or argument strBuf is NULL and argument bufSize is greater than 0 . |
AER_FAILED_LOOKUP | if argument key is an invalid configuration key. |
AER_FAILED_PARSE | if key does not contain strings. |