]> Creatis software - gdcm.git/blobdiff - src/gdcmVR.cxx
COMP: Attempt to fix jpr code
[gdcm.git] / src / gdcmVR.cxx
index 0ac11a47c5bd720f8632ef5953547b9a8bd2897a..9f1477a2c8d5714142141056246223d4096a77e9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/07/06 16:57:06 $
-  Version:   $Revision: 1.50 $
+  Date:      $Date: 2006/08/18 16:03:46 $
+  Version:   $Revision: 1.52 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -71,6 +71,7 @@ VR::VR()
       }
       from.close();
    }
+   char *VRvalues = "AEASCSDADSFLFDISLOLTPNSHSLSSSTTMUIULUSUTOBOWOFATUNSQ";
 }
 
 /**
@@ -108,7 +109,6 @@ bool VR::IsVROfBinaryRepresentable(VRKey const &tested)
  */
 bool VR::IsVROfStringRepresentable(VRKey const &tested)
 {
-
    return tested == "AE" ||
           tested == "AS" ||
           tested == "CS" ||
@@ -168,9 +168,20 @@ unsigned short VR::GetAtomicElementLength(VRKey const &tested)
 // VS6 need a single implementation in the dll
 #if defined(_MSC_VER) && (_MSC_VER == 1200)
 /// \brief checks is a supposed-to-be VR is a 'legal' one.
-bool VR::IsValidVR(VRKey const &key)
+bool VR::IsValidVR(VRKey const &tested)
 {
-  return vr.find(key) != vr.end();
+//  return vr.find(key) != vr.end();
+
+  int nbVal=26;
+  char *pt = VRvalues;
+  for (int i=0;i<nbVal;i++)
+  {
+     if(tested[0] == *pt++)
+       if(tested[1] == *pt++)
+          return true;       
+  }
+  return false;
+
 }
 #endif