Chromium Code Reviews| Index: ui/base/resource/data_pack.h |
| diff --git a/ui/base/resource/data_pack.h b/ui/base/resource/data_pack.h |
| index f6ee78d452a7bd6c6e1604d4e2c100f9bde81f6e..374a81d1abf9f28f091d2b665ab88e86b4ebef27 100644 |
| --- a/ui/base/resource/data_pack.h |
| +++ b/ui/base/resource/data_pack.h |
| @@ -31,6 +31,13 @@ namespace ui { |
| class UI_EXPORT DataPack { |
| public: |
| + // What type of encoding the text resources use. |
| + enum TextEncodingType { |
| + BINARY, |
| + UTF8, |
| + UTF16 |
| + }; |
| + |
| DataPack(); |
| ~DataPack(); |
| @@ -47,9 +54,16 @@ class UI_EXPORT DataPack { |
| // for localization strings. |
| RefCountedStaticMemory* GetStaticMemory(uint16 resource_id) const; |
| - // Writes a pack file containing |resources| to |path|. |
| + // Writes a pack file containing |resources| to |path|. If there are any |
| + // text resources to be written, their encoding must already agree to the |
| + // |textEncodingType| specified. If no text resources are present, please |
| + // indicate BINARY. |
| static bool WritePack(const FilePath& path, |
| - const std::map<uint16, base::StringPiece>& resources); |
| + const std::map<uint16, base::StringPiece>& resources, |
| + const uint32 textEncodingType); |
|
tony
2011/08/29 21:24:39
nit: TextEncodingType instead of uint32. Also, no
marcvs
2011/08/30 07:58:55
Done.
|
| + |
| + // Get the encoding type of text resources. |
| + uint32 GetTextEncodingType() const { return text_encoding_type_; } |
|
tony
2011/08/29 21:24:39
TextEncodingType as the return type.
marcvs
2011/08/30 07:58:55
Done.
|
| private: |
| // The memory-mapped data. |
| @@ -58,6 +72,9 @@ class UI_EXPORT DataPack { |
| // Number of resources in the data. |
| size_t resource_count_; |
| + // Type of encoding for text resources. |
| + uint32 text_encoding_type_; |
|
tony
2011/08/29 21:24:39
TextEncodingType as the type.
marcvs
2011/08/30 07:58:55
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(DataPack); |
| }; |