file_version_info.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
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.
4
5#ifndef BASE_FILE_VERSION_INFO_H__
6#define BASE_FILE_VERSION_INFO_H__
7
8#include <string>
9
10#include "build/build_config.h"
11
12class FilePath;
13
14// Provides an interface for accessing the version information for a file.
15// This is the information you access when you select a file in the Windows
16// explorer, right-click select Properties, then click the Version tab.
17
18class FileVersionInfo {
19 public:
20  virtual ~FileVersionInfo() {}
21#if defined(OS_WIN) || defined(OS_MACOSX)
22  // Creates a FileVersionInfo for the specified path. Returns NULL if something
23  // goes wrong (typically the file does not exit or cannot be opened). The
24  // returned object should be deleted when you are done with it.
25  static FileVersionInfo* CreateFileVersionInfo(const FilePath& file_path);
26  // This version, taking a wstring, is deprecated and only kept around
27  // until we can fix all callers.
28  static FileVersionInfo* CreateFileVersionInfo(const std::wstring& file_path);
29#endif
30
31  // Creates a FileVersionInfo for the current module. Returns NULL in case
32  // of error. The returned object should be deleted when you are done with it.
33  static FileVersionInfo* CreateFileVersionInfoForCurrentModule();
34
35  // Accessors to the different version properties.
36  // Returns an empty string if the property is not found.
37  virtual std::wstring company_name() = 0;
38  virtual std::wstring company_short_name() = 0;
39  virtual std::wstring product_name() = 0;
40  virtual std::wstring product_short_name() = 0;
41  virtual std::wstring internal_name() = 0;
42  virtual std::wstring product_version() = 0;
43  virtual std::wstring private_build() = 0;
44  virtual std::wstring special_build() = 0;
45  virtual std::wstring comments() = 0;
46  virtual std::wstring original_filename() = 0;
47  virtual std::wstring file_description() = 0;
48  virtual std::wstring file_version() = 0;
49  virtual std::wstring legal_copyright() = 0;
50  virtual std::wstring legal_trademarks() = 0;
51  virtual std::wstring last_change() = 0;
52  virtual bool is_official_build() = 0;
53};
54
55#endif  // BASE_FILE_VERSION_INFO_H__
56