/*========================================================================= Program: gdcm Module: $RCSfile: gdcmVR.cxx,v $ Language: C++ Date: $Date: 2004/10/12 04:35:48 $ Version: $Revision: 1.19 $ 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.html 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 "gdcmVR.h" #include "gdcmUtil.h" #include "gdcmDictSet.h" #include "gdcmDebug.h" #include #include namespace gdcm { //----------------------------------------------------------------------------- /** * \brief Constructor */ VR::VR() { std::string filename=DictSet::BuildDictPath() + std::string(DICT_VR); std::ifstream from(filename.c_str()); dbg.Error(!from, "VR::VR: can't open dictionary",filename.c_str()); char buff[1024]; std::string key; std::string name; while (!from.eof()) { from >> std::ws; // used to be eatwhite(from); from.getline(buff, 1024, ' '); key = buff; from >> std::ws; // used to be eatwhite(from); from.getline(buff, 1024, ';'); name = buff; from >> std::ws; // used to be eatwhite(from); from.getline(buff, 1024, '\n'); if(key!="") { vr[key]=name; } } from.close(); } //----------------------------------------------------------------------------- /** * \brief Destructor */ VR::~VR() { vr.clear(); } //----------------------------------------------------------------------------- // Print /** * \brief Print all * @param os The output stream to be written to. */ void VR::Print(std::ostream &os) { std::ostringstream s; for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it) { s << "VR : "<first<<" = "<second<