[email protected] | 90509cb | 2011-03-25 18:46:38 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 4 | |
tfarina | a3116351 | 2015-05-13 22:10:15 | [diff] [blame] | 5 | #ifndef BASE_FILE_VERSION_INFO_H_ |
6 | #define BASE_FILE_VERSION_INFO_H_ | ||||
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 7 | |
thakis | d62f5447 | 2016-04-04 02:21:10 | [diff] [blame] | 8 | #include <string> |
9 | |||||
[email protected] | 70910be | 2011-04-22 23:55:45 | [diff] [blame] | 10 | #include "build/build_config.h" |
thakis | d62f5447 | 2016-04-04 02:21:10 | [diff] [blame] | 11 | #include "base/base_export.h" |
12 | #include "base/strings/string16.h" | ||||
[email protected] | 70910be | 2011-04-22 23:55:45 | [diff] [blame] | 13 | |
14 | #if defined(OS_WIN) | ||||
15 | #include <windows.h> | ||||
thakis | d62f5447 | 2016-04-04 02:21:10 | [diff] [blame] | 16 | #endif |
[email protected] | 72c93c70 | 2008-08-05 20:00:26 | [diff] [blame] | 17 | |
[email protected] | a3ef483 | 2013-02-02 05:12:33 | [diff] [blame] | 18 | namespace base { |
[email protected] | f539333 | 2009-06-03 15:01:29 | [diff] [blame] | 19 | class FilePath; |
[email protected] | a3ef483 | 2013-02-02 05:12:33 | [diff] [blame] | 20 | } |
[email protected] | f539333 | 2009-06-03 15:01:29 | [diff] [blame] | 21 | |
[email protected] | 4f260d0 | 2010-12-23 18:35:42 | [diff] [blame] | 22 | // Provides an interface for accessing the version information for a file. This |
23 | // is the information you access when you select a file in the Windows Explorer, | ||||
24 | // right-click select Properties, then click the Version tab, and on the Mac | ||||
25 | // when you select a file in the Finder and do a Get Info. | ||||
26 | // | ||||
27 | // This list of properties is straight out of Win32's VerQueryValue | ||||
28 | // <http://msdn.microsoft.com/en-us/library/ms647464.aspx> and the Mac | ||||
29 | // version returns values from the Info.plist as appropriate. TODO(avi): make | ||||
30 | // this a less-obvious Windows-ism. | ||||
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 31 | |
mgiuca | 8137fc2 | 2015-05-07 02:20:31 | [diff] [blame] | 32 | class BASE_EXPORT FileVersionInfo { |
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 33 | public: |
[email protected] | e462cf5 | 2010-05-21 23:00:17 | [diff] [blame] | 34 | virtual ~FileVersionInfo() {} |
[email protected] | bcff05a | 2010-04-14 01:46:43 | [diff] [blame] | 35 | #if defined(OS_WIN) || defined(OS_MACOSX) |
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 36 | // Creates a FileVersionInfo for the specified path. Returns NULL if something |
37 | // goes wrong (typically the file does not exit or cannot be opened). The | ||||
38 | // returned object should be deleted when you are done with it. | ||||
mgiuca | 8137fc2 | 2015-05-07 02:20:31 | [diff] [blame] | 39 | static FileVersionInfo* CreateFileVersionInfo( |
[email protected] | a3ef483 | 2013-02-02 05:12:33 | [diff] [blame] | 40 | const base::FilePath& file_path); |
[email protected] | 7c1e303 | 2010-12-20 18:40:42 | [diff] [blame] | 41 | #endif // OS_WIN || OS_MACOSX |
42 | |||||
[email protected] | 70910be | 2011-04-22 23:55:45 | [diff] [blame] | 43 | #if defined(OS_WIN) |
44 | // Creates a FileVersionInfo for the specified module. Returns NULL in case | ||||
45 | // of error. The returned object should be deleted when you are done with it. | ||||
mgiuca | 8137fc2 | 2015-05-07 02:20:31 | [diff] [blame] | 46 | static FileVersionInfo* CreateFileVersionInfoForModule(HMODULE module); |
[email protected] | 70910be | 2011-04-22 23:55:45 | [diff] [blame] | 47 | #else |
48 | // Creates a FileVersionInfo for the current module. Returns NULL in case | ||||
49 | // of error. The returned object should be deleted when you are done with it. | ||||
mgiuca | 8137fc2 | 2015-05-07 02:20:31 | [diff] [blame] | 50 | static FileVersionInfo* CreateFileVersionInfoForCurrentModule(); |
[email protected] | 70910be | 2011-04-22 23:55:45 | [diff] [blame] | 51 | #endif // OS_WIN |
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 52 | |
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 53 | // Accessors to the different version properties. |
54 | // Returns an empty string if the property is not found. | ||||
[email protected] | 476dafb | 2013-12-03 00:39:26 | [diff] [blame] | 55 | virtual base::string16 company_name() = 0; |
56 | virtual base::string16 company_short_name() = 0; | ||||
57 | virtual base::string16 product_name() = 0; | ||||
58 | virtual base::string16 product_short_name() = 0; | ||||
59 | virtual base::string16 internal_name() = 0; | ||||
60 | virtual base::string16 product_version() = 0; | ||||
61 | virtual base::string16 private_build() = 0; | ||||
62 | virtual base::string16 special_build() = 0; | ||||
63 | virtual base::string16 comments() = 0; | ||||
64 | virtual base::string16 original_filename() = 0; | ||||
65 | virtual base::string16 file_description() = 0; | ||||
66 | virtual base::string16 file_version() = 0; | ||||
67 | virtual base::string16 legal_copyright() = 0; | ||||
68 | virtual base::string16 legal_trademarks() = 0; | ||||
69 | virtual base::string16 last_change() = 0; | ||||
[email protected] | bcff05a | 2010-04-14 01:46:43 | [diff] [blame] | 70 | virtual bool is_official_build() = 0; |
initial.commit | d7cae12 | 2008-07-26 21:49:38 | [diff] [blame] | 71 | }; |
72 | |||||
tfarina | a3116351 | 2015-05-13 22:10:15 | [diff] [blame] | 73 | #endif // BASE_FILE_VERSION_INFO_H_ |