Program: gdcm
Module: $RCSfile: TestAllEntryVerify.cxx,v $
Language: C++
- Date: $Date: 2005/01/27 10:47:29 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::string EntryValueType; // same type as ValEntry::value
typedef std::map< gdcm::TagKey, EntryValueType > MapEntryValues;
-typedef MapEntryValues* MapEntryValuesPtr;
+typedef MapEntryValues *MapEntryValuesPtr;
typedef std::string FileNameType;
typedef std::map< FileNameType, MapEntryValuesPtr > MapFileValuesType;
bool Check( std::string fileName );
private:
- bool AddKeyValuePairToMap( std::string& key, std::string& value );
+ bool AddKeyValuePairToMap( std::string &key, std::string &value );
- std::istream& eatwhite(std::istream& is);
- void eatwhite(std::string& toClean);
- std::string ExtractFirstString(std::string& toSplit);
- void CleanUpLine( std::string& line );
+ std::istream& eatwhite(std::istream &is);
+ void eatwhite(std::string &toClean);
+ std::string ExtractFirstString(std::string &toSplit);
+ void CleanUpLine( std::string &line );
bool Check( MapFileValuesType::iterator &fileIt );
- std::string ExtractValue(std::string& toSplit) throw ( ParserException );
- void ParseRegularLine( std::string& line ) throw ( ParserException );
+ std::string ExtractValue(std::string &toSplit) throw ( ParserException );
+ void ParseRegularLine( std::string &line ) throw ( ParserException );
void FirstPassReferenceFile() throw ( ParserException );
bool SecondPassReferenceFile() throw ( ParserException );
- void HandleFileName( std::string& line ) throw ( ParserException );
- void HandleKey( std::string& line ) throw ( ParserException );
- bool HandleValue( std::string& line ) throw ( ParserException );
+ void HandleFileName( std::string &line ) throw ( ParserException );
+ void HandleKey( std::string &line ) throw ( ParserException );
+ bool HandleValue( std::string &line ) throw ( ParserException );
static uint16_t axtoi( char* );
private:
std::string CurrentValue;
/// The current MapEntryValues pointer:
- MapEntryValues* CurrentMapEntryValuesPtr;
+ MapEntryValues *CurrentMapEntryValuesPtr;
};
ReferenceFileParser::ReferenceFileParser()
return intValue;
}
-void ReferenceFileParser::SetDataPath( std::string& inDataPath )
+void ReferenceFileParser::SetDataPath( std::string &inDataPath )
{
DataPath = inDataPath;
}
-bool ReferenceFileParser::AddKeyValuePairToMap( std::string& key,
- std::string& value )
+bool ReferenceFileParser::AddKeyValuePairToMap( std::string &key,
+ std::string &value )
{
if ( !CurrentMapEntryValuesPtr )
return false;
return true;
}
-std::istream& ReferenceFileParser::eatwhite( std::istream& is )
+std::istream &ReferenceFileParser::eatwhite( std::istream &is )
{
char c;
while (is.get(c)) {
toClean.erase( 0, toClean.find_first_of( " " ) + 1 );
}
-std::string ReferenceFileParser::ExtractFirstString( std::string& toSplit )
+std::string ReferenceFileParser::ExtractFirstString( std::string &toSplit )
{
std::string firstString;
eatwhite( toSplit );
return firstString;
}
-std::string ReferenceFileParser::ExtractValue( std::string& toSplit )
+std::string ReferenceFileParser::ExtractValue( std::string &toSplit )
throw ( ParserException )
{
eatwhite( toSplit );
from.seekg( 0, std::ios::beg );
}
-bool ReferenceFileParser::Open( std::string& referenceFileName )
+bool ReferenceFileParser::Open( std::string &referenceFileName )
{
from.open( referenceFileName.c_str(), std::ios::in );
if ( !from.is_open() )
return true; //??
}
-void ReferenceFileParser::CleanUpLine( std::string& line )
+void ReferenceFileParser::CleanUpLine( std::string &line )
{
// Cleanup from comments:
if ( line.find_first_of( "#" ) != std::string::npos )
eatwhite( line );
}
-void ReferenceFileParser::HandleFileName( std::string& line )
+void ReferenceFileParser::HandleFileName( std::string &line )
throw ( ParserException )
{
if ( line.length() == 0 )
CurrentFileName = ExtractFirstString(line);
}
-void ReferenceFileParser::HandleKey( std::string& line )
+void ReferenceFileParser::HandleKey( std::string &line )
throw ( ParserException )
{
if ( CurrentKey.length() != 0 )
}
}
-bool ReferenceFileParser::HandleValue( std::string& line )
+bool ReferenceFileParser::HandleValue( std::string &line )
throw ( ParserException )
{
if ( line.length() == 0 )
return true;
}
-void ReferenceFileParser::ParseRegularLine( std::string& line)
+void ReferenceFileParser::ParseRegularLine( std::string &line)
throw ( ParserException )
{
if ( line.length() == 0 )
return true; //??
}
-int TestAllEntryVerify(int argc, char* argv[])
+int TestAllEntryVerify(int argc, char *argv[])
{
if ( argc > 2 )
{