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

Unified Diff: base/data_pack.h

Issue 5992006: Move data pack from base to app (it's just part of the resource bundle system... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/data/data_pack_unittest/sample.pak ('k') | base/data_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/data_pack.h
===================================================================
--- base/data_pack.h (revision 69977)
+++ base/data_pack.h (working copy)
@@ -1,62 +0,0 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// DataPack represents a read-only view onto an on-disk file that contains
-// (key, value) pairs of data. It's used to store static resources like
-// translation strings and images.
-
-#ifndef BASE_DATA_PACK_H_
-#define BASE_DATA_PACK_H_
-#pragma once
-
-#include <map>
-
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-
-namespace file_util {
- class MemoryMappedFile;
-}
-class FilePath;
-class RefCountedStaticMemory;
-
-namespace base {
-
-class StringPiece;
-
-class DataPack {
- public:
- DataPack();
- ~DataPack();
-
- // Load a pack file from |path|, returning false on error.
- bool Load(const FilePath& path);
-
- // Get resource by id |resource_id|, filling in |data|.
- // The data is owned by the DataPack object and should not be modified.
- // Returns false if the resource id isn't found.
- bool GetStringPiece(uint32 resource_id, StringPiece* data) const;
-
- // Like GetStringPiece(), but returns a reference to memory. This interface
- // is used for image data, while the StringPiece interface is usually used
- // for localization strings.
- RefCountedStaticMemory* GetStaticMemory(uint32 resource_id) const;
-
- // Writes a pack file containing |resources| to |path|.
- static bool WritePack(const FilePath& path,
- const std::map<uint32, StringPiece>& resources);
-
- private:
- // The memory-mapped data.
- scoped_ptr<file_util::MemoryMappedFile> mmap_;
-
- // Number of resources in the data.
- size_t resource_count_;
-
- DISALLOW_COPY_AND_ASSIGN(DataPack);
-};
-
-} // namespace base
-
-#endif // BASE_DATA_PACK_H_
« no previous file with comments | « base/data/data_pack_unittest/sample.pak ('k') | base/data_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698