X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmVRKey.h;h=c192735bf6ee0ab561fbbd277cb16e1429f9b178;hb=df832cf7f90b4ca5aca2f628c1756fb276779fac;hp=069cbe353cb74541362c6140e7110aed1b1403e0;hpb=5507525c9f8cfcab45e7f9ad684a4a825ec86b16;p=gdcm.git diff --git a/src/gdcmVRKey.h b/src/gdcmVRKey.h index 069cbe35..c192735b 100644 --- a/src/gdcmVRKey.h +++ b/src/gdcmVRKey.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmVRKey.h,v $ Language: C++ - Date: $Date: 2006/05/15 14:47:13 $ - Version: $Revision: 1.6 $ + Date: $Date: 2008/01/02 10:48:52 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,8 +16,8 @@ =========================================================================*/ -#ifndef GDCMVRKEY_H -#define GDCMVRKEY_H +#ifndef _GDCMVRKEY_H_ +#define _GDCMVRKEY_H_ #include "gdcmCommon.h" @@ -25,7 +25,7 @@ #include // important #include -namespace gdcm +namespace GDCM_NAME_SPACE { //----------------------------------------------------------------------------- class VRKey @@ -107,6 +107,23 @@ public : return key[0] < _val[0] || (key[0] == _val[0] && key[1] < _val[1]); } + inline std::string GetHexaRepresentation() + { + // We could probabelly write something much more complicated using C++ features ! + // (I really want HexaRepresentation as xx|xx, not ffffffxx|ffffffxx !) + char vr_char[6]; + char buf[5]; + sprintf(buf, "%04x",( unsigned short int)key[0]); + vr_char[0] = buf[2]; + vr_char[1] = buf[3]; + sprintf(buf, "%04x",( unsigned short int)key[1]); + vr_char[2] = '|'; + vr_char[3] = buf[2]; + vr_char[4] = buf[3]; + vr_char[5] = '\0'; + return(vr_char); + } + private : char key[2]; };