From 6ca8816c29fb53f17286ef2cea724ef1bc76d5b6 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Tue, 23 Oct 2018 11:20:28 +0200 Subject: [PATCH] add function that turns writer version into string --- src/OpenMesh/Core/IO/OMFormat.cc | 13 +++++++++++++ src/OpenMesh/Core/IO/OMFormat.hh | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/OpenMesh/Core/IO/OMFormat.cc b/src/OpenMesh/Core/IO/OMFormat.cc index 231dfacd..0c1a63dd 100644 --- a/src/OpenMesh/Core/IO/OMFormat.cc +++ b/src/OpenMesh/Core/IO/OMFormat.cc @@ -113,6 +113,19 @@ namespace OMFormat { return hdr; } +//----------------------------------------------------------------------------- + + + std::string as_string(uint8 version) + { + std::stringstream ss; + ss << major_version(version); + ss << "."; + ss << minor_version(version); + return ss.str(); + } + + //----------------------------------------------------------------------------- const char *as_string(Chunk::Entity e) diff --git a/src/OpenMesh/Core/IO/OMFormat.hh b/src/OpenMesh/Core/IO/OMFormat.hh index 9bbcd860..2fef1389 100644 --- a/src/OpenMesh/Core/IO/OMFormat.hh +++ b/src/OpenMesh/Core/IO/OMFormat.hh @@ -469,6 +469,8 @@ namespace OMFormat { // ---------------------------------------- convenience functions + std::string as_string(uint8 version); + const char *as_string(Chunk::Type t); const char *as_string(Chunk::Entity e); const char *as_string(Chunk::Dim d);