OLD | NEW |
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 #ifndef BASE_FILE_VERSION_INFO_H__ | 5 #ifndef BASE_FILE_VERSION_INFO_H__ |
6 #define BASE_FILE_VERSION_INFO_H__ | 6 #define BASE_FILE_VERSION_INFO_H__ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx | 12 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx |
13 extern "C" IMAGE_DOS_HEADER __ImageBase; | 13 extern "C" IMAGE_DOS_HEADER __ImageBase; |
14 #endif // OS_WIN | 14 #endif // OS_WIN |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "base/base_export.h" | 18 #include "base/base_export.h" |
19 #include "base/string16.h" | 19 #include "base/string16.h" |
20 | 20 |
| 21 namespace base { |
21 class FilePath; | 22 class FilePath; |
| 23 } |
22 | 24 |
23 // Provides an interface for accessing the version information for a file. This | 25 // Provides an interface for accessing the version information for a file. This |
24 // is the information you access when you select a file in the Windows Explorer, | 26 // is the information you access when you select a file in the Windows Explorer, |
25 // right-click select Properties, then click the Version tab, and on the Mac | 27 // right-click select Properties, then click the Version tab, and on the Mac |
26 // when you select a file in the Finder and do a Get Info. | 28 // when you select a file in the Finder and do a Get Info. |
27 // | 29 // |
28 // This list of properties is straight out of Win32's VerQueryValue | 30 // This list of properties is straight out of Win32's VerQueryValue |
29 // <http://msdn.microsoft.com/en-us/library/ms647464.aspx> and the Mac | 31 // <http://msdn.microsoft.com/en-us/library/ms647464.aspx> and the Mac |
30 // version returns values from the Info.plist as appropriate. TODO(avi): make | 32 // version returns values from the Info.plist as appropriate. TODO(avi): make |
31 // this a less-obvious Windows-ism. | 33 // this a less-obvious Windows-ism. |
32 | 34 |
33 class FileVersionInfo { | 35 class FileVersionInfo { |
34 public: | 36 public: |
35 virtual ~FileVersionInfo() {} | 37 virtual ~FileVersionInfo() {} |
36 #if defined(OS_WIN) || defined(OS_MACOSX) | 38 #if defined(OS_WIN) || defined(OS_MACOSX) |
37 // Creates a FileVersionInfo for the specified path. Returns NULL if something | 39 // Creates a FileVersionInfo for the specified path. Returns NULL if something |
38 // goes wrong (typically the file does not exit or cannot be opened). The | 40 // goes wrong (typically the file does not exit or cannot be opened). The |
39 // returned object should be deleted when you are done with it. | 41 // returned object should be deleted when you are done with it. |
40 BASE_EXPORT static FileVersionInfo* CreateFileVersionInfo( | 42 BASE_EXPORT static FileVersionInfo* CreateFileVersionInfo( |
41 const FilePath& file_path); | 43 const base::FilePath& file_path); |
42 #endif // OS_WIN || OS_MACOSX | 44 #endif // OS_WIN || OS_MACOSX |
43 | 45 |
44 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
45 // Creates a FileVersionInfo for the specified module. Returns NULL in case | 47 // Creates a FileVersionInfo for the specified module. Returns NULL in case |
46 // of error. The returned object should be deleted when you are done with it. | 48 // of error. The returned object should be deleted when you are done with it. |
47 BASE_EXPORT static FileVersionInfo* CreateFileVersionInfoForModule( | 49 BASE_EXPORT static FileVersionInfo* CreateFileVersionInfoForModule( |
48 HMODULE module); | 50 HMODULE module); |
49 | 51 |
50 // Creates a FileVersionInfo for the current module. Returns NULL in case | 52 // Creates a FileVersionInfo for the current module. Returns NULL in case |
51 // of error. The returned object should be deleted when you are done with it. | 53 // of error. The returned object should be deleted when you are done with it. |
(...skipping 24 matching lines...) Expand all Loading... |
76 virtual string16 original_filename() = 0; | 78 virtual string16 original_filename() = 0; |
77 virtual string16 file_description() = 0; | 79 virtual string16 file_description() = 0; |
78 virtual string16 file_version() = 0; | 80 virtual string16 file_version() = 0; |
79 virtual string16 legal_copyright() = 0; | 81 virtual string16 legal_copyright() = 0; |
80 virtual string16 legal_trademarks() = 0; | 82 virtual string16 legal_trademarks() = 0; |
81 virtual string16 last_change() = 0; | 83 virtual string16 last_change() = 0; |
82 virtual bool is_official_build() = 0; | 84 virtual bool is_official_build() = 0; |
83 }; | 85 }; |
84 | 86 |
85 #endif // BASE_FILE_VERSION_INFO_H__ | 87 #endif // BASE_FILE_VERSION_INFO_H__ |
OLD | NEW |