Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: ui/base/resource/data_pack.h

Issue 7328011: Introduce ui.dll / libui.so for the component build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 18
18 class FilePath; 19 class FilePath;
19 class RefCountedStaticMemory; 20 class RefCountedStaticMemory;
20 21
21 namespace base { 22 namespace base {
22 class StringPiece; 23 class StringPiece;
23 } 24 }
24 25
25 namespace file_util { 26 namespace file_util {
26 class MemoryMappedFile; 27 class MemoryMappedFile;
27 } 28 }
28 29
29 namespace ui { 30 namespace ui {
30 31
31 class DataPack { 32 class UI_API DataPack {
32 public: 33 public:
33 DataPack(); 34 DataPack();
34 ~DataPack(); 35 ~DataPack();
35 36
36 // Load a pack file from |path|, returning false on error. 37 // Load a pack file from |path|, returning false on error.
37 bool Load(const FilePath& path); 38 bool Load(const FilePath& path);
38 39
39 // Get resource by id |resource_id|, filling in |data|. 40 // Get resource by id |resource_id|, filling in |data|.
40 // 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.
41 // 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
56 57
57 // Number of resources in the data. 58 // Number of resources in the data.
58 size_t resource_count_; 59 size_t resource_count_;
59 60
60 DISALLOW_COPY_AND_ASSIGN(DataPack); 61 DISALLOW_COPY_AND_ASSIGN(DataPack);
61 }; 62 };
62 63
63 } // namespace ui 64 } // namespace ui
64 65
65 #endif // UI_BASE_RESOURCE_DATA_PACK_H_ 66 #endif // UI_BASE_RESOURCE_DATA_PACK_H_
OLDNEW
« no previous file with comments | « ui/base/range/range.h ('k') | ui/base/resource/resource_bundle.h » ('j') | ui/ui.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698