Some exercise of keydata routines.
Some exercise of keydata routines.
#ifndef DEBUG
#define DEBUG
#endif
#include <stdio.h>
extern "C" int main()
{
keydata *keys;
keyfile myfile("keydata.conf");
keys = myfile.get();
assert(
eq_case(keys->get(
"key2"),
"value2"));
keys = myfile["section1"];
assert(keys != NULL);
assert(
eq_case(keys->get(
"key1"),
"this is value 1 quoted"));
keys = myfile["section2"];
assert(keys != NULL);
assert(
eq_case(keys->get(
"key1"),
"replaced value"));
return 0;
}
Top level include file for the GNU uCommon C++ core library.
Common namespace for all ucommon objects.
bool eq_case(char const *s1, char const *s2)
Compare two null terminated strings if equal ignoring case.