• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2011 The Chromium Authors
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 
8 #include <CoreFoundation/CoreFoundation.h>
9 #include <string>
10 
11 #include "base/file_version_info.h"
12 #include "base/mac/scoped_nsobject.h"
13 
14 @class NSBundle;
15 
16 class FileVersionInfoMac : public FileVersionInfo {
17  public:
18   explicit FileVersionInfoMac(NSBundle *bundle);
19   FileVersionInfoMac(const FileVersionInfoMac&) = delete;
20   FileVersionInfoMac& operator=(const FileVersionInfoMac&) = delete;
21   ~FileVersionInfoMac() override;
22 
23   // Accessors to the different version properties.
24   // Returns an empty string if the property is not found.
25   std::u16string company_name() override;
26   std::u16string company_short_name() override;
27   std::u16string product_name() override;
28   std::u16string product_short_name() override;
29   std::u16string internal_name() override;
30   std::u16string product_version() override;
31   std::u16string special_build() override;
32   std::u16string original_filename() override;
33   std::u16string file_description() override;
34   std::u16string file_version() override;
35 
36  private:
37   // Returns a std::u16string value for a property name.
38   // Returns the empty string if the property does not exist.
39   std::u16string GetString16Value(CFStringRef name);
40 
41   base::scoped_nsobject<NSBundle> bundle_;
42 };
43 
44 #endif  // BASE_FILE_VERSION_INFO_MAC_H_
45