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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/file_path.h" |
11 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
12 | 13 |
13 #ifdef OS_MACOSX | 14 #ifdef OS_MACOSX |
14 #ifdef __OBJC__ | 15 #ifdef __OBJC__ |
15 @class NSBundle; | 16 @class NSBundle; |
16 #else | 17 #else |
17 class NSBundle; | 18 class NSBundle; |
18 #endif | 19 #endif |
19 #endif | 20 #endif |
20 | 21 |
21 // Provides a way to access the version information for a file. | 22 // Provides a way to access the version information for a file. |
22 // This is the information you access when you select a file in the Windows | 23 // This is the information you access when you select a file in the Windows |
23 // explorer, right-click select Properties, then click the Version tab. | 24 // explorer, right-click select Properties, then click the Version tab. |
24 | 25 |
25 class FileVersionInfo { | 26 class FileVersionInfo { |
26 public: | 27 public: |
27 // Creates a FileVersionInfo for the specified path. Returns NULL if something | 28 // Creates a FileVersionInfo for the specified path. Returns NULL if something |
28 // goes wrong (typically the file does not exit or cannot be opened). The | 29 // goes wrong (typically the file does not exit or cannot be opened). The |
29 // returned object should be deleted when you are done with it. | 30 // returned object should be deleted when you are done with it. |
| 31 static FileVersionInfo* CreateFileVersionInfo(const FilePath& file_path); |
| 32 // This version, taking a wstring, is deprecated and only kept around |
| 33 // until we can fix all callers. |
30 static FileVersionInfo* CreateFileVersionInfo(const std::wstring& file_path); | 34 static FileVersionInfo* CreateFileVersionInfo(const std::wstring& file_path); |
31 | 35 |
32 // Creates a FileVersionInfo for the current module. Returns NULL in case | 36 // Creates a FileVersionInfo for the current module. Returns NULL in case |
33 // of error. The returned object should be deleted when you are done with it. | 37 // of error. The returned object should be deleted when you are done with it. |
34 static FileVersionInfo* CreateFileVersionInfoForCurrentModule(); | 38 static FileVersionInfo* CreateFileVersionInfoForCurrentModule(); |
35 | 39 |
36 ~FileVersionInfo(); | 40 ~FileVersionInfo(); |
37 | 41 |
38 // Accessors to the different version properties. | 42 // Accessors to the different version properties. |
39 // Returns an empty string if the property is not found. | 43 // Returns an empty string if the property is not found. |
(...skipping 30 matching lines...) Expand all Loading... |
70 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
71 FileVersionInfo(void* data, int language, int code_page); | 75 FileVersionInfo(void* data, int language, int code_page); |
72 | 76 |
73 scoped_ptr_malloc<char> data_; | 77 scoped_ptr_malloc<char> data_; |
74 int language_; | 78 int language_; |
75 int code_page_; | 79 int code_page_; |
76 // This is a pointer into the data_ if it exists. Otherwise NULL. | 80 // This is a pointer into the data_ if it exists. Otherwise NULL. |
77 VS_FIXEDFILEINFO* fixed_file_info_; | 81 VS_FIXEDFILEINFO* fixed_file_info_; |
78 #elif defined(OS_MACOSX) | 82 #elif defined(OS_MACOSX) |
79 explicit FileVersionInfo(NSBundle *bundle); | 83 explicit FileVersionInfo(NSBundle *bundle); |
80 explicit FileVersionInfo(const std::wstring& file_path); | |
81 | 84 |
82 NSBundle *bundle_; | 85 NSBundle *bundle_; |
83 #endif | 86 #endif |
84 | 87 |
85 DISALLOW_EVIL_CONSTRUCTORS(FileVersionInfo); | 88 DISALLOW_EVIL_CONSTRUCTORS(FileVersionInfo); |
86 }; | 89 }; |
87 | 90 |
88 #endif // BASE_FILE_VERSION_INFO_H__ | 91 #endif // BASE_FILE_VERSION_INFO_H__ |
89 | 92 |
OLD | NEW |