// // Platform.h // // Created by 杜家兑macbook on 16/9/18. // #ifndef RUPlatform_h #define RUPlatform_h #include #include "cocos2d.h" #include "RUDefine.h" NS_RU_BEGIN class Platform { public: static Platform* getInstance(); /* * 服务器上传日志(bugly) */ void reportLog(string log); /* * 振动 */ void vibrate(int duration, int strength); bool saveToSharedPreferences(const std::string& key, const std::string& base64Data); std::string readFromSharedPreferences(const std::string& key); /// 获取系统启动之后多长时间(单位:秒) double getSystemUpTime(); /// 获取服务器时间(单位:unix时间 秒) int getServerTime(); /// 显示调试对话框 void showDbgView(); private: Platform() = default; ~Platform() = default; }; NS_RU_END #endif /* defined(RUPlatform_h) */