]> Creatis software - gdcm.git/blobdiff - Testing/TestAllEntryVerify.cxx
Fix mistypings
[gdcm.git] / Testing / TestAllEntryVerify.cxx
index 7f7937c52c34c5cbb2f85dce9b9001cd783ca6ef..8ecd4072e5a33c7a7cf08193ae0f3c48ce15095f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestAllEntryVerify.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:05:26 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2008/09/15 15:49:20 $
+  Version:   $Revision: 1.30 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #include <iostream>
 #include <sstream>
 
-//Generated file:
-#include "gdcmDataImages.h"
-
-typedef std::string EntryValueType;   // same type as ValEntry::value
-typedef std::map< gdcm::TagKey, EntryValueType > MapEntryValues;
+typedef std::string EntryValueType;   // same type as DataEntry::value
+typedef std::map< GDCM_NAME_SPACE::TagKey, EntryValueType > MapEntryValues;
 typedef MapEntryValues *MapEntryValuesPtr;
 typedef std::string FileNameType;
 typedef std::map< FileNameType, MapEntryValuesPtr > MapFileValuesType;
@@ -54,7 +51,7 @@ public:
    ReferenceFileParser();
    ~ReferenceFileParser();
 
-   bool Open( std::stringreferenceFileName );
+   bool Open( std::string &referenceFileName );
    void Print();
    void SetDataPath(std::string&);
    bool Check();
@@ -63,7 +60,7 @@ public:
 private:
    bool AddKeyValuePairToMap( std::string &key, std::string &value );
 
-   std::istreameatwhite(std::istream &is);
+   std::istream &eatwhite(std::istream &is);
    void eatwhite(std::string &toClean);
    std::string ExtractFirstString(std::string &toSplit);
    void CleanUpLine( std::string &line );
@@ -117,13 +114,13 @@ ReferenceFileParser::~ReferenceFileParser()
 {
    for (MapFileValuesType::iterator i  = ProducedMap.begin();
                                     i != ProducedMap.end();
-                                    ++i)
+                                  ++i)
    {
       delete i->second;
    }
 }
 
-/// As gotten from:
+/// As got from:
 /// http://community.borland.com/article/0,1410,17203,0.html
 uint16_t ReferenceFileParser::axtoi(char *hexStg) 
 {
@@ -157,7 +154,7 @@ uint16_t ReferenceFileParser::axtoi(char *hexStg)
       m--;   // adjust the position to set
       n++;   // next digit to process
    }
-   return intValue;
+   return (uint16_t)intValue;
 }
 
 void ReferenceFileParser::SetDataPath( std::string &inDataPath )
@@ -181,16 +178,16 @@ void ReferenceFileParser::Print()
 {
    for (MapFileValuesType::iterator i  = ProducedMap.begin();
                                     i != ProducedMap.end();
-                                    ++i)
+                                  ++i)
    {
       std::cout << Indent << "FileName: " << i->first << std::endl;
       MapEntryValuesPtr KeyValues = i->second;
       for (MapEntryValues::iterator j  = KeyValues->begin();
                                     j != KeyValues->end();
-                                    ++j)
+                                  ++j)
       {
          std::cout << Indent
-              << "  Key: " << j->first
+              << "  Key: "   << j->first
               << "  Value: " << j->second
               << std::endl;
       }
@@ -204,7 +201,7 @@ bool ReferenceFileParser::Check()
    bool ret = true;
    for (MapFileValuesType::iterator i  = ProducedMap.begin();
                                     i != ProducedMap.end();
-                                    ++i)
+                                  ++i)
    {
       ret &= Check(i);
    }
@@ -229,7 +226,11 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt )
 {
    std::string fileName = DataPath + fileIt->first;
    std::cout << Indent << "FileName: " << fileName << std::endl;
-   gdcm::File* tested = new gdcm::File( fileName.c_str() );
+   
+   GDCM_NAME_SPACE::File *tested;
+   tested = new GDCM_NAME_SPACE::File( );
+   tested->SetFileName( fileName.c_str() );
+   tested->Load( );
    if( !tested->IsReadable() )
    {
      std::cerr << Indent << "Failed\n"
@@ -242,7 +243,7 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt )
    MapEntryValuesPtr KeyValues = fileIt->second;
    for (MapEntryValues::iterator j  = KeyValues->begin();
                                  j != KeyValues->end();
-                                 ++j)
+                               ++j)
    {
       std::string key = j->first;
 
@@ -289,7 +290,7 @@ std::istream &ReferenceFileParser::eatwhite( std::istream &is )
    return is;
 }
 
-void ReferenceFileParser::eatwhite( std::stringtoClean )
+void ReferenceFileParser::eatwhite( std::string &toClean )
 {
    while( toClean.find_first_of( " " ) == 0  )
       toClean.erase( 0, toClean.find_first_of( " " ) + 1 );
@@ -598,7 +599,7 @@ void ReferenceFileParser::ParseRegularLine( std::string &line)
 bool ReferenceFileParser::SecondPassReferenceFile()
    throw ( ParserException )
 {
-   gdcm::TagKey key;
+   GDCM_NAME_SPACE::TagKey key;
    EntryValueType value;
    std::string line;
    bool inBlock = false;