AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
|
Utilities for querying and manipulating save file data. More...
Go to the source code of this file.
Functions | |
int32_t | AERSaveGetCurrentSlot (void) |
Query the index of the currently active save slot. More... | |
size_t | AERSaveGetKeys (size_t bufSize, const char **keyBuf) |
Query the keys of all values in the save file (belonging to the calling mod). More... | |
void | AERSaveDestroy (const char *key) |
Erase a value from the save file. More... | |
double | AERSaveGetDouble (const char *key) |
Query a double value from the save file. More... | |
void | AERSaveSetDouble (const char *key, double value) |
Set a double value in the save file. More... | |
const char * | AERSaveGetString (const char *key) |
Query a string value from the save file. More... | |
void | AERSaveSetString (const char *key, const char *value) |
Set a string value in the save file. More... | |
Utilities for querying and manipulating save file data.
Each mod is given its own, unique namespace within the save file. That means two or more mods can use the same key without interfering with each other. That also means it is not possible to query/manipulate vanilla keys or the keys of other mods.
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.
void AERSaveDestroy | ( | const char * | key | ) |
Erase a value from the save file.
For information about key namespacing see Save Key Namespacing.
[in] | key | Save key. |
AER_SEQ_BREAK | if called outside action stage. |
AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid save key. |
int32_t AERSaveGetCurrentSlot | ( | void | ) |
Query the index of the currently active save slot.
0
.-1
if unsuccessful.AER_SEQ_BREAK | if called outside action stage. |
double AERSaveGetDouble | ( | const char * | key | ) |
Query a double value from the save file.
For information about key namespacing see Save Key Namespacing.
[in] | key | Save key. |
0.0
if unsuccessful.AER_SEQ_BREAK | if called outside action stage. |
AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid save key. |
AER_FAILED_PARSE | if key does not contain a double value. |
size_t AERSaveGetKeys | ( | size_t | bufSize, |
const char ** | keyBuf | ||
) |
Query the keys of all values in the save file (belonging to the calling mod).
For information about key namespacing see Save Key Namespacing.
keyBuf
must be large enough to hold at least bufSize
elements.bufSize
may be 0
in which case argument keyBuf
may be NULL
. This may be used to efficiently query the total number of keys contained in the save file (belonging to the calling mod).[in] | bufSize | Maximum number of elements to write to argument keyBuf . |
[out] | keyBuf | Buffer to write keys to. |
0
if unsuccessful.AER_SEQ_BREAK | if called outside action stage. |
AER_NULL_ARG | if argument keyBuf is NULL and argument bufSize is greater than 0 . |
const char * AERSaveGetString | ( | const char * | key | ) |
Query a string value from the save file.
For information about key namespacing see Save Key Namespacing.
[in] | key | Save key. |
NULL
if unsuccessful.AER_SEQ_BREAK | if called outside action stage. |
AER_NULL_ARG | if argument key is NULL . |
AER_FAILED_LOOKUP | if argument key is an invalid save key. |
AER_FAILED_PARSE | if key does not contain a string value. |
void AERSaveSetDouble | ( | const char * | key, |
double | value | ||
) |
Set a double value in the save file.
This function can both create new and update existing entries in the save file (regardless of type).
For information about key namespacing see Save Key Namespacing.
[in] | key | Save key. |
[in] | value | Double save value. |
AER_SEQ_BREAK | if called outside action stage. |
AER_NULL_ARG | if argument key is NULL . |
AER_BAD_VAL | if argument value is Inf , -Inf or NaN . |
void AERSaveSetString | ( | const char * | key, |
const char * | value | ||
) |
Set a string value in the save file.
This function can both create new and update existing entries in the save file (regardless of type).
For information about key namespacing see Save Key Namespacing.
[in] | key | Save key. |
[in] | value | String save value. |
AER_SEQ_BREAK | if called outside action stage. |
AER_NULL_ARG | if either argument key or value is NULL . |