Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 2 months ago.
Check if key is found in IniFileLib
Dear experts
I am using the IniFileLib (https://os.mbed.com/users/rinosh2/code/IniFileLib/) library to read my .ini file.
How do I know if a key is found or not in an if statement?
Kind regards
1 Answer
6 years, 2 months ago.
Hi Jordy,
You can use this API IniFile::Status IniFile::get(const char* key, char* ret, int ret_size() to get the key, and check the error code returned.
// error code
typedef enum {
S_SUCCESS,
S_OPEN_ERROR,
S_NOT_OPENED,
S_NO_KEY,
S_BUFFER_TOO_SHORT,
S_FORMAT_ERROR,
} Status;
Regards, Desmond