WebKit Roll 61390:61491.
[chromium-blink-merge.git] / base / file_version_info_win.h
blobce173feb3c1e7a36dbba17321aff4cd4b330c75e
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
3 // found in the LICENSE file.
5 #ifndef BASE_FILE_VERSION_INFO_WIN_H_
6 #define BASE_FILE_VERSION_INFO_WIN_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/file_version_info.h"
12 #include "base/scoped_ptr.h"
14 struct tagVS_FIXEDFILEINFO;
15 typedef tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO;
17 class FilePath;
19 // Provides a way to access the version information for a file.
20 // This is the information you access when you select a file in the Windows
21 // explorer, right-click select Properties, then click the Version tab.
23 class FileVersionInfoWin : public FileVersionInfo {
24 public:
25 FileVersionInfoWin(void* data, int language, int code_page);
26 ~FileVersionInfoWin();
28 // Accessors to the different version properties.
29 // Returns an empty string if the property is not found.
30 virtual std::wstring company_name();
31 virtual std::wstring company_short_name();
32 virtual std::wstring product_name();
33 virtual std::wstring product_short_name();
34 virtual std::wstring internal_name();
35 virtual std::wstring product_version();
36 virtual std::wstring private_build();
37 virtual std::wstring special_build();
38 virtual std::wstring comments();
39 virtual std::wstring original_filename();
40 virtual std::wstring file_description();
41 virtual std::wstring file_version();
42 virtual std::wstring legal_copyright();
43 virtual std::wstring legal_trademarks();
44 virtual std::wstring last_change();
45 virtual bool is_official_build();
47 // Lets you access other properties not covered above.
48 bool GetValue(const wchar_t* name, std::wstring* value);
50 // Similar to GetValue but returns a wstring (empty string if the property
51 // does not exist).
52 std::wstring GetStringValue(const wchar_t* name);
54 // Get the fixed file info if it exists. Otherwise NULL
55 VS_FIXEDFILEINFO* fixed_file_info() { return fixed_file_info_; }
57 private:
58 scoped_ptr_malloc<char> data_;
59 int language_;
60 int code_page_;
61 // This is a pointer into the data_ if it exists. Otherwise NULL.
62 VS_FIXEDFILEINFO* fixed_file_info_;
64 DISALLOW_COPY_AND_ASSIGN(FileVersionInfoWin);
67 #endif // BASE_FILE_VERSION_INFO_WIN_H_