123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- NS_CC_BEGIN
- class CC_DLL UserDefault
- {
- public:
-
-
- bool getBoolForKey(const char* key);
-
-
- virtual bool getBoolForKey(const char* key, bool defaultValue);
-
-
- int getIntegerForKey(const char* key);
-
-
- virtual int getIntegerForKey(const char* key, int defaultValue);
-
-
- float getFloatForKey(const char* key);
-
-
- virtual float getFloatForKey(const char* key, float defaultValue);
-
-
- double getDoubleForKey(const char* key);
-
-
- virtual double getDoubleForKey(const char* key, double defaultValue);
-
-
- std::string getStringForKey(const char* key);
-
-
- virtual std::string getStringForKey(const char* key, const std::string & defaultValue);
-
-
- Data getDataForKey(const char* key);
-
-
- virtual Data getDataForKey(const char* key, const Data& defaultValue);
-
-
- virtual void setBoolForKey(const char* key, bool value);
-
- virtual void setIntegerForKey(const char* key, int value);
-
- virtual void setFloatForKey(const char* key, float value);
-
- virtual void setDoubleForKey(const char* key, double value);
-
- virtual void setStringForKey(const char* key, const std::string & value);
-
- virtual void setDataForKey(const char* key, const Data& value);
-
- virtual void flush();
-
- virtual void deleteValueForKey(const char* key);
-
-
- static UserDefault* getInstance();
-
- static void destroyInstance();
-
- static void setDelegate(UserDefault *delegate);
-
- CC_DEPRECATED_ATTRIBUTE static UserDefault* sharedUserDefault();
-
- CC_DEPRECATED_ATTRIBUTE static void purgeSharedUserDefault();
-
- static const std::string& getXMLFilePath();
-
- static bool isXMLFileExist();
- protected:
- UserDefault();
- virtual ~UserDefault();
-
- private:
-
- static bool createXMLFile();
- static void initXMLFilePath();
-
- static UserDefault* _userDefault;
- static std::string _filePath;
- static bool _isFilePathInitialized;
- };
- NS_CC_END
|