You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.0 KiB

1 year ago
  1. /**
  2. * @file Version.h
  3. * @brief SDK version information routines.
  4. * @copyright VisionLabs LLC
  5. * @date 11.10.2016
  6. * */
  7. #pragma once
  8. #include "Def.h"
  9. #include <cstdint>
  10. namespace fsdk {
  11. /**
  12. * @addtogroup VersionGroup Version
  13. * @brief SDK Build type and version info.
  14. * @{
  15. * */
  16. /**
  17. * Version structure.
  18. * */
  19. struct Version {
  20. uint8_t major; //!< Major version number.
  21. uint8_t minor; //!< Minor version number.
  22. uint16_t patch; //!< Revision number.
  23. };
  24. /**
  25. * @brief Check if one version is less than another.
  26. * @param lhs first version
  27. * @param rhs second version
  28. * @return true if lhs is less than rhs
  29. * */
  30. inline bool operator < (Version lhs, Version rhs) noexcept {
  31. if (lhs.major < rhs.major)
  32. return true;
  33. if (lhs.minor < rhs.minor)
  34. return true;
  35. return lhs.patch < rhs.patch;
  36. }
  37. /**
  38. * @brief Check if versions are equal.
  39. * @param lhs first version
  40. * @param rhs second version
  41. * @return true if versions are equal
  42. * */
  43. inline bool operator == (Version lhs, Version rhs) noexcept {
  44. return lhs.major == rhs.major &&
  45. lhs.minor == rhs.minor &&
  46. lhs.patch == rhs.patch;
  47. }
  48. /**
  49. * @brief Check if versions are not equal.
  50. * @param lhs first version
  51. * @param rhs second version
  52. * @return true if versions are not equal
  53. * */
  54. inline bool operator != (Version lhs, Version rhs) noexcept {
  55. return !(lhs == rhs);
  56. }
  57. /**
  58. * @brief Get FaceEngine version.
  59. * @return filled version structure.
  60. * */
  61. FSDK_API Version getVersion() noexcept;
  62. /**
  63. * @brief Get FaceEngine commit hash.
  64. * @return commit hash as a null-terminated string.
  65. * */
  66. FSDK_API const char* getVersionHash() noexcept;
  67. /**
  68. * @brief Get FaceEngine version string.
  69. * @return version as a null-terminated string.
  70. * */
  71. FSDK_API const char* getVersionString() noexcept;
  72. /**
  73. * @brief Get FaceEngine build description.
  74. * The descripton contains used flags and compler settings.
  75. * @return description as a null-terminated string.
  76. * */
  77. FSDK_API const char* getBuildInfo() noexcept;
  78. /** @} */ // end of VersionGroup
  79. }