X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FSettings.hh;h=2a2a9267026e5475ddd5c0a1d11433da19767251;hb=246d7d6e4386b686327163d621c7c8b398b7d479;hp=42e7d3a7a5f26e159237a3b37682efb2a4a9f015;hpb=a31d65a998121df0651c57bfb68782e2a07d2e2f;p=chaz%2Fyoink diff --git a/src/Moof/Settings.hh b/src/Moof/Settings.hh index 42e7d3a..2a2a926 100644 --- a/src/Moof/Settings.hh +++ b/src/Moof/Settings.hh @@ -54,9 +54,12 @@ public: mGlobals(mScript.getGlobalTable()), mTop(mScript[-1]) { - importLogScript(mScript); + mScript.importBaseLibrary(); + importLogPrintFunction(mScript); } + ~Settings(); + // get global instance static Settings& getInstance(); @@ -65,13 +68,20 @@ public: void loadFromFile(const std::string& filePath); void loadFromFiles(const std::vector& filePaths); + void clear(); // remove all settings + + void saveAs(const std::string& filePath); + void save() const; + template bool get(const std::string& key, T& value); private: Script mScript; - Script::Value mGlobals, mTop; + Script::Slot mGlobals, mTop; + + std::string mUserFile; };