#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 |
|
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 } |
|
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 } |
|
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 } |
|
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 }
|
|
|
Definition at line 59 of file gdcmUtil.cxx. |