Index: base/json/json_file_value_serializer.h |
diff --git a/base/json/json_file_value_serializer.h b/base/json/json_file_value_serializer.h |
index 6cfcbe83c2f8295fcd5f277bf637b6afda809e2a..195134c57bed64be20fca29a59813d0748ce2562 100644 |
--- a/base/json/json_file_value_serializer.h |
+++ b/base/json/json_file_value_serializer.h |
@@ -36,6 +36,24 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer { |
// output. |
bool SerializeAndOmitBinaryValues(const base::Value& root); |
+ private: |
+ bool SerializeInternal(const base::Value& root, bool omit_binary_values); |
+ |
+ const base::FilePath json_file_path_; |
+ |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSONFileValueSerializer); |
+}; |
+ |
+class BASE_EXPORT JSONFileValueDeserializer : public base::ValueDeserializer { |
+ public: |
+ // |json_file_path_| is the path of a file that will be source of the |
+ // deserialization or the destination of the serialization. |
+ // When deserializing, the file should exist, but when serializing, the |
+ // serializer will attempt to create the file at the specified location. |
+ explicit JSONFileValueDeserializer(const base::FilePath& json_file_path); |
+ |
+ ~JSONFileValueDeserializer() override; |
+ |
// Attempt to deserialize the data structure encoded in the file passed |
// in to the constructor into a structure of Value objects. If the return |
// value is NULL, and if |error_code| is non-null, |error_code| will |
@@ -74,17 +92,15 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer { |
size_t get_last_read_size() const { return last_read_size_; } |
private: |
- bool SerializeInternal(const base::Value& root, bool omit_binary_values); |
+ // A wrapper for ReadFileToString which returns a non-zero JsonFileError if |
+ // there were file errors. |
+ int ReadFileToString(std::string* json_string); |
const base::FilePath json_file_path_; |
bool allow_trailing_comma_; |
size_t last_read_size_; |
- // A wrapper for ReadFileToString which returns a non-zero JsonFileError if |
- // there were file errors. |
- int ReadFileToString(std::string* json_string); |
- |
- DISALLOW_IMPLICIT_CONSTRUCTORS(JSONFileValueSerializer); |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSONFileValueDeserializer); |
}; |
#endif // BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_ |