file_version_info_mac.h revision dc0f95d653279beabeb9817299e2902918ba123e
1// Copyright (c) 2010 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_MAC_H_
6#define BASE_FILE_VERSION_INFO_MAC_H_
7#pragma once
8
9#include <string>
10
11#include "base/file_version_info.h"
12#include "base/scoped_nsobject.h"
13
14#ifdef __OBJC__
15@class NSBundle;
16#else
17class NSBundle;
18#endif
19
20class FileVersionInfoMac : public FileVersionInfo {
21 public:
22  explicit FileVersionInfoMac(NSBundle *bundle);
23  virtual ~FileVersionInfoMac();
24
25  // Accessors to the different version properties.
26  // Returns an empty string if the property is not found.
27  virtual string16 company_name();
28  virtual string16 company_short_name();
29  virtual string16 product_name();
30  virtual string16 product_short_name();
31  virtual string16 internal_name();
32  virtual string16 product_version();
33  virtual string16 private_build();
34  virtual string16 special_build();
35  virtual string16 comments();
36  virtual string16 original_filename();
37  virtual string16 file_description();
38  virtual string16 file_version();
39  virtual string16 legal_copyright();
40  virtual string16 legal_trademarks();
41  virtual string16 last_change();
42  virtual bool is_official_build();
43
44 private:
45  // Returns a string16 value for a property name.
46  // Returns the empty string if the property does not exist.
47  string16 GetString16Value(CFStringRef name);
48
49  scoped_nsobject<NSBundle> bundle_;
50
51  DISALLOW_COPY_AND_ASSIGN(FileVersionInfoMac);
52};
53
54#endif  // BASE_FILE_VERSION_INFO_MAC_H_
55