1 /*=========================================================================
4 Module: $RCSfile: gdcmTS.cxx,v $
6 Date: $Date: 2004/11/03 18:08:56 $
7 Version: $Revision: 1.28 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 #include "gdcmDebug.h"
22 #include "gdcmDictSet.h"
30 void FillDefaultTSDict(TSHT & ts);
31 //-----------------------------------------------------------------------------
32 // Constructor / Destructor
35 std::string filename = DictSet::BuildDictPath() + DICT_TS;
36 std::ifstream from(filename.c_str());
39 dbg.Verbose(2, "TS::TS: can't open dictionary", filename.c_str());
40 FillDefaultTSDict( TsMap );
51 std::getline(from, name);
62 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
73 * @param os The output stream to be written to.
75 void TS::Print(std::ostream &os)
79 for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
81 s << "TS : " << it->first << " = " << it->second << std::endl;
86 //-----------------------------------------------------------------------------
88 int TS::Count(TSKey const & key)
90 return TsMap.count(key);
93 TSAtr const & TS::GetValue(TSKey const & key)
95 TSHT::const_iterator it = TsMap.find(key);
96 if (it == TsMap.end())
103 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
111 } // end namespace gdcm