45 #include "parseXmlString.hh"
46 #include "stdb_streams.h"
52 parseXmlString::getString(
char* line,
char* key1,
char* key2){
58 int i1 = getIndexAfter(line, key1);
60 int i2 = getIndexBefore(line, key2);
66 cerr <<
" Missing Key " << endl;
70 for (
int i=0; i<i1-1; i++)p++;
72 p1 =
new char[size+1];
77 char* retVal = removeBlankEnds(p1);
86 parseXmlString::getStringAfter(
char* line,
char* key){
88 int i = getIndexAfter(line,key);
98 tmp =
new char[size+1];
102 char* retVal = removeBlankEnds(tmp);
112 parseXmlString::getStringBefore(
char* line,
char* key){
114 int i = getIndexBefore(line,key);
120 tmp =
new char[size+1];
121 strncpy(tmp,p1,size);
124 char* retVal = removeBlankEnds(tmp);
133 parseXmlString::getIndexAfter(
char* line,
char* key){
135 if(!line || !key)
return 0;
136 char*
id = strstr(line,key);
147 parseXmlString::getIndexBefore(
char* line,
char* key){
149 if(!line || !key)
return 0;
150 char*
id = strstr(line,key);
160 parseXmlString::removeBlankEnds(
char* line){
163 int k = strlen(line);
167 if(line[i]!=
' ')
break;
172 if(line[j]==
'\0')
continue;
173 if(line[j]!=
' ')
break;
177 char* tmp =
new char[size+1];
178 strncpy(tmp,p1,size);