PSMoveSteamVRBridge
config.h
1 #pragma once
2 
3 //-- includes -----
4 #include <string>
5 
6 #ifdef _MSC_VER
7  #pragma warning (push)
8  #pragma warning (disable: 4996) // This function or variable may be unsafe
9  #pragma warning (disable: 4244) // 'return': conversion from 'const int64_t' to 'float', possible loss of data
10  #pragma warning (disable: 4715) // configuru::Config::operator[]': not all control paths return a value
11 #endif
12 #include <configuru.hpp>
13 #ifdef _MSC_VER
14  #pragma warning (pop)
15 #endif
16 
17 namespace steamvrbridge {
18 
19  //-- definitions -----
20  /*
21  Note that Config is an abstract class because it has 2 pure virtual functions.
22  Child classes must add public member variables that store the config data,
23  as well as implement writeToJSON and readFromJSON that use pt[key]= value and
24  pt.get_or<type>(), respectively, to convert between member variables and the
25  property tree. See tests/test_config.cpp for an example.
26  */
27  class Config {
28  public:
29  Config(const std::string &fnamebase = std::string("Config"));
30  void save();
31  void save(const std::string &path);
32  bool load();
33  bool load(const std::string &path);
34 
35  std::string ConfigFileBase;
36 
37  virtual configuru::Config WriteToJSON() = 0; // Implement by each device class' own Config
38  virtual bool ReadFromJSON(const configuru::Config &pt) = 0; // Implement by each device class' own Config
39 
40  private:
41  const std::string getConfigPath();
42  };
43 }
Provides printf-style line logging via the vr::IVRDriverLog interface provided by SteamVR during init...
Definition: config.cpp:18
Definition: config.h:27