summaryrefslogtreecommitdiffstats
path: root/base/file_version_info.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-07-29 17:14:53 +0100
committerBen Murdoch <benm@google.com>2010-08-04 14:29:45 +0100
commitc407dc5cd9bdc5668497f21b26b09d988ab439de (patch)
tree7eaf8707c0309516bdb042ad976feedaf72b0bb1 /base/file_version_info.h
parent0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff)
downloadexternal_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip
external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz
external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'base/file_version_info.h')
-rw-r--r--base/file_version_info.h84
1 files changed, 21 insertions, 63 deletions
diff --git a/base/file_version_info.h b/base/file_version_info.h
index 561c324..9ab7a0d 100644
--- a/base/file_version_info.h
+++ b/base/file_version_info.h
@@ -7,28 +7,18 @@
#include <string>
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-
-#if defined(OS_WIN)
-struct tagVS_FIXEDFILEINFO;
-typedef tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO;
-#elif defined(OS_MACOSX)
-#ifdef __OBJC__
-@class NSBundle;
-#else
-class NSBundle;
-#endif
-#endif
+#include "build/build_config.h"
class FilePath;
-// Provides a way to access the version information for a file.
+// Provides an interface for accessing the version information for a file.
// This is the information you access when you select a file in the Windows
// explorer, right-click select Properties, then click the Version tab.
class FileVersionInfo {
public:
+ virtual ~FileVersionInfo() {}
+#if defined(OS_WIN) || defined(OS_MACOSX)
// Creates a FileVersionInfo for the specified path. Returns NULL if something
// goes wrong (typically the file does not exit or cannot be opened). The
// returned object should be deleted when you are done with it.
@@ -36,62 +26,30 @@ class FileVersionInfo {
// This version, taking a wstring, is deprecated and only kept around
// until we can fix all callers.
static FileVersionInfo* CreateFileVersionInfo(const std::wstring& file_path);
+#endif
// Creates a FileVersionInfo for the current module. Returns NULL in case
// of error. The returned object should be deleted when you are done with it.
static FileVersionInfo* CreateFileVersionInfoForCurrentModule();
- ~FileVersionInfo();
-
// Accessors to the different version properties.
// Returns an empty string if the property is not found.
- std::wstring company_name();
- std::wstring company_short_name();
- std::wstring product_name();
- std::wstring product_short_name();
- std::wstring internal_name();
- std::wstring product_version();
- std::wstring private_build();
- std::wstring special_build();
- std::wstring comments();
- std::wstring original_filename();
- std::wstring file_description();
- std::wstring file_version();
- std::wstring legal_copyright();
- std::wstring legal_trademarks();
- std::wstring last_change();
- bool is_official_build();
-
- // Lets you access other properties not covered above.
- bool GetValue(const wchar_t* name, std::wstring* value);
-
- // Similar to GetValue but returns a wstring (empty string if the property
- // does not exist).
- std::wstring GetStringValue(const wchar_t* name);
-
-#ifdef OS_WIN
- // Get the fixed file info if it exists. Otherwise NULL
- VS_FIXEDFILEINFO* fixed_file_info() { return fixed_file_info_; }
-#endif
-
- private:
-#if defined(OS_WIN)
- FileVersionInfo(void* data, int language, int code_page);
-
- scoped_ptr_malloc<char> data_;
- int language_;
- int code_page_;
- // This is a pointer into the data_ if it exists. Otherwise NULL.
- VS_FIXEDFILEINFO* fixed_file_info_;
-#elif defined(OS_MACOSX)
- explicit FileVersionInfo(NSBundle *bundle);
-
- NSBundle *bundle_;
-#elif defined(OS_POSIX)
- FileVersionInfo();
-#endif
-
- DISALLOW_EVIL_CONSTRUCTORS(FileVersionInfo);
+ virtual std::wstring company_name() = 0;
+ virtual std::wstring company_short_name() = 0;
+ virtual std::wstring product_name() = 0;
+ virtual std::wstring product_short_name() = 0;
+ virtual std::wstring internal_name() = 0;
+ virtual std::wstring product_version() = 0;
+ virtual std::wstring private_build() = 0;
+ virtual std::wstring special_build() = 0;
+ virtual std::wstring comments() = 0;
+ virtual std::wstring original_filename() = 0;
+ virtual std::wstring file_description() = 0;
+ virtual std::wstring file_version() = 0;
+ virtual std::wstring legal_copyright() = 0;
+ virtual std::wstring legal_trademarks() = 0;
+ virtual std::wstring last_change() = 0;
+ virtual bool is_official_build() = 0;
};
#endif // BASE_FILE_VERSION_INFO_H__