Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2004/12/13 15:12:33 $
- Version: $Revision: 1.70 $
+ Date: $Date: 2005/01/05 15:19:42 $
+ Version: $Revision: 1.71 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return s1_even == s2_even;
}
+
+
+/**
+ * \ingroup Util
+ * \brief tells us if the processor we are working with is BigEndian or not
+ */
+bool Util::IsCurrentProcessorBigEndian()
+{
+ uint16_t intVal = 1;
+ uint8_t bigEndianRepr[4] = { 0x00, 0x00, 0x00, 0x01 };
+ int res = memcmp(reinterpret_cast<const void*>(&intVal),
+ reinterpret_cast<const void*>(bigEndianRepr), 4);
+ if (res == 0)
+ return true;
+ else
+ return false;
+}
+
+
/**
* \ingroup Util
* \brief Return the IP adress of the machine writting the DICOM image
Program: gdcm
Module: $RCSfile: gdcmUtil.h,v $
Language: C++
- Date: $Date: 2004/11/16 05:03:35 $
- Version: $Revision: 1.45 $
+ Date: $Date: 2005/01/05 15:19:42 $
+ Version: $Revision: 1.46 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static std::string DicomString(const char* s);
static bool DicomStringEqual(const std::string& s1, const char *s2);
static std::string CreateUniqueUID(const std::string& root = "");
+ static bool IsCurrentProcessorBigEndian();
private:
static std::string GetIPAddress(); //Do not expose this method