Index: base/values.h |
diff --git a/base/values.h b/base/values.h |
index d69a68542751fda334ebc76c260ee53f658abe6a..2cd26f1eec19dfbe1d19f5b3daecdbec886912d8 100644 |
--- a/base/values.h |
+++ b/base/values.h |
@@ -28,6 +28,7 @@ |
#include <vector> |
#include "base/basictypes.h" |
+#include "base/file_path.h" |
#include "base/string16.h" |
#include "build/build_config.h" |
@@ -54,7 +55,8 @@ class Value { |
TYPE_STRING, |
TYPE_BINARY, |
TYPE_DICTIONARY, |
- TYPE_LIST |
+ TYPE_LIST, |
+ TYPE_PATH, |
}; |
virtual ~Value(); |
@@ -92,6 +94,7 @@ class Value { |
virtual bool GetAsReal(double* out_value) const; |
virtual bool GetAsString(std::string* out_value) const; |
virtual bool GetAsString(string16* out_value) const; |
+ virtual bool GetAsFilePath(FilePath* out_value) const; |
virtual bool GetAsList(ListValue** out_value); |
// This creates a deep copy of the entire Value tree, and returns a pointer |
@@ -165,6 +168,21 @@ class StringValue : public Value { |
DISALLOW_COPY_AND_ASSIGN(StringValue); |
}; |
+class FilePathValue : public Value { |
+ public: |
+ explicit FilePathValue(const FilePath& in_value); |
+ virtual ~FilePathValue(); |
+ |
+ // Overridden from Value: |
+ virtual bool GetAsFilePath(FilePath* out_value) const; |
+ virtual bool Equals(const Value* other) const; |
+ |
+ private: |
+ FilePath value_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FilePathValue); |
+}; |
+ |
class BinaryValue: public Value { |
public: |
virtual ~BinaryValue(); |
@@ -264,6 +282,7 @@ class DictionaryValue : public Value { |
bool GetDictionary(const std::string& path, |
DictionaryValue** out_value) const; |
bool GetList(const std::string& path, ListValue** out_value) const; |
+ bool GetFilePath(const std::string& path, FilePath* out_value) const; |
// Like Get(), but without special treatment of '.'. This allows e.g. URLs to |
// be used as paths. |
@@ -380,6 +399,7 @@ class ListValue : public Value { |
bool GetBinary(size_t index, BinaryValue** out_value) const; |
bool GetDictionary(size_t index, DictionaryValue** out_value) const; |
bool GetList(size_t index, ListValue** out_value) const; |
+ bool GetFilePath(size_t index, FilePath* out_value) const; |
// Removes the Value with the specified index from this list. |
// If |out_value| is non-NULL, the removed Value AND ITS OWNERSHIP will be |