michael@0: // Copyright (c) 2011 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_FILE_VERSION_INFO_WIN_H_ michael@0: #define BASE_FILE_VERSION_INFO_WIN_H_ michael@0: michael@0: #include michael@0: michael@0: #include "base/base_export.h" michael@0: #include "base/basictypes.h" michael@0: #include "base/file_version_info.h" michael@0: #include "base/memory/scoped_ptr.h" michael@0: michael@0: struct tagVS_FIXEDFILEINFO; michael@0: typedef tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO; michael@0: michael@0: class FileVersionInfoWin : public FileVersionInfo { michael@0: public: michael@0: BASE_EXPORT FileVersionInfoWin(void* data, int language, int code_page); michael@0: BASE_EXPORT ~FileVersionInfoWin(); michael@0: michael@0: // Accessors to the different version properties. michael@0: // Returns an empty string if the property is not found. michael@0: virtual string16 company_name() OVERRIDE; michael@0: virtual string16 company_short_name() OVERRIDE; michael@0: virtual string16 product_name() OVERRIDE; michael@0: virtual string16 product_short_name() OVERRIDE; michael@0: virtual string16 internal_name() OVERRIDE; michael@0: virtual string16 product_version() OVERRIDE; michael@0: virtual string16 private_build() OVERRIDE; michael@0: virtual string16 special_build() OVERRIDE; michael@0: virtual string16 comments() OVERRIDE; michael@0: virtual string16 original_filename() OVERRIDE; michael@0: virtual string16 file_description() OVERRIDE; michael@0: virtual string16 file_version() OVERRIDE; michael@0: virtual string16 legal_copyright() OVERRIDE; michael@0: virtual string16 legal_trademarks() OVERRIDE; michael@0: virtual string16 last_change() OVERRIDE; michael@0: virtual bool is_official_build() OVERRIDE; michael@0: michael@0: // Lets you access other properties not covered above. michael@0: BASE_EXPORT bool GetValue(const wchar_t* name, std::wstring* value); michael@0: michael@0: // Similar to GetValue but returns a wstring (empty string if the property michael@0: // does not exist). michael@0: BASE_EXPORT std::wstring GetStringValue(const wchar_t* name); michael@0: michael@0: // Get the fixed file info if it exists. Otherwise NULL michael@0: VS_FIXEDFILEINFO* fixed_file_info() { return fixed_file_info_; } michael@0: michael@0: private: michael@0: scoped_ptr_malloc data_; michael@0: int language_; michael@0: int code_page_; michael@0: // This is a pointer into the data_ if it exists. Otherwise NULL. michael@0: VS_FIXEDFILEINFO* fixed_file_info_; michael@0: michael@0: DISALLOW_COPY_AND_ASSIGN(FileVersionInfoWin); michael@0: }; michael@0: michael@0: #endif // BASE_FILE_VERSION_INFO_WIN_H_