Advertisement

JavaScript engine 在 Cocos2D-x 中的源码解析:localStorage 的详细解析

阅读量:

localStorage模块源码分析

localStorage 的接口

cocos2d-x具备基础的本地数据存储功能,该功能主要通过封装sqlite数据库来实现。

复制代码
    //初始化 数据库
    void CC_DLL localStorageInit( const std::string& fullpath = "");
    //释放数据库
    void CC_DLL localStorageFree();
    //存一个key-value
    void CC_DLL localStorageSetItem( const std::string& key, const std::string& value);
    //根据key获取value
    std::string CC_DLL localStorageGetItem( const std::string& key );
    //删除 key对应的 项
    void CC_DLL localStorageRemoveItem( const std::string& key );
    
    
      
      
      
      
      
      
      
      
      
      

全部评论 (0)

还没有任何评论哟~