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

gdcmUtil.cxx File Reference

#include "gdcmUtil.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>

Go to the source code of this file.

Functions

std::istream & eatwhite (std::istream &is)
void Tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters)
char * _cleanString (char *v)
std::string _CreateCleanString (std::string s)

Variables

gdcmDebug dbg
gdcmGlobal gdcmGlob


Function Documentation

char* _cleanString char *  v  ) 
 

Definition at line 123 of file gdcmUtil.cxx.

00123                             {
00124    char *d;
00125    int i, l;
00126    l = strlen(v);
00127    for (i=0,d=v; 
00128       i<l ; 
00129       i++,d++) {
00130          if (!isprint(*d))
00131          *d = '.';
00132    }    
00133    return v;
00134 }

std::string _CreateCleanString std::string  s  ) 
 

Definition at line 139 of file gdcmUtil.cxx.

Referenced by gdcmHeaderEntry::Print().

00139                                           {
00140    std::string str=s;
00141 
00142    for(int i=0;i<str.size();i++)
00143    {
00144       if(!isprint(str[i]))
00145          str[i]='.';
00146    }
00147 
00148 
00149    if(str.size()>0)
00150       if(!isprint(s[str.size()-1]))
00151          if(s[str.size()-1]==0)
00152             str[str.size()-1]=' ';
00153 
00154    return(str);
00155 }

std::istream& eatwhite std::istream &  is  ) 
 

Definition at line 95 of file gdcmUtil.cxx.

Referenced by gdcmDicomDirElement::gdcmDicomDirElement(), gdcmDict::gdcmDict(), gdcmTS::gdcmTS(), and gdcmVR::gdcmVR().

00095                                      {
00096    char c;
00097    while (is.get(c)) {
00098       if (!isspace(c)) {
00099          is.putback(c);
00100          break;
00101       }
00102    }
00103    return is;
00104 }

void Tokenize const std::string &  str,
std::vector< std::string > &  tokens,
const std::string &  delimiters
 

Definition at line 108 of file gdcmUtil.cxx.

Referenced by gdcmParser::GetHeaderEntryUnvalue(), gdcmHeader::GetLUTNbits(), gdcmHeader::GetLUTRGBA(), and gdcmParser::WriteEntries().

00110                                             {
00111    std::string::size_type lastPos = str.find_first_not_of(delimiters,0);
00112    std::string::size_type pos     = str.find_first_of    (delimiters,lastPos);
00113    while (std::string::npos != pos || std::string::npos != lastPos) {
00114       tokens.push_back(str.substr(lastPos, pos - lastPos));
00115       lastPos = str.find_first_not_of(delimiters, pos);
00116       pos     = str.find_first_of    (delimiters, lastPos);
00117    }
00118 }


Variable Documentation

gdcmDebug dbg
 

Definition at line 11 of file gdcmUtil.cxx.

Referenced by gdcmDict::AddNewEntry(), gdcmDictSet::BuildDictPath(), gdcmParser::CheckHeaderEntryVR(), gdcmParser::CheckSwap(), gdcmParser::FindHeaderEntryLength(), gdcmParser::FindHeaderEntryLengthOB(), gdcmParser::FixHeaderEntryFoundLength(), gdcmDicomDir::gdcmDicomDir(), gdcmDicomDirElement::gdcmDicomDirElement(), gdcmDict::gdcmDict(), gdcmGlobal::gdcmGlobal(), gdcmObject::gdcmObject(), gdcmTS::gdcmTS(), gdcmVR::gdcmVR(), gdcmParser::GetDictEntryByName(), gdcmParser::GetDictEntryByNumber(), gdcmParser::GetEntryOffsetByNumber(), gdcmParser::GetEntryVoidAreaByNumber(), gdcmFile::GetImageDataIntoVectorRaw(), gdcmHeaderHelper::GetImageOrientationPatient(), gdcmHeaderHelper::GetPixelSize(), gdcmHeader::GetPixelSize(), gdcmHeaderHelper::GetPixelType(), gdcmHeader::GetPixelType(), gdcmHeaderHelper::GetRescaleIntercept(), gdcmHeaderHelper::GetRescaleSlope(), gdcmHeader::GetTransfertSyntaxName(), gdcmHeaderHelper::GetXOrigin(), gdcmHeaderHelper::GetXSpacing(), gdcmHeaderHelper::GetYOrigin(), gdcmHeaderHelper::GetYSpacing(), gdcmHeaderHelper::GetZOrigin(), gdcmHeaderHelper::GetZSpacing(), gdcmParser::LoadHeaderEntry(), gdcmParser::NewHeaderEntryByName(), gdcmParser::NewHeaderEntryByNumber(), gdcmParser::OpenFile(), gdcmParser::ReadInt16(), gdcmParser::ReadInt32(), gdcmDict::RemoveEntry(), gdcmDicomDir::SetElement(), gdcmDictEntry::SetVR(), gdcmParser::SwapLong(), and gdcmParser::SwitchSwapToBigEndian().

gdcmGlobal gdcmGlob
 

Definition at line 59 of file gdcmUtil.cxx.


Generated on Mon Feb 14 16:13:37 2005 for gdcm by doxygen 1.3.6