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. base::string16 company_name() override;
  20. base::string16 company_short_name() override;
  21. base::string16 product_name() override;
  22. base::string16 product_short_name() override;
  23. base::string16 internal_name() override;
  24. base::string16 product_version() override;
  25. base::string16 special_build() override;
  26. base::string16 original_filename() override;
  27. base::string16 file_description() override;
  28. base::string16 file_version() override;
  29. private:
  30. // Returns a base::string16 value for a property name.
  31. // Returns the empty string if the property does not exist.
  32. base::string16 GetString16Value(CFStringRef name);
  33. base::scoped_nsobject<NSBundle> bundle_;
  34. };
  35. #endif // BASE_FILE_VERSION_INFO_MAC_H_