diff options
Diffstat (limited to 'tools/stringhelpers.h')
-rw-r--r-- | tools/stringhelpers.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/stringhelpers.h b/tools/stringhelpers.h new file mode 100644 index 0000000..b4006f3 --- /dev/null +++ b/tools/stringhelpers.h @@ -0,0 +1,31 @@ + +#ifndef _STRINGHELPERS_H_ +#define _STRINGHELPERS_H_ + +#include <string> +using namespace std; + +string str_replace(const string& search, const string& replace, const string& subject); +string str_cut(const string& search, const string& subject); + +#include <jansson.h> + +class cJsonLoader +{ + public: + + cJsonLoader(const char* name); + ~cJsonLoader(); + + json_t* object() { return obj; } + json_error_t* error() { return err; } + json_t* objectByName(const char* name); + int isObject(); + + protected: + + json_error_t* err; + json_t* obj; +}; + +#endif // _STRINGHELPERS_H_ |