xref: /aosp_15_r20/external/cronet/base/file_version_info_apple.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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_APPLE_H_
6 #define BASE_FILE_VERSION_INFO_APPLE_H_
7 
8 #include "base/file_version_info.h"
9 
10 #include <CoreFoundation/CoreFoundation.h>
11 
12 #include <string>
13 
14 @class NSBundle;
15 
16 class FileVersionInfoApple : public FileVersionInfo {
17  public:
18   explicit FileVersionInfoApple(NSBundle* bundle);
19   FileVersionInfoApple(const FileVersionInfoApple&) = delete;
20   FileVersionInfoApple& operator=(const FileVersionInfoApple&) = delete;
21   ~FileVersionInfoApple() 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   NSBundle* __strong bundle_;
42 };
43 
44 #endif  // BASE_FILE_VERSION_INFO_APPLE_H_
45