diff --git a/zh-cn/device-dev/subsystems/subsys-data-storage-guide.md b/zh-cn/device-dev/subsystems/subsys-data-storage-guide.md index 7a52784b11c5d2fba57e81909ac84010de360950..1d66e157396b0eeab9885c9c42abc68d77f56489 100755 --- a/zh-cn/device-dev/subsystems/subsys-data-storage-guide.md +++ b/zh-cn/device-dev/subsystems/subsys-data-storage-guide.md @@ -42,17 +42,17 @@ | 类名 | 方法名 | 描述 | | --- | ----- | ----| -| Preferences | bool GetInt(const std::string &key, bool defValue); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | +| Preferences | int GetInt(const std::string &key, int defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | | Preferences | std::string GetString(const std::string &key, const std::string &defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | -| Preferences | bool GetBool(const std::string &key, const bool &defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | -| Preferences | float GetFloat(const std::string &key, const float &defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | -| Preferences | double GetDouble(const std::string &key, const double &defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | -| Preferences | int64_t GetLong(const std::string &key, const int64_t &defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | +| Preferences | bool GetBool(const std::string &key, bool defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | +| Preferences | float GetFloat(const std::string &key, float defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | +| Preferences | double GetDouble(const std::string &key, double defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | +| Preferences | int64_t GetLong(const std::string &key, int64_t defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | | Preferences | std::set\ GetStringSet(const std::string &key, const std::set\ &defValue = {}); | key:要获取的存储key名称,不能为空。
defValue:若获取失败或value不存在返回此默认值。
返回值:value。 | **数据持久化** -通过执行flush或者flushSync方法,应用可以将缓存的数据再次写回文本文件中进行持久化存储。 +通过执行Flush()或者FlushSync()方法,应用可以将缓存的数据再次写回文本文件中进行持久化存储。 **表 5** 轻量级数据数据持久化接口