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

Side by Side Diff: chrome/installer/util/lzma_util.h

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « chrome/installer/util/logging_installer.h ('k') | chrome/installer/util/master_preferences.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_INSTALLER_UTIL_LZMA_UTIL_H_ 5 #ifndef CHROME_INSTALLER_UTIL_LZMA_UTIL_H_
6 #define CHROME_INSTALLER_UTIL_LZMA_UTIL_H_ 6 #define CHROME_INSTALLER_UTIL_LZMA_UTIL_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 14
15 namespace base {
15 class FilePath; 16 class FilePath;
17 }
16 18
17 // This is a utility class that acts as a wrapper around LZMA SDK library 19 // This is a utility class that acts as a wrapper around LZMA SDK library
18 class LzmaUtil { 20 class LzmaUtil {
19 public: 21 public:
20 // Utility method that does the job of calling OpenArchive(), UnPack() 22 // Utility method that does the job of calling OpenArchive(), UnPack()
21 // and CloseArchive() in order. Returns error code (NO_ERROR if successful). 23 // and CloseArchive() in order. Returns error code (NO_ERROR if successful).
22 static int32 UnPackArchive(const std::wstring& archive, 24 static int32 UnPackArchive(const std::wstring& archive,
23 const std::wstring& output_dir, 25 const std::wstring& output_dir,
24 std::wstring* output_file); 26 std::wstring* output_file);
25 27
26 LzmaUtil(); 28 LzmaUtil();
27 ~LzmaUtil(); 29 ~LzmaUtil();
28 30
29 DWORD OpenArchive(const std::wstring& archivePath); 31 DWORD OpenArchive(const std::wstring& archivePath);
30 32
31 // Unpacks the archive to the given location 33 // Unpacks the archive to the given location
32 DWORD UnPack(const std::wstring& location); 34 DWORD UnPack(const std::wstring& location);
33 35
34 // Unpacks the archive to the given location and returns the last file 36 // Unpacks the archive to the given location and returns the last file
35 // extracted from archive. |single_file| is set to true iff only a single 37 // extracted from archive. |single_file| is set to true iff only a single
36 // file is extracted from archive. 38 // file is extracted from archive.
37 DWORD UnPack(const std::wstring& location, 39 DWORD UnPack(const std::wstring& location,
38 std::wstring* output_file); 40 std::wstring* output_file);
39 41
40 void CloseArchive(); 42 void CloseArchive();
41 43
42 protected: 44 protected:
43 bool CreateDirectory(const FilePath& dir); 45 bool CreateDirectory(const base::FilePath& dir);
44 46
45 private: 47 private:
46 HANDLE archive_handle_; 48 HANDLE archive_handle_;
47 std::set<std::wstring> directories_created_; 49 std::set<std::wstring> directories_created_;
48 50
49 DISALLOW_COPY_AND_ASSIGN(LzmaUtil); 51 DISALLOW_COPY_AND_ASSIGN(LzmaUtil);
50 }; 52 };
51 53
52 #endif // CHROME_INSTALLER_UTIL_LZMA_UTIL_H_ 54 #endif // CHROME_INSTALLER_UTIL_LZMA_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/logging_installer.h ('k') | chrome/installer/util/master_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698