Add AspectRatio::toString()
This commit is contained in:
parent
c4adad4297
commit
54174f014a
|
@ -3,8 +3,11 @@
|
|||
|
||||
#include "./global.h"
|
||||
|
||||
#include <c++utilities/conversion/stringbuilder.h>
|
||||
#include <c++utilities/conversion/types.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue