Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MODSERIAL FATFileSystem
ConfigFile Class Reference
Configuration File class. More...
#include <ConfigFile.h>
Public Member Functions | |
| ConfigFile () | |
| Create a configuration file class. | |
| ~ConfigFile () | |
| Destroy a configuration file class. | |
| bool | getValue (char *key, char *value, size_t siz) |
| Get a value for a key. | |
| bool | setValue (char *key, char *value) |
| Set a set of a key and value. | |
| bool | remove (char *key) |
| Remove a config. | |
| bool | removeAll (void) |
| Remove all config. | |
| int | getCount () |
| Get a number of configuration sets. | |
| bool | getKeyAndValue (int index, char *key, size_t keybufsiz, char *value, size_t valuebufsiz) |
| Get a key and a value. | |
| bool | read (char *file) |
| Read from the target file. | |
| bool | write (char *file, char *header=NULL, FileFormat ff=UNIX) |
| Write from the target file. | |
Detailed Description
Configuration File class.
Definition at line 15 of file ConfigFile.h.
Constructor & Destructor Documentation
| ConfigFile | ( | ) |
Create a configuration file class.
Definition at line 16 of file ConfigFile.cpp.
| ~ConfigFile | ( | ) |
Destroy a configuration file class.
Definition at line 29 of file ConfigFile.cpp.
Member Function Documentation
| int getCount | ( | ) |
Get a number of configuration sets.
- Returns:
- number of configuration sets.
Definition at line 239 of file ConfigFile.cpp.
| bool getKeyAndValue | ( | int | index, |
| char * | key, | ||
| size_t | keybufsiz, | ||
| char * | value, | ||
| size_t | valuebufsiz | ||
| ) |
Get a key and a value.
- Parameters:
-
index Index number of this list. key A pointer to a buffer for key. keybufsiz A size of the key buffer. value A pointer to a buffer for value. valuebufsiz A size of the value buffer.
- Returns:
- true if it succeed.
Definition at line 261 of file ConfigFile.cpp.
| bool getValue | ( | char * | key, |
| char * | value, | ||
| size_t | siz | ||
| ) |
Get a value for a key.
- Parameters:
-
key A target key name. value A pointer to a value storage. siz A size of a value storage.
- Returns:
- A value or NULL.
Definition at line 58 of file ConfigFile.cpp.
| bool read | ( | char * | file ) |
Read from the target file.
- Parameters:
-
file A target file name.
Definition at line 285 of file ConfigFile.cpp.
| bool remove | ( | char * | key ) |
Remove a config.
- Parameters:
-
key A key.
- Returns:
- True if it succeed.
Definition at line 197 of file ConfigFile.cpp.
| bool removeAll | ( | void | ) |
| bool setValue | ( | char * | key, |
| char * | value | ||
| ) |
Set a set of a key and value.
- Parameters:
-
key A key. value A value.
- Returns:
- True if it succeed.
Definition at line 96 of file ConfigFile.cpp.
| bool write | ( | char * | file, |
| char * | header = NULL, |
||
| FileFormat | ff = UNIX |
||
| ) |
Write from the target file.
- Parameters:
-
file A pointer to a file name. header A pointer to a header. ff File format.
Definition at line 345 of file ConfigFile.cpp.
Generated on Fri Jul 15 2022 05:42:23 by
1.7.2