summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8bb15b1)
raw | patch | inline | side by side (parent: 8bb15b1)
author | Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl> | |
Tue, 15 Nov 2011 15:15:55 +0000 (15:15 +0000) | ||
committer | Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl> | |
Tue, 15 Nov 2011 15:15:55 +0000 (15:15 +0000) |
oberon.h | patch | blob | history | |
reader/reader.h | patch | blob | history | |
reader/util.cc | patch | blob | history |
diff --git a/oberon.h b/oberon.h
index 2f9e39bd6f135d4b874b6269192a4fdb38cd6ca1..9a2d58d8b401f614b1ffce08a7ca31a79b50f2d1 100644 (file)
--- a/oberon.h
+++ b/oberon.h
* String: string in the Unicode character set, followed by a 0000X
* i.e. CHAR*
*/
-
- bool isBigEndian();
- bool isLittleEndian();
}
#endif
diff --git a/reader/reader.h b/reader/reader.h
index b7becc0cef671b24d3d4cd968f628d8323dc2396..eb593b5859c074ea74410895d5da467668720164 100644 (file)
--- a/reader/reader.h
+++ b/reader/reader.h
* 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
diff --git a/reader/util.cc b/reader/util.cc
index 31befb7d1905e98f126ce3d7bbc2b1e54118d38d..76cd6af8efc712725939a11fd0df084151e79c93 100644 (file)
--- a/reader/util.cc
+++ b/reader/util.cc
-#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];
return test.c[0] == 1;
}
- bool isLittleEndian() {
+ bool Reader::isLittleEndian() {
return !isBigEndian();
}
}