/*========================================================================= Program: gdcm Module: $RCSfile: gdcmVR.cxx,v $ Language: C++ Date: $Date: 2004/07/02 13:55:28 $ Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include #include #include "gdcmVR.h" #include "gdcmUtil.h" #include "gdcmDictSet.h" #include "gdcmDebug.h" //----------------------------------------------------------------------------- /** * \brief Constructor */ gdcmVR::gdcmVR(void) { std::string filename=gdcmDictSet::BuildDictPath() + std::string(DICT_VR); std::ifstream from(filename.c_str()); dbg.Error(!from, "gdcmVR::gdcmVR: can't open dictionary",filename.c_str()); char buff[1024]; std::string key; std::string name; while (!from.eof()) { eatwhite(from); from.getline(buff, 1024, ' '); key = buff; eatwhite(from); from.getline(buff, 1024, ';'); name = buff; eatwhite(from); from.getline(buff, 1024, '\n'); if(key!="") { vr[key]=name; } } from.close(); } /** * \brief Destructor */ gdcmVR::~gdcmVR() { vr.clear(); } //----------------------------------------------------------------------------- // Print /** * \brief Print all * @param os The output stream to be written to. */ void gdcmVR::Print(std::ostream &os) { std::ostringstream s; for (gdcmVRHT::iterator it = vr.begin(); it != vr.end(); ++it) { s << "VR : "<first<<" = "<second<