DEADSOFTWARE

Move endian-ness detection into Reader class
authorGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Tue, 15 Nov 2011 15:15:55 +0000 (15:15 +0000)
committerGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Tue, 15 Nov 2011 15:15:55 +0000 (15:15 +0000)
oberon.h
reader/reader.h
reader/util.cc

index 2f9e39bd6f135d4b874b6269192a4fdb38cd6ca1..9a2d58d8b401f614b1ffce08a7ca31a79b50f2d1 100644 (file)
--- a/oberon.h
+++ b/oberon.h
@@ -62,9 +62,6 @@ namespace odc {
         * String: string in the Unicode character set, followed by a 0000X
         * i.e. CHAR*
         */
-
-       bool isBigEndian();
-       bool isLittleEndian();
 }
 
 #endif
index b7becc0cef671b24d3d4cd968f628d8323dc2396..eb593b5859c074ea74410895d5da467668720164 100644 (file)
@@ -225,6 +225,10 @@ private:
         * Add another component to the current path. If first==true, start a new path.
         */
        void addPathComponent(bool first, const std::string &typeName);
+
+       static bool isBigEndian();
+       static bool isLittleEndian();
+
 };
 
 } // namespace odc
index 31befb7d1905e98f126ce3d7bbc2b1e54118d38d..76cd6af8efc712725939a11fd0df084151e79c93 100644 (file)
@@ -1,7 +1,7 @@
-#include "oberon.h"
+#include "reader/reader.h"
 
 namespace odc {
-       bool isBigEndian() { // http://stackoverflow.com/questions/1001307/detecting-endianness-programmatically-in-a-c-program
+       bool Reader::isBigEndian() { // http://stackoverflow.com/questions/1001307/detecting-endianness-programmatically-in-a-c-program
                union {
                        uint32_t i;
                        uint8_t c[4];
@@ -9,7 +9,7 @@ namespace odc {
                return test.c[0] == 1; 
        }
 
-       bool isLittleEndian() {
+       bool Reader::isLittleEndian() {
                return !isBigEndian();
        }
 }