file_version_info_mac.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. @class NSBundle;
  11. class FileVersionInfoMac : public FileVersionInfo {
  12. public:
  13. explicit FileVersionInfoMac(NSBundle *bundle);
  14. FileVersionInfoMac(const FileVersionInfoMac&) = delete;
  15. FileVersionInfoMac& operator=(const FileVersionInfoMac&) = delete;
  16. ~FileVersionInfoMac() override;
  17. // Accessors to the different version properties.
  18. // Returns an empty string if the property is not found.
  19. std::u16string company_name() override;
  20. std::u16string company_short_name() override;
  21. std::u16string product_name() override;
  22. std::u16string product_short_name() override;
  23. std::u16string internal_name() override;
  24. std::u16string product_version() override;
  25. std::u16string special_build() override;
  26. std::u16string original_filename() override;
  27. std::u16string file_description() override;
  28. std::u16string file_version() override;
  29. private:
  30. // Returns a std::u16string value for a property name.
  31. // Returns the empty string if the property does not exist.
  32. std::u16string GetString16Value(CFStringRef name);
  33. base::scoped_nsobject<NSBundle> bundle_;
  34. };
  35. #endif // BASE_FILE_VERSION_INFO_MAC_H_