Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

gdcmTS Class Reference

#include <gdcmTS.h>

List of all members.

Public Member Functions

 gdcmTS (void)
 ~gdcmTS ()
void Print (std::ostream &os=std::cout)
 Print all.

int Count (TSKey key)
std::string GetValue (TSKey key)

Private Attributes

TSHT ts


Constructor & Destructor Documentation

gdcmTS::gdcmTS void   ) 
 

Definition at line 23 of file gdcmTS.cxx.

References gdcmDictSet::BuildDictPath(), dbg, DICT_TS, eatwhite(), gdcmDebug::Error(), and ts.

00024 {
00025    std::string filename=gdcmDictSet::BuildDictPath() + std::string(DICT_TS);
00026    std::ifstream from(filename.c_str());
00027    dbg.Error(!from, "gdcmTS::gdcmTS: can't open dictionary",filename.c_str());
00028 
00029    char buff[1024];
00030    std::string key;
00031    std::string name;
00032 
00033    while (!from.eof()) {
00034       eatwhite(from);
00035       from.getline(buff, 1024, ' ');
00036       key = buff;
00037 
00038       eatwhite(from);
00039       from.getline(buff, 1024, '\n');
00040       name = buff;
00041 
00042       if(key!="") 
00043       {
00044          ts[key]=name;
00045       }
00046    }
00047    from.close();
00048 }

gdcmTS::~gdcmTS  ) 
 

Definition at line 50 of file gdcmTS.cxx.

References ts.

00051 {
00052    ts.clear();
00053 }


Member Function Documentation

int gdcmTS::Count TSKey  key  ) 
 

Definition at line 75 of file gdcmTS.cxx.

References ts, and TSKey.

00076 {
00077    return ts.count(key);
00078 }

std::string gdcmTS::GetValue TSKey  key  ) 
 

Definition at line 80 of file gdcmTS.cxx.

References GDCM_UNFOUND, ts, and TSKey.

Referenced by gdcmHeader::GetTransfertSyntaxName(), and gdcmHeaderEntry::Print().

00081 {
00082    if (ts.count(key) == 0) 
00083       return (GDCM_UNFOUND);
00084    return ts[key];
00085 }

void gdcmTS::Print std::ostream &  os = std::cout  ) 
 

Print all.

Parameters:
os The output stream to be written to.

Definition at line 62 of file gdcmTS.cxx.

References ts.

00063 {
00064    std::ostringstream s;
00065 
00066    for (TSHT::iterator it = ts.begin(); it != ts.end(); ++it)
00067    {
00068       s << "TS : "<<it->first<<" = "<<it->second<<std::endl;
00069    }
00070    os << s.str();
00071 }


Member Data Documentation

TSHT gdcmTS::ts [private]
 

Definition at line 32 of file gdcmTS.h.

Referenced by Count(), gdcmTS(), GetValue(), Print(), and ~gdcmTS().


The documentation for this class was generated from the following files:
Generated on Mon Feb 14 16:13:40 2005 for gdcm by doxygen 1.3.6