Chromium Code Reviews| Index: chrome/installer/test/resource_loader.h |
| =================================================================== |
| --- chrome/installer/test/resource_loader.h (revision 0) |
| +++ chrome/installer/test/resource_loader.h (revision 0) |
| @@ -0,0 +1,49 @@ |
| +// Copyright (c) 2010 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. |
| + |
| +// A helper class for loading resources out of portable executable files. |
| + |
| +#ifndef CHROME_INSTALLER_TEST_RESOURCE_LOADER_H__ |
|
tommi (sloooow) - chröme
2010/11/19 20:14:38
_
grt (UTC plus 2)
2010/11/22 17:53:29
Done.
|
| +#define CHROME_INSTALLER_TEST_RESOURCE_LOADER_H__ |
| +#pragma once |
| + |
| +#include <windows.h> |
| + |
| +#include <string> |
| +#include <utility> |
| + |
| +#include "base/basictypes.h" |
| + |
| +class FilePath; |
| + |
| +namespace upgrade_test { |
| + |
| +// Loads resources in a PE image file. |
| +class ResourceLoader { |
| + public: |
| + ResourceLoader(); |
| + ~ResourceLoader(); |
| + |
| + // Loads |pe_image_path| in preparation for loading its resources. |
| + bool Initialize(const FilePath& pe_image_path); |
| + |
| + // Places the address and size of the resource |name| of |type| into |
| + // |resource_data|, returning true on success. The address of the resource is |
| + // valid only until this instance is destroyed. |
| + bool Load(const std::wstring& name, const std::wstring& type, |
| + std::pair<const uint8*, DWORD>* resource_data); |
| + |
| + // Places the address and size of the resource |id| of |type| into |
| + // |resource_data|, returning true on success. The address of the resource is |
| + // valid only until this instance is destroyed. |
| + bool Load(WORD id, WORD type, std::pair<const uint8*, DWORD>* resource_data); |
| + |
| + private: |
| + HMODULE module_; |
| + DISALLOW_COPY_AND_ASSIGN(ResourceLoader); |
| +}; // class ResourceLoader |
| + |
| +} // namespace upgrade_test |
| + |
| +#endif // CHROME_INSTALLER_TEST_RESOURCE_LOADER_H__ |
| Property changes on: chrome\installer\test\resource_loader.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |