changeset 3530:b26b6ea27648

endianness to string
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Oct 2019 11:13:32 +0200
parents 625625ed098f
children e4b4b4dbef99
files Core/Enumerations.cpp Core/Enumerations.h
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Enumerations.cpp	Mon Sep 30 20:40:42 2019 +0200
+++ b/Core/Enumerations.cpp	Wed Oct 02 11:13:32 2019 +0200
@@ -1141,6 +1141,25 @@
   }
   
 
+  const char* EnumerationToString(Endianness endianness)
+  {
+    switch (endianness)
+    {
+      case Endianness_Little:
+        return "Little-endian";
+
+      case Endianness_Big:
+        return "Big-endian";
+
+      case Endianness_Unknown:
+        return "Unknown endianness";
+                
+      default:
+        throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+  }
+
+
   Encoding StringToEncoding(const char* encoding)
   {
     std::string s(encoding);
--- a/Core/Enumerations.h	Mon Sep 30 20:40:42 2019 +0200
+++ b/Core/Enumerations.h	Wed Oct 02 11:13:32 2019 +0200
@@ -749,6 +749,8 @@
 
   const char* EnumerationToString(MimeType mime);
 
+  const char* EnumerationToString(Endianness endianness);
+
   Encoding StringToEncoding(const char* encoding);
 
   ResourceType StringToResourceType(const char* type);