OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "build/build_config.h" |
| 10 |
9 #include <string> | 11 #include <string> |
10 | 12 |
11 #include "build/build_config.h" | 13 #include "base/string16.h" |
12 | 14 |
13 class FilePath; | 15 class FilePath; |
14 | 16 |
15 // Provides an interface for accessing the version information for a file. | 17 // Provides an interface for accessing the version information for a file. This |
16 // This is the information you access when you select a file in the Windows | 18 // is the information you access when you select a file in the Windows Explorer, |
17 // explorer, right-click select Properties, then click the Version tab. | 19 // right-click select Properties, then click the Version tab, and on the Mac |
| 20 // when you select a file in the Finder and do a Get Info. |
| 21 // |
| 22 // This list of properties is straight out of Win32's VerQueryValue |
| 23 // <http://msdn.microsoft.com/en-us/library/ms647464.aspx> and the Mac |
| 24 // version returns values from the Info.plist as appropriate. TODO(avi): make |
| 25 // this a less-obvious Windows-ism. |
18 | 26 |
19 class FileVersionInfo { | 27 class FileVersionInfo { |
20 public: | 28 public: |
21 virtual ~FileVersionInfo() {} | 29 virtual ~FileVersionInfo() {} |
22 #if defined(OS_WIN) || defined(OS_MACOSX) | 30 #if defined(OS_WIN) || defined(OS_MACOSX) |
23 // Creates a FileVersionInfo for the specified path. Returns NULL if something | 31 // Creates a FileVersionInfo for the specified path. Returns NULL if something |
24 // goes wrong (typically the file does not exit or cannot be opened). The | 32 // goes wrong (typically the file does not exit or cannot be opened). The |
25 // returned object should be deleted when you are done with it. | 33 // returned object should be deleted when you are done with it. |
26 static FileVersionInfo* CreateFileVersionInfo(const FilePath& file_path); | 34 static FileVersionInfo* CreateFileVersionInfo(const FilePath& file_path); |
27 #endif // OS_WIN || OS_MACOSX | 35 #endif // OS_WIN || OS_MACOSX |
28 | 36 |
29 #if defined(OS_WIN) | |
30 // This version, taking a wstring, is deprecated and only kept around | |
31 // until we can fix all callers. | |
32 static FileVersionInfo* CreateFileVersionInfo(const std::wstring& file_path); | |
33 #endif // OS_WIN | |
34 | |
35 // Creates a FileVersionInfo for the current module. Returns NULL in case | 37 // Creates a FileVersionInfo for the current module. Returns NULL in case |
36 // of error. The returned object should be deleted when you are done with it. | 38 // of error. The returned object should be deleted when you are done with it. |
37 static FileVersionInfo* CreateFileVersionInfoForCurrentModule(); | 39 static FileVersionInfo* CreateFileVersionInfoForCurrentModule(); |
38 | 40 |
39 // Accessors to the different version properties. | 41 // Accessors to the different version properties. |
40 // Returns an empty string if the property is not found. | 42 // Returns an empty string if the property is not found. |
41 virtual std::wstring company_name() = 0; | 43 virtual string16 company_name() = 0; |
42 virtual std::wstring company_short_name() = 0; | 44 virtual string16 company_short_name() = 0; |
43 virtual std::wstring product_name() = 0; | 45 virtual string16 product_name() = 0; |
44 virtual std::wstring product_short_name() = 0; | 46 virtual string16 product_short_name() = 0; |
45 virtual std::wstring internal_name() = 0; | 47 virtual string16 internal_name() = 0; |
46 virtual std::wstring product_version() = 0; | 48 virtual string16 product_version() = 0; |
47 virtual std::wstring private_build() = 0; | 49 virtual string16 private_build() = 0; |
48 virtual std::wstring special_build() = 0; | 50 virtual string16 special_build() = 0; |
49 virtual std::wstring comments() = 0; | 51 virtual string16 comments() = 0; |
50 virtual std::wstring original_filename() = 0; | 52 virtual string16 original_filename() = 0; |
51 virtual std::wstring file_description() = 0; | 53 virtual string16 file_description() = 0; |
52 virtual std::wstring file_version() = 0; | 54 virtual string16 file_version() = 0; |
53 virtual std::wstring legal_copyright() = 0; | 55 virtual string16 legal_copyright() = 0; |
54 virtual std::wstring legal_trademarks() = 0; | 56 virtual string16 legal_trademarks() = 0; |
55 virtual std::wstring last_change() = 0; | 57 virtual string16 last_change() = 0; |
56 virtual bool is_official_build() = 0; | 58 virtual bool is_official_build() = 0; |
57 }; | 59 }; |
58 | 60 |
59 #endif // BASE_FILE_VERSION_INFO_H__ | 61 #endif // BASE_FILE_VERSION_INFO_H__ |
OLD | NEW |