xdgjson  0.1.0
xdgjson.hpp
1 /* Public Domain / CC-0
2  * Author: tastytea <tastytea@tastytea.de>
3  */
4 
5 #ifndef XDGJSON_HPP
6 #define XDGJSON_HPP
7 
8 #include <string>
9 #include <jsoncpp/json/json.h>
10 
11 using std::string;
12 
13 class xdgjson
14 {
15 public:
27  explicit xdgjson(const string &filename, const string &subdir = "");
28 
34  const bool read();
35 
41  const bool write();
42 
51  Json::Value &get_json();
52 
56  const string get_filepath() const;
57 
58 private:
62  Json::Value _json;
63 
67  string _filepath;
68 };
69 
74 #endif // XDGJSON_HPP
const bool read()
Read the file.
Definition: xdgjson.cpp:40
xdgjson(const string &filename, const string &subdir="")
Checks if subdir is present, creates it if necessary.
Definition: xdgjson.cpp:21
const bool write()
Write the file.
Definition: xdgjson.cpp:58
Json::Value & get_json()
Returns a reference to the config as Json::Value.
Definition: xdgjson.cpp:75
const string get_filepath() const
Returns the complete filepath.
Definition: xdgjson.cpp:80
Definition: xdgjson.hpp:13