file_version_info_mac.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2011 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. #ifndef BASE_FILE_VERSION_INFO_MAC_H_
  5. #define BASE_FILE_VERSION_INFO_MAC_H_
  6. #include <CoreFoundation/CoreFoundation.h>
  7. #include <string>
  8. #include "base/file_version_info.h"
  9. #include "base/mac/scoped_nsobject.h"
  10. #include "base/macros.h"
  11. @class NSBundle;
  12. class FileVersionInfoMac : public FileVersionInfo {
  13. public:
  14. explicit FileVersionInfoMac(NSBundle *bundle);
  15. ~FileVersionInfoMac() override;
  16. // Accessors to the different version properties.
  17. // Returns an empty string if the property is not found.
  18. base::string16 company_name() override;
  19. base::string16 company_short_name() override;
  20. base::string16 product_name() override;
  21. base::string16 product_short_name() override;
  22. base::string16 internal_name() override;
  23. base::string16 product_version() override;
  24. base::string16 special_build() override;
  25. base::string16 original_filename() override;
  26. base::string16 file_description() override;
  27. base::string16 file_version() override;
  28. private:
  29. // Returns a base::string16 value for a property name.
  30. // Returns the empty string if the property does not exist.
  31. base::string16 GetString16Value(CFStringRef name);
  32. base::scoped_nsobject<NSBundle> bundle_;
  33. DISALLOW_COPY_AND_ASSIGN(FileVersionInfoMac);
  34. };
  35. #endif // BASE_FILE_VERSION_INFO_MAC_H_