MeshLib C++ Docs
Loading...
Searching...
No Matches

#include <MRMesh/MRConfig.h>

Public Types

typedef std::vector< const char * > Enum
 Description of a enumeration as a map between [0...N) and N strings.

Public Member Functions

 Config (Config const &)=delete
void operator= (Config const &)=delete
void reset (std::string appName)
const std::string & getAppName () const
 the name of the application, UTF8 encoded
void writeToFile ()
 writes current config to file. (implicitly called from destructor)
bool hasBool (const std::string &key) const
 returns true if MRColor with presented key exists
bool getBool (const std::string &key, bool defaultValue=false) const
 returns MRColor with presented key
void setBool (const std::string &key, bool keyValue)
 sets MRColor for presented key
bool hasColor (const std::string &key) const
 returns true if MRColor with presented key exists
Color getColor (const std::string &key, const Color &defaultValue=Color::black()) const
 returns MRColor with presented key
void setColor (const std::string &key, const Color &keyValue)
 sets MRColor for presented key
bool hasFileStack (const std::string &key) const
 returns true if 'recently used' files exist
FileNamesStack getFileStack (const std::string &key, const FileNamesStack &defaultValue=FileNamesStack()) const
 returns 'recently used' files list
void setFileStack (const std::string &key, const FileNamesStack &keyValue)
 sets 'recently used' files list
bool hasVector2i (const std::string &key) const
 returns true if Vector2i with presented key exists
Vector2i getVector2i (const std::string &key, const Vector2i &defaultValue=Vector2i()) const
 returns Vector2i with presented key
void setVector2i (const std::string &key, const Vector2i &keyValue)
 sets Vector2i for presented key
bool hasEnum (const Enum &enumeration, const std::string &key) const
 returns true if given enumeration value with this key exists and is correct
int getEnum (const Enum &enumeration, const std::string &key, int defaultValue=0) const
 returns custom enumeration value
void setEnum (const Enum &enumeration, const std::string &key, int keyValue)
 sets custom enumeration value
bool hasViewportMask (const std::string &key) const
ViewportMask getViewportMask (const std::string &key, ViewportMask defaultValue={}) const
void setViewportMask (const std::string &key, ViewportMask newValue)
bool hasJsonValue (const std::string &key)
 returns true if json value with this key exists
Json::Value getJsonValue (const std::string &key, const Json::Value &defaultValue={})
 returns custom json value
void setJsonValue (const std::string &key, const Json::Value &keyValue)
 sets custom json value
Json::Value toJson () const
 returns json with content of this config
void fromJson (const Json::Value &config)
 replace current config content with given one

Static Public Member Functions

static Configinstance ()

The documentation for this class was generated from the following file: