Revision: 4485 http://pd-gem.svn.sourceforge.net/pd-gem/?rev=4485&view=rev Author: zmoelnig Date: 2011-08-22 10:29:35 +0000 (Mon, 22 Aug 2011)
Log Message: ----------- clean up of GemSettings no more PIMPL since we don't expose the class itself Modified Paths: -------------- trunk/Gem/src/Gem/Settings.cpp trunk/Gem/src/Gem/Settings.h Modified: trunk/Gem/src/Gem/Settings.cpp =================================================================== --- trunk/Gem/src/Gem/Settings.cpp 2011-08-22 10:28:43 UTC (rev 4484) +++ trunk/Gem/src/Gem/Settings.cpp 2011-08-22 10:29:35 UTC (rev 4485) @@ -55,10 +55,8 @@ # define t_gemclass struct _gemclass - - -class GemSettings::PIMPL { -public: +namespace { +struct PIMPL { // dictionary for setting values std::map <std::string, t_atom> data; @@ -239,13 +237,13 @@ // we ignore lists and other complex things for now } }; +static PIMPL*settings=NULL; +}; - /* GemSettings: the public API */ -GemSettings::PIMPL*GemSettings::settings=NULL; /* public static functions */ void GemSettings::init() { @@ -291,3 +289,16 @@ value=atom_getsymbol(a)->s_name; } } + + +std::vector<std::string>GemSettings::keys(void) { + std::vector<std::string>result; + if(NULL==settings) init(); + if(NULL!=settings) { + std::map<std::string, t_atom>::iterator it=settings->data.begin(); + while(settings->data.end() != it) { + result.push_back(it->first); + } + } + return result; +} Modified: trunk/Gem/src/Gem/Settings.h =================================================================== --- trunk/Gem/src/Gem/Settings.h 2011-08-22 10:28:43 UTC (rev 4484) +++ trunk/Gem/src/Gem/Settings.h 2011-08-22 10:29:35 UTC (rev 4485) @@ -14,6 +14,7 @@ #define _INCLUDE__GEM_GEM_SETTINGS_H_ #include <string> +#include <vector> typedef struct _atom t_atom; class GemSettings { @@ -29,8 +30,6 @@ static void get(const std::string key, float&value); static void get(const std::string key, std::string&value); - private: - class PIMPL; - static PIMPL*settings; + static std::vector<std::string> keys(); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ pd-gem-CVS mailing list pd-gem-CVS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pd-gem-cvs