]> Creatis software - gdcm.git/commitdiff
ENH: Exact same fix as gdcmTS
authormalaterre <malaterre>
Wed, 27 Oct 2004 21:28:56 +0000 (21:28 +0000)
committermalaterre <malaterre>
Wed, 27 Oct 2004 21:28:56 +0000 (21:28 +0000)
src/gdcmVR.cxx
src/gdcmVR.h

index b45fbbb667d92a5066785bf53ad748a3d5360a50..12d8a5cbae306d4915e9de5814d735237f60613f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/12 04:35:48 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2004/10/27 21:28:56 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 /**
  * \brief Constructor
  */
 VR::VR() 
 {
-   std::string filename=DictSet::BuildDictPath() + std::string(DICT_VR);
+   std::string filename = DictSet::BuildDictPath() + DICT_VR;
    std::ifstream from(filename.c_str());
-   dbg.Error(!from, "VR::VR: can't open dictionary",filename.c_str());
+   dbg.Error(!from, "VR::VR: can't open dictionary", filename.c_str());
 
    char buff[1024];
-   std::string key;
-   std::string name;
+   VRKey key;
+   VRAtr name;
 
    while (!from.eof()) 
    {
-      from >> std::ws; // used to be eatwhite(from);
+      from >> std::ws;
       from.getline(buff, 1024, ' ');
       key = buff;
-      from >> std::ws; // used to be eatwhite(from);
+      from >> std::ws;
       from.getline(buff, 1024, ';');
       name = buff;
 
-      from >> std::ws; // used to be eatwhite(from);
+      from >> std::ws;
       from.getline(buff, 1024, '\n');
 
-      if(key!="")
+      if(key != "")
       {
          vr[key]=name;
       }
@@ -82,7 +81,7 @@ void VR::Print(std::ostream &os)
 
    for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it)
    {
-      s << "VR : "<<it->first<<" = "<<it->second<<std::endl;
+      s << "VR : " << it->first << " = " << it->second << std::endl;
    }
    os << s.str();
 }
@@ -93,7 +92,7 @@ void VR::Print(std::ostream &os)
  * \brief   Get the count for an element
  * @param   key key to count
  */
-int VR::Count(VRKey key) 
+int VR::Count(VRKey const & key) 
 {
    return vr.count(key);
 }
@@ -106,7 +105,7 @@ int VR::Count(VRKey key)
  *          \ref VR::IsVROfGdcmStringRepresentable .
  * @param   tested value representation to check for.
  */
-bool VR::IsVROfGdcmBinaryRepresentable(VRKey tested)
+bool VR::IsVROfGdcmBinaryRepresentable(VRKey const & tested)
 {
    //std::cout << "VR::IsVROfGdcmBinaryRepresentable===================="
    //   << tested << std::endl;
@@ -136,7 +135,7 @@ bool VR::IsVROfGdcmBinaryRepresentable(VRKey tested)
  *          but NOT a \ref BinEntry.
  * @param   tested value representation to check for.
  */
-bool VR::IsVROfGdcmStringRepresentable(VRKey tested)
+bool VR::IsVROfGdcmStringRepresentable(VRKey const & tested)
 {
 
    if ( ! Count(tested) )
index 6faad96a7945a91aa29bfda8294f8f4c1f6c6a61..78eba77999fe5d5fd795cd3b9c12d05dc9a4ad32 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/12 04:35:48 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2004/10/27 21:28:56 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -44,9 +44,9 @@ public:
    ~VR();
 
    void Print(std::ostream &os = std::cout);
-   int Count(VRKey key);
-   bool IsVROfGdcmBinaryRepresentable(VRKey);
-   bool IsVROfGdcmStringRepresentable(VRKey);
+   int Count(VRKey const & key);
+   bool IsVROfGdcmBinaryRepresentable(VRKey const & tested);
+   bool IsVROfGdcmStringRepresentable(VRKey const & tested);
 
 private:
    VRHT vr;