]> Creatis software - gdcm.git/blobdiff - src/gdcmUtil.cxx
Add empty gdcmJpeg2000.cxx, ready for the future
[gdcm.git] / src / gdcmUtil.cxx
index bc1d3bdae546ce772c25bf53f3d867116920dceb..5cb02ac3ebb4f96ad0e092b8974388ed7e4ad1f7 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/gdcmUtil.cxx,v 1.12 2003/06/17 17:44:48 jpr Exp $
+// $Header: /cvs/public/gdcm/src/gdcmUtil.cxx,v 1.15 2003/07/01 15:48:27 jpr Exp $
 
 #include <stdio.h>
 #include <ctype.h>   // For isspace
@@ -16,23 +16,15 @@ gdcmDebug::gdcmDebug(int level) {
 void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
    if (Level > DebugLevel)
       return ;
-   cerr << Msg1 << ' ' << Msg2 << '\n';
-}
-
-/*
-void gdcmDebug::Verbose(int Level, char * Msg1, char * Msg2) {
-   if (Level > DebugLevel)
-      return ;
-   cerr << Msg1 << ' ' << Msg2 << '\n';
+   std::cerr << Msg1 << ' ' << Msg2 << '\n';
 }
-*/
 
 void gdcmDebug::Assert(int Level, bool Test,
                  const char * Msg1, const char * Msg2) {
    if (Level > DebugLevel)
       return ;
    if (!Test)
-      cerr << Msg1 << ' ' << Msg2 << '\n';
+      std::cerr << Msg1 << ' ' << Msg2 << '\n';
 }
 
 void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
@@ -65,7 +57,7 @@ gdcmGlobal gdcmGlob;
 
 gdcmGlobal::gdcmGlobal(void) {
    if (VR || TS || Dicts)
-      dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts allready allocated");
+      dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts already allocated");
    VR = new gdcmVR();
    TS = new gdcmTS();
    Dicts = new gdcmDictSet();
@@ -152,3 +144,20 @@ char * _CreateCleanString(string s) {
    return d;
 }
 
+///////////////////////////////////////////////////////////////////////////
+//
+// because it may not be associated to a dictionary ...
+
+std::string TranslateToKey(guint16 group, guint16 element) {
+       char trash[10];
+       string key;
+       // CLEAN ME: better call the iostream<< with the hex manipulator on.
+       // This requires some reading of the stdlibC++ sources to make the
+       // proper call (or copy).
+       sprintf(trash, "%04x|%04x", group , element);
+       key = trash;  // Convertion through assignement
+       return key;
+}
+
+
+