OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 BASE_DATA_PACK_H_ | 9 #ifndef BASE_DATA_PACK_H_ |
10 #define BASE_DATA_PACK_H_ | 10 #define BASE_DATA_PACK_H_ |
(...skipping 21 matching lines...) Expand all Loading... |
32 // The data is owned by the DataPack object and should not be modified. | 32 // The data is owned by the DataPack object and should not be modified. |
33 // Returns false if the resource id isn't found. | 33 // Returns false if the resource id isn't found. |
34 bool Get(uint32_t resource_id, StringPiece* data); | 34 bool Get(uint32_t resource_id, StringPiece* data); |
35 | 35 |
36 private: | 36 private: |
37 // The memory-mapped data. | 37 // The memory-mapped data. |
38 scoped_ptr<file_util::MemoryMappedFile> mmap_; | 38 scoped_ptr<file_util::MemoryMappedFile> mmap_; |
39 | 39 |
40 // Number of resources in the data. | 40 // Number of resources in the data. |
41 size_t resource_count_; | 41 size_t resource_count_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(DataPack); |
42 }; | 44 }; |
43 | 45 |
44 } // namespace base | 46 } // namespace base |
45 | 47 |
46 #endif // BASE_DATA_PACK_H_ | 48 #endif // BASE_DATA_PACK_H_ |
OLD | NEW |