diff --git a/aspectratio.h b/aspectratio.h index dfd9892..a7f4f82 100644 --- a/aspectratio.h +++ b/aspectratio.h @@ -3,8 +3,11 @@ #include "./global.h" +#include #include +#include + namespace TagParser { struct TAG_PARSER_EXPORT AspectRatio { @@ -13,6 +16,7 @@ struct TAG_PARSER_EXPORT AspectRatio { constexpr AspectRatio(uint16 numerator, uint16 denominator); constexpr bool isValid() const; constexpr bool isExtended() const; + std::string toString() const; byte type; uint16 numerator; @@ -56,6 +60,14 @@ constexpr bool AspectRatio::isExtended() const return type == 0xFF; } +/*! + * \brief Returns the string representation "numerator : denominator". + */ +inline std::string AspectRatio::toString() const +{ + return ConversionUtilities::argsToString(numerator, " : ", denominator); +} + } // namespace TagParser #endif // TAG_PARSER_ASPECTRATIO_H