| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // DataPack represents a read-only view onto an on-disk file that contains | 5 // DataPack represents a read-only view onto an on-disk file that contains |
| 6 // (key, value) pairs of data. It's used to store static resources like | 6 // (key, value) pairs of data. It's used to store static resources like |
| 7 // translation strings and images. | 7 // translation strings and images. |
| 8 | 8 |
| 9 #ifndef UI_BASE_RESOURCE_DATA_PACK_H_ | 9 #ifndef UI_BASE_RESOURCE_DATA_PACK_H_ |
| 10 #define UI_BASE_RESOURCE_DATA_PACK_H_ | 10 #define UI_BASE_RESOURCE_DATA_PACK_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <map> | 13 #include <map> |
| 14 | 14 |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "ui/ui_api.h" | 17 #include "ui/base/ui_export.h" |
| 18 | 18 |
| 19 class FilePath; | 19 class FilePath; |
| 20 class RefCountedStaticMemory; | 20 class RefCountedStaticMemory; |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class StringPiece; | 23 class StringPiece; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace file_util { | 26 namespace file_util { |
| 27 class MemoryMappedFile; | 27 class MemoryMappedFile; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace ui { | 30 namespace ui { |
| 31 | 31 |
| 32 class UI_API DataPack { | 32 class UI_EXPORT DataPack { |
| 33 public: | 33 public: |
| 34 DataPack(); | 34 DataPack(); |
| 35 ~DataPack(); | 35 ~DataPack(); |
| 36 | 36 |
| 37 // Load a pack file from |path|, returning false on error. | 37 // Load a pack file from |path|, returning false on error. |
| 38 bool Load(const FilePath& path); | 38 bool Load(const FilePath& path); |
| 39 | 39 |
| 40 // Get resource by id |resource_id|, filling in |data|. | 40 // Get resource by id |resource_id|, filling in |data|. |
| 41 // The data is owned by the DataPack object and should not be modified. | 41 // The data is owned by the DataPack object and should not be modified. |
| 42 // Returns false if the resource id isn't found. | 42 // Returns false if the resource id isn't found. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 57 | 57 |
| 58 // Number of resources in the data. | 58 // Number of resources in the data. |
| 59 size_t resource_count_; | 59 size_t resource_count_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(DataPack); | 61 DISALLOW_COPY_AND_ASSIGN(DataPack); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace ui | 64 } // namespace ui |
| 65 | 65 |
| 66 #endif // UI_BASE_RESOURCE_DATA_PACK_H_ | 66 #endif // UI_BASE_RESOURCE_DATA_PACK_H_ |
| OLD | NEW |