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

gdcmVR Class Reference

#include <gdcmVR.h>

List of all members.

Public Member Functions

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

int Count (VRKey key)
 Get the count for an element.


Private Attributes

VRHT vr


Constructor & Destructor Documentation

gdcmVR::gdcmVR void   ) 
 

Definition at line 22 of file gdcmVR.cxx.

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

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

gdcmVR::~gdcmVR  ) 
 

Definition at line 52 of file gdcmVR.cxx.

00052                 {
00053    vr.clear();
00054 }


Member Function Documentation

int gdcmVR::Count VRKey  key  ) 
 

Get the count for an element.

Parameters:
key key to count

Definition at line 81 of file gdcmVR.cxx.

References VRKey.

Referenced by gdcmParser::CheckHeaderEntryVR().

00082 {
00083    return vr.count(key);
00084 }

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

Print all.

Parameters:
os The output stream to be written to.

Definition at line 63 of file gdcmVR.cxx.

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


Member Data Documentation

VRHT gdcmVR::vr [private]
 

Definition at line 32 of file gdcmVR.h.


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