| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /*
- * PolyConfig.h
- * Poly
- *
- * Created by Ivan Safrin on 4/15/09.
- * Copyright 2009 __MyCompanyName__. All rights reserved.
- *
- */
- // @package Services
- #pragma once
- #include "PolyString.h"
- #include "PolyGlobals.h"
- #include <string>
- #include <vector>
- #include "tinyxml.h"
- #include "PolyUtil.h"
- using std::string;
- using std::vector;
- namespace Polycode {
- class ConfigEntry {
- public:
- String key;
- String configNamespace;
- Number numVal;
- String stringVal;
- bool isString;
- };
-
- class _PolyExport Config {
- public:
- Config();
- ~Config();
- void loadConfig(String configNamespace, String fileName);
- void saveConfig(String configNamespace, String fileName);
-
- ConfigEntry *getEntry(String configNamespace, String key);
-
- void setStringValue(String configNamespace, String key, String value);
- void setNumericValue(String configNamespace, String key, Number value);
-
- Number getNumericValue(String configNamespace, String key);
- String getStringValue(String configNamespace, String key);
-
- private:
-
- vector<ConfigEntry*> entries;
-
- };
- }
|