a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
BOL::AsciiXmlParser Class Reference

#include <AsciiXmlParser.hpp>

Detailed Description

Definition at line 29 of file AsciiXmlParser.hpp.

Public Member Functions

 AsciiXmlParser (bool const isVerbose=false)
 
void closeFile ()
 
bool currentElementNameMatches (std::string const &comparisonString) const
 
std::map< std::string, std::string > const & getCurrentElementAttributes ()
 
std::string const & getCurrentElementContent () const
 
std::string const & getCurrentElementName () const
 
std::string const & getCurrentOpeningTagAsFound () const
 
std::pair< int, int > const & getLineRangeOfCurrentElement () const
 
std::string getTrimmedCurrentElementContent () const
 
bool loadString (std::string const stringToParse)
 
bool openRootElementOfFile (std::string const &fileName)
 
bool readAllOfRootElementOfFile (std::string const &fileName)
 
bool readNextElement ()
 
void returnToBeginningOfText ()
 
 ~AsciiXmlParser ()
 

Protected Member Functions

bool closeMarkup (size_t const startPosition=0)
 
bool compareMarkupEnd (std::string const &comparisonString) const
 
bool compareMarkupStart (std::string const &comparisonString) const
 
bool discardToNextMarkup ()
 
bool discardToNextTag ()
 
bool eraseQuotedStringsInMarkup (size_t const startPosition)
 
bool ignoreDelimited (std::pair< std::string, std::string > const &delimitingStrings)
 
bool parseAttributes ()
 
bool parseTagName (std::string &nameDestination)
 
bool readCharacter ()
 
bool recordDelimited (std::pair< std::string, std::string > const &delimitingStrings)
 
void recordTagTo (std::string &recordingString)
 
bool recordTo (std::string &recordingString, char const endChar)
 
bool recordToEndOfElement ()
 
bool recordToNextMarkup ()
 
bool recordToNextTag ()
 
void resetContent ()
 
bool skipPrologAndOpenRootElement ()
 

Protected Attributes

std::string closingTag
 
int closingTagsToFind
 
std::pair< std::string, std::string > currentAttribute
 
char currentChar
 
char currentQuoteChar
 
std::string currentTagName
 
std::map< std::string, std::string > elementAttributeMap
 
std::pair< int, int > elementLineRange
 
std::string elementName
 
std::ifstream fileParsingStream
 
std::string fullElementContentAsFound
 
std::string fullOpeningTagAsFound
 
bool const isVerbose
 
std::string markupString
 
int newlinesBeforeMarkup
 
size_t parseEnd
 
size_t parseStart
 
size_t previousLength
 
int readNewlines
 
std::map< std::string, std::string > rootAttributeMap
 
std::pair< int, int > rootLineRange
 
std::string rootTag
 
bool streamIsGood
 
std::istringstream stringParsingStream
 
std::istream * textStream
 

Static Protected Attributes

static std::string const allowedXmlQuoteChars
 
static std::string const allowedXmlWhitespaceChars
 
static std::pair< std::string, std::string > const cdataDelimiter
 
static std::pair< std::string, std::string > const commentDelimiter
 
static std::pair< std::string, std::string > const doctypeDelimiter
 
static char const markupCloser
 
static char const markupOpener
 
static std::pair< std::string, std::string > const piDelimiter
 
static char const tagCloser
 

Constructor & Destructor Documentation

◆ AsciiXmlParser()

BOL::AsciiXmlParser::AsciiXmlParser ( bool const  isVerbose = false)

Definition at line 36 of file AsciiXmlParser.cpp.

36 :
41 rootTag( "" ),
43 rootLineRange( -1,
44 -1 ),
45 elementName( "" ),
50 -1 ),
51 markupString( "" ),
52 streamIsGood( false ),
53 currentChar( ' ' ),
54 readNewlines( 0 ),
56 parseStart( 0 ),
57 parseEnd( 0 ),
58 previousLength( 0 ),
59 currentQuoteChar( '\'' ),
61 "" ),
62 closingTag( "" ),
64 currentTagName( "" )
65 {
66 // just an initialization list.
67 }
std::map< std::string, std::string > elementAttributeMap
std::string currentTagName
std::string fullElementContentAsFound
std::ifstream fileParsingStream
std::pair< int, int > rootLineRange
std::string fullOpeningTagAsFound
std::pair< std::string, std::string > currentAttribute
std::istream * textStream
std::istringstream stringParsingStream
std::map< std::string, std::string > rootAttributeMap
std::pair< int, int > elementLineRange

◆ ~AsciiXmlParser()

BOL::AsciiXmlParser::~AsciiXmlParser ( )

Definition at line 69 of file AsciiXmlParser.cpp.

70 {
71 if( fileParsingStream.is_open() )
72 {
73 fileParsingStream.close();
74 }
75 }

Member Function Documentation

◆ closeFile()

void BOL::AsciiXmlParser::closeFile ( )
inline

Definition at line 287 of file AsciiXmlParser.hpp.

289 {
290 if( fileParsingStream.is_open() )
291 {
292 fileParsingStream.close();
293 }
294 fileParsingStream.clear();
296 }

◆ closeMarkup()

bool BOL::AsciiXmlParser::closeMarkup ( size_t const  startPosition = 0)
protected

Definition at line 116 of file AsciiXmlParser.cpp.

125 {
128 &&
130 if( !streamIsGood )
131 {
132 if( isVerbose )
133 {
134 std::cout
135 << std::endl
136 << "BOL::error! AsciiXmlParser::closeMarkup( " << startPosition
137 << " ) could not find the end of a markup!";
138 std::cout << std::endl;
139 }
140 return false;
141 }
143 startPosition );
144 while( std::string::npos != parseStart )
145 {
148 ( parseStart + 1 ) );
149 while( std::string::npos == parseEnd )
150 {
151 markupString.append( 1,
152 markupCloser );
155 markupCloser );
156 if( !streamIsGood )
157 {
158 if( isVerbose )
159 {
160 std::cout
161 << std::endl
162 << "BOL::error! AsciiXmlParser::closeMarkup( " << startPosition
163 << ") could not find the end of a markup!";
164 std::cout << std::endl;
165 }
166 return false;
167 }
170 }
172 ( parseEnd + 1 ) );
173 }
174 return true;
175 }
bool ignoreDelimited(std::pair< std::string, std::string > const &delimitingStrings)
bool recordTo(std::string &recordingString, char const endChar)
static char const markupCloser
static std::string const allowedXmlQuoteChars
static std::pair< std::string, std::string > const commentDelimiter

◆ compareMarkupEnd()

bool BOL::AsciiXmlParser::compareMarkupEnd ( std::string const &  comparisonString) const
inlineprotected

Definition at line 521 of file AsciiXmlParser.hpp.

524 {
525 return ( 0 == comparisonString.compare( 0,
526 ( comparisonString.size() - 1 ),
528 ( markupString.size() - comparisonString.size() + 1 ),
529 ( comparisonString.size() - 1 ) ) );
530 }

◆ compareMarkupStart()

bool BOL::AsciiXmlParser::compareMarkupStart ( std::string const &  comparisonString) const
inlineprotected

Definition at line 508 of file AsciiXmlParser.hpp.

512 {
513 return ( 0 == comparisonString.compare( 1,
514 ( comparisonString.size() - 1 ),
516 0,
517 ( comparisonString.size() - 1 ) ) );
518 }

◆ currentElementNameMatches()

bool BOL::AsciiXmlParser::currentElementNameMatches ( std::string const &  comparisonString) const
inline

Definition at line 331 of file AsciiXmlParser.hpp.

333 {
334 return ( 0 == elementName.compare( comparisonString ) );
335 }

◆ discardToNextMarkup()

bool BOL::AsciiXmlParser::discardToNextMarkup ( )
inlineprotected

Definition at line 429 of file AsciiXmlParser.hpp.

435 {
436 while( readCharacter()
437 &&
439 {
440 // the conditional does the work of reading up to the next tag.
441 }
443 return ( streamIsGood
444 &&
445 closeMarkup() );
446 }
bool closeMarkup(size_t const startPosition=0)
static char const markupOpener

◆ discardToNextTag()

bool BOL::AsciiXmlParser::discardToNextTag ( )
inlineprotected

Definition at line 449 of file AsciiXmlParser.hpp.

452 {
453 markupString.assign( "" );
454 while( markupString.empty() )
455 {
457 &&
459 &&
461 &&
463 if( !streamIsGood )
464 {
465 return false;
466 }
467 }
468 return true;
469 }
static std::pair< std::string, std::string > const piDelimiter
static std::pair< std::string, std::string > const cdataDelimiter

◆ eraseQuotedStringsInMarkup()

bool BOL::AsciiXmlParser::eraseQuotedStringsInMarkup ( size_t const  startPosition)
protected

Definition at line 260 of file AsciiXmlParser.cpp.

265 {
266 // at this point, every opening quote in markupString from startPosition is
267 // matched by a closing quote (properly nested).
269 startPosition );
270 while( std::string::npos != parseStart )
271 {
274 ( parseStart + 1 ) );
276 ( parseEnd - parseStart + 1 ) );
277 // we have to erase the closing quote character as well.
279 parseStart );
280 }
281 // at this point, all quoted strings have been removed from markupString,
282 // & now it ends at the 1st unquoted '>' in the text.
283 return true;
284 }

◆ getCurrentElementAttributes()

std::map< std::string, std::string > const & BOL::AsciiXmlParser::getCurrentElementAttributes ( )
inline

Definition at line 357 of file AsciiXmlParser.hpp.

358 {
359 return elementAttributeMap;
360 }

◆ getCurrentElementContent()

std::string const & BOL::AsciiXmlParser::getCurrentElementContent ( ) const
inline

Definition at line 338 of file AsciiXmlParser.hpp.

339 {
341 }

◆ getCurrentElementName()

std::string const & BOL::AsciiXmlParser::getCurrentElementName ( ) const
inline

Definition at line 325 of file AsciiXmlParser.hpp.

326 {
327 return elementName;
328 }

◆ getCurrentOpeningTagAsFound()

std::string const & BOL::AsciiXmlParser::getCurrentOpeningTagAsFound ( ) const
inline

Definition at line 351 of file AsciiXmlParser.hpp.

352 {
354 }

◆ getLineRangeOfCurrentElement()

std::pair< int, int > const & BOL::AsciiXmlParser::getLineRangeOfCurrentElement ( ) const
inline

Definition at line 363 of file AsciiXmlParser.hpp.

370 {
371 return elementLineRange;
372 }

◆ getTrimmedCurrentElementContent()

std::string BOL::AsciiXmlParser::getTrimmedCurrentElementContent ( ) const
inline

Definition at line 344 of file AsciiXmlParser.hpp.

345 {
348 }
static std::string const allowedXmlWhitespaceChars
static std::string trimFromFrontAndBack(std::string const &stringToTrim, std::string const &charsToTrim=whitespaceAndNewlineChars)

◆ ignoreDelimited()

bool BOL::AsciiXmlParser::ignoreDelimited ( std::pair< std::string, std::string > const &  delimitingStrings)
protected

Definition at line 178 of file AsciiXmlParser.cpp.

186 {
187 if( !(compareMarkupStart( delimitingStrings.first )) )
188 {
189 return true;
190 }
191 while( !(compareMarkupEnd( delimitingStrings.second )) )
192 {
194 markupCloser );
195 if( !streamIsGood )
196 {
197 if( isVerbose )
198 {
199 std::cout
200 << std::endl
201 << "BOL::error! AsciiXmlParser::ignoreDelimited( \""
202 << delimitingStrings.first << ", " << delimitingStrings.second
203 << "\" ) could not find the ending delimiter!";
204 std::cout << std::endl;
205 }
206 return false;
207 }
208 }
209 markupString.assign( "" );
210 return true;
211 }
bool compareMarkupEnd(std::string const &comparisonString) const
bool compareMarkupStart(std::string const &comparisonString) const

◆ loadString()

bool BOL::AsciiXmlParser::loadString ( std::string const  stringToParse)
inline

Definition at line 273 of file AsciiXmlParser.hpp.

278 {
279 resetContent();
280 stringParsingStream.clear();
281 stringParsingStream.str( stringToParse );
283 return stringParsingStream.good();
284 }

◆ openRootElementOfFile()

bool BOL::AsciiXmlParser::openRootElementOfFile ( std::string const &  fileName)

Definition at line 79 of file AsciiXmlParser.cpp.

85 {
86 closeFile();
87 fileParsingStream.open( fileName.c_str() );
88 if( !(fileParsingStream.good()) )
89 {
90 if( isVerbose )
91 {
92 std::cout
93 << std::endl
94 << "BOL::error! AsciiXmlParser::openRootElementOfFile( " << fileName
95 << " ) could not open the file!";
96 std::cout << std::endl;
97 }
98 return false;
99 }
102 if( !streamIsGood
103 &&
104 isVerbose )
105 {
106 std::cout
107 << std::endl
108 << "BOL::error! AsciiXmlParser::openRootElementOfFile( " << fileName
109 << " ) could not find a root element!";
110 std::cout << std::endl;
111 }
112 return streamIsGood;
113 }

◆ parseAttributes()

bool BOL::AsciiXmlParser::parseAttributes ( )
protected

Definition at line 287 of file AsciiXmlParser.cpp.

292 {
293 elementAttributeMap.clear();
295 parseEnd );
296 while( std::string::npos != parseStart )
297 {
298 if( ( ( markupString.size() - 1 ) == parseStart )
299 &&
301 {
302 // if there is only whitespace left in the markup or the indicator of
303 // an empty element, the parsing is done:
304 return true;
305 }
306 // at this point, we have found a new attribute.
307 parseEnd = markupString.find( '=',
308 parseStart );
309 if( std::string::npos == parseEnd )
310 {
311 if( isVerbose )
312 {
313 std::cout
314 << std::endl
315 << "BOL::error! AsciiXmlParser::parseOpeningTag() found an attribute"
316 << " (\"" << markupString.substr( parseStart )
317 << "\") without a value!";
318 std::cout << std::endl;
319 }
320 return false;
321 }
322 currentAttribute.first.assign( markupString.substr( parseStart,
323 ( parseEnd - parseStart ) ) );
325 // this really should be ' or " for valid XML, but we won't bother
326 // checking...
327 parseStart = ( ++parseEnd );
328 // the attribute's value begins after the '=' & the quote character (by
329 // this point, parseEnd has been incremented twice before parseStart gets
330 // set).
332 parseStart );
333 if( std::string::npos == parseEnd )
334 // this shouldn't ever happen, because such cases should have already
335 // been caught by closeMarkup().
336 {
337 if( isVerbose )
338 {
339 std::cout
340 << std::endl
341 << "BOL::error! AsciiXmlParser::parseOpeningTag() found an attribute"
342 << " (\"" << markupString.substr( parseStart )
343 << "\") without a well-formed value (no closing quote mark)!";
344 std::cout << std::endl;
345 }
346 return false;
347 }
348 currentAttribute.second.assign( markupString.substr( parseStart,
349 ( parseEnd - parseStart ) ) );
352 ( ++parseEnd ) );
353 // parseEnd has to be incremented so that parseStart doesn't just sit on
354 // the closing quote.
355 }
356 return true;
357 }
static char const tagCloser

◆ parseTagName()

bool BOL::AsciiXmlParser::parseTagName ( std::string &  nameDestination)
inlineprotected

Definition at line 545 of file AsciiXmlParser.hpp.

548 {
550 if( std::string::npos == parseStart )
551 {
552 // empty markup is a sign of malformed XML:
553 if( isVerbose )
554 {
555 std::cout
556 << std::endl
557 << "BOL::error! AsciiXmlParser::parseOpeningTag(...) found empty"
558 << " markup!";
559 std::cout << std::endl;
560 }
561 return false;
562 }
564 parseStart );
565 nameDestination.assign( markupString.substr( parseStart,
566 ( parseEnd - parseStart ) ) );
567 return true;
568 }

◆ readAllOfRootElementOfFile()

bool BOL::AsciiXmlParser::readAllOfRootElementOfFile ( std::string const &  fileName)
inline

Definition at line 248 of file AsciiXmlParser.hpp.

254 {
255 streamIsGood = ( openRootElementOfFile( fileName )
256 &&
258 if( !streamIsGood
259 &&
260 isVerbose )
261 {
262 std::cout
263 << std::endl
264 << "BOL::error! AsciiXmlParser::readAllOfRootElementOfFile( " << fileName
265 << " ) could not find a well-formed root element!";
266 std::cout << std::endl;
267 }
269 return streamIsGood;
270 }
bool openRootElementOfFile(std::string const &fileName)

◆ readCharacter()

bool BOL::AsciiXmlParser::readCharacter ( )
inlineprotected

Definition at line 394 of file AsciiXmlParser.hpp.

399 {
400 streamIsGood = textStream->get( currentChar ).good();
401 if( streamIsGood
402 &&
403 ( '\n' == currentChar ) )
404 {
405 ++readNewlines;
406 }
407 return streamIsGood;
408 }

◆ readNextElement()

bool BOL::AsciiXmlParser::readNextElement ( )
inline

Definition at line 309 of file AsciiXmlParser.hpp.

314 {
315 return ( discardToNextTag()
316 &&
318 &&
320 &&
322 }
bool parseTagName(std::string &nameDestination)

◆ recordDelimited()

bool BOL::AsciiXmlParser::recordDelimited ( std::pair< std::string, std::string > const &  delimitingStrings)
protected

Definition at line 214 of file AsciiXmlParser.cpp.

225 {
226 if( !(compareMarkupStart( delimitingStrings.first )) )
227 {
228 return true;
229 }
230 while( !(compareMarkupEnd( delimitingStrings.second )) )
231 {
232 markupString.append( 1,
233 markupCloser );
235 markupCloser );
236 if( !streamIsGood )
237 {
238 if( isVerbose )
239 {
240 std::cout
241 << std::endl
242 << "BOL::error! AsciiXmlParser::ignoreDelimited( \""
243 << delimitingStrings.first << ", " << delimitingStrings.second
244 << "\" ) could not find the ending delimiter!";
245 std::cout << std::endl;
246 }
247 return false;
248 }
249 }
251 markupOpener );
254 markupCloser );
255 markupString.assign( "" );
256 return true;
257 }

◆ recordTagTo()

void BOL::AsciiXmlParser::recordTagTo ( std::string &  recordingString)
inlineprotected

Definition at line 533 of file AsciiXmlParser.hpp.

536 {
537 recordingString.append( 1,
538 markupOpener );
539 recordingString.append( markupString );
540 recordingString.append( 1,
541 markupCloser );
542 }

◆ recordTo()

bool BOL::AsciiXmlParser::recordTo ( std::string &  recordingString,
char const  endChar 
)
inlineprotected

Definition at line 411 of file AsciiXmlParser.hpp.

417 {
418 while( readCharacter()
419 &&
420 endChar != currentChar )
421 {
422 recordingString.append( 1,
423 currentChar );
424 }
425 return streamIsGood;
426 }

◆ recordToEndOfElement()

bool BOL::AsciiXmlParser::recordToEndOfElement ( )
protected

Definition at line 360 of file AsciiXmlParser.cpp.

365 {
366 fullOpeningTagAsFound.assign( "" );
368 fullElementContentAsFound.assign( "" );
369 // we note which line the opening tag is on:
370 elementLineRange.first = ( readNewlines + 1 );
371 if( tagCloser == markupString[ markupString.size() - 1 ] )
372 {
373 // empty tags need no recording:
374 elementLineRange.second = ( readNewlines + 1 );
375 return true;
376 }
377 closingTag.assign( 1,
378 tagCloser );
379 closingTag.append( elementName );
381 // there could be nested elements of the same name (not necessarily nested
382 // directly).
383 while( 0 < closingTagsToFind )
384 {
386 &&
388 if( !streamIsGood )
389 {
390 return false;
391 }
392 if( 0 == currentTagName.compare( elementName ) )
393 {
394 // if a nested child element of the same name is found, the child
395 // element is recorded too.
397 }
398 else if( 0 == currentTagName.compare( closingTag ) )
399 {
401 }
402 if( 0 < closingTagsToFind )
403 {
404 // if unless this is the closing tag of element, the markup must be
405 // recorded, & here, because textStream has already gone past it.
407 }
408 else
409 {
410 // if this is the closing tag, we note which line it is on:
411 elementLineRange.second = ( readNewlines + 1 );
412 }
413 }
414 return true;
415 }
void recordTagTo(std::string &recordingString)

◆ recordToNextMarkup()

bool BOL::AsciiXmlParser::recordToNextMarkup ( )
inlineprotected

Definition at line 472 of file AsciiXmlParser.hpp.

477 {
480 &&
481 closeMarkup() );
482 }

◆ recordToNextTag()

bool BOL::AsciiXmlParser::recordToNextTag ( )
inlineprotected

Definition at line 485 of file AsciiXmlParser.hpp.

490 {
491 markupString.assign( "" );
492 while( markupString.empty() )
493 {
495 &&
497 &&
499 if( !streamIsGood )
500 {
501 return false;
502 }
503 }
504 return true;
505 }
bool recordDelimited(std::pair< std::string, std::string > const &delimitingStrings)

◆ resetContent()

void BOL::AsciiXmlParser::resetContent ( )
inlineprotected

Definition at line 375 of file AsciiXmlParser.hpp.

378 {
379 rootTag.assign( "" );
380 rootAttributeMap.clear();
381 rootLineRange.first = -1;
382 rootLineRange.second = -1;
383 elementName.assign( "" );
384 fullElementContentAsFound.assign( "" );
385 fullOpeningTagAsFound.assign( "" );
386 elementAttributeMap.clear();
387 elementLineRange.first = -1;
388 elementLineRange.second = -1;
389 markupString.assign( "" );
390 readNewlines = 0;
391 }

◆ returnToBeginningOfText()

void BOL::AsciiXmlParser::returnToBeginningOfText ( )
inline

Definition at line 299 of file AsciiXmlParser.hpp.

302 {
303 resetContent();
304 textStream->clear();
305 textStream->seekg( std::ios::beg );
306 }

◆ skipPrologAndOpenRootElement()

bool BOL::AsciiXmlParser::skipPrologAndOpenRootElement ( )
protected

Definition at line 418 of file AsciiXmlParser.cpp.

424 {
425 resetContent();
426 // the XML declaration markup is skipped as it is a special case of
427 // processing instruction markup.
428 while( markupString.empty() )
429 {
431 &&
433 &&
435 if( !streamIsGood )
436 {
437 if( isVerbose )
438 {
439 std::cout
440 << std::endl
441 << "BOL::error! AsciiXmlParser::skipPrologAndOpenRootElement() could"
442 << " not find any valid root element tag markup!";
443 std::cout << std::endl;
444 }
445 return false;
446 }
447 }
448 // at this point, either the current markup is the root element's opening
449 // tag, or is the document declaration if there is one, either only up to
450 // the 1st '>' regardless of if it actually is the end of the markup or
451 // not (e.g. if it is within quotes).
452 if( ( doctypeDelimiter.first.size() < ( markupString.size() + 2 ) )
453 &&
455 // if the markup is a document type declaration...
456 {
457 // since we will discard the document type declaration, it doesn't matter
458 // if we mangle markupString in doing so, since it will be over-written
459 // the opening tag of the root element anyway.
461 if( !streamIsGood )
462 {
463 if( isVerbose )
464 {
465 std::cout
466 << std::endl
467 << "BOL::error! AsciiXmlParser::skipPrologAndOpenRootElement() could"
468 << " not find any valid root element tag markup!";
469 std::cout << std::endl;
470 }
471 return false;
472 }
473 size_t unclosedSubmarkupOpener( markupString.find( markupOpener ) );
474 while( std::string::npos != unclosedSubmarkupOpener )
475 {
479 &&
481 if( !streamIsGood )
482 {
483 if( isVerbose )
484 {
485 std::cout
486 << std::endl
487 << "BOL::error! AsciiXmlParser::skipPrologAndOpenRootElement()"
488 << " could not find any valid root element tag markup!";
489 std::cout << std::endl;
490 }
491 return false;
492 }
493 unclosedSubmarkupOpener = markupString.find( markupOpener,
494 unclosedSubmarkupOpener );
495 }
496 markupString.assign( "" );
497 // at this point, we have read in an unquoted '>' for every '<'. now we
498 // can forget the mangled document type declaration & we only have to
499 // discard any more comments or processing instructions before the
500 // opening tag of the root element.
501 while( markupString.empty() )
502 {
504 &&
506 &&
508 if( !streamIsGood )
509 {
510 if( isVerbose )
511 {
512 std::cout
513 << std::endl
514 << "BOL::error! AsciiXmlParser::skipPrologAndOpenRootElement()"
515 << " could not find any valid root element tag markup!";
516 std::cout << std::endl;
517 }
518 return false;
519 }
520 }
521 }
522 // at this point, the current markup is the root element's opening tag,
523 // though only up to the 1st '>' regardless of if it actually is the end of
524 // the markup or not (e.g. if it is within quotes).
525 rootLineRange.first = ( readNewlines + 1 );
527 &&
528 parseAttributes() );
529 if( !streamIsGood )
530 {
531 if( isVerbose )
532 {
533 std::cout
534 << std::endl
535 << "BOL::error! AsciiXmlParser::skipPrologAndOpenRootElement() could"
536 << " not find any valid root element tag markup!";
537 std::cout << std::endl;
538 }
539 return false;
540 }
542 rootTag.assign( elementName );
543 return true;
544 }
static std::pair< std::string, std::string > const doctypeDelimiter
bool eraseQuotedStringsInMarkup(size_t const startPosition)

Member Data Documentation

◆ allowedXmlQuoteChars

std::string const BOL::AsciiXmlParser::allowedXmlQuoteChars
staticprotected

Definition at line 97 of file AsciiXmlParser.hpp.

◆ allowedXmlWhitespaceChars

std::string const BOL::AsciiXmlParser::allowedXmlWhitespaceChars
staticprotected

Definition at line 96 of file AsciiXmlParser.hpp.

◆ cdataDelimiter

std::pair< std::string, std::string > const BOL::AsciiXmlParser::cdataDelimiter
staticprotected

Definition at line 101 of file AsciiXmlParser.hpp.

◆ closingTag

std::string BOL::AsciiXmlParser::closingTag
protected

Definition at line 129 of file AsciiXmlParser.hpp.

◆ closingTagsToFind

int BOL::AsciiXmlParser::closingTagsToFind
protected

Definition at line 130 of file AsciiXmlParser.hpp.

◆ commentDelimiter

std::pair< std::string, std::string > const BOL::AsciiXmlParser::commentDelimiter
staticprotected

Definition at line 98 of file AsciiXmlParser.hpp.

◆ currentAttribute

std::pair< std::string, std::string > BOL::AsciiXmlParser::currentAttribute
protected

Definition at line 128 of file AsciiXmlParser.hpp.

◆ currentChar

char BOL::AsciiXmlParser::currentChar
protected

Definition at line 121 of file AsciiXmlParser.hpp.

◆ currentQuoteChar

char BOL::AsciiXmlParser::currentQuoteChar
protected

Definition at line 127 of file AsciiXmlParser.hpp.

◆ currentTagName

std::string BOL::AsciiXmlParser::currentTagName
protected

Definition at line 131 of file AsciiXmlParser.hpp.

◆ doctypeDelimiter

std::pair< std::string, std::string > const BOL::AsciiXmlParser::doctypeDelimiter
staticprotected

Definition at line 100 of file AsciiXmlParser.hpp.

◆ elementAttributeMap

std::map< std::string, std::string > BOL::AsciiXmlParser::elementAttributeMap
protected

Definition at line 116 of file AsciiXmlParser.hpp.

◆ elementLineRange

std::pair< int, int > BOL::AsciiXmlParser::elementLineRange
protected

Definition at line 117 of file AsciiXmlParser.hpp.

◆ elementName

std::string BOL::AsciiXmlParser::elementName
protected

Definition at line 110 of file AsciiXmlParser.hpp.

◆ fileParsingStream

std::ifstream BOL::AsciiXmlParser::fileParsingStream
protected

Definition at line 104 of file AsciiXmlParser.hpp.

◆ fullElementContentAsFound

std::string BOL::AsciiXmlParser::fullElementContentAsFound
protected

Definition at line 111 of file AsciiXmlParser.hpp.

◆ fullOpeningTagAsFound

std::string BOL::AsciiXmlParser::fullOpeningTagAsFound
protected

Definition at line 114 of file AsciiXmlParser.hpp.

◆ isVerbose

bool const BOL::AsciiXmlParser::isVerbose
protected

Definition at line 103 of file AsciiXmlParser.hpp.

◆ markupCloser

char const BOL::AsciiXmlParser::markupCloser
staticprotected

Definition at line 94 of file AsciiXmlParser.hpp.

◆ markupOpener

char const BOL::AsciiXmlParser::markupOpener
staticprotected

Definition at line 93 of file AsciiXmlParser.hpp.

◆ markupString

std::string BOL::AsciiXmlParser::markupString
protected

Definition at line 119 of file AsciiXmlParser.hpp.

◆ newlinesBeforeMarkup

int BOL::AsciiXmlParser::newlinesBeforeMarkup
protected

Definition at line 123 of file AsciiXmlParser.hpp.

◆ parseEnd

size_t BOL::AsciiXmlParser::parseEnd
protected

Definition at line 125 of file AsciiXmlParser.hpp.

◆ parseStart

size_t BOL::AsciiXmlParser::parseStart
protected

Definition at line 124 of file AsciiXmlParser.hpp.

◆ piDelimiter

std::pair< std::string, std::string > const BOL::AsciiXmlParser::piDelimiter
staticprotected

Definition at line 99 of file AsciiXmlParser.hpp.

◆ previousLength

size_t BOL::AsciiXmlParser::previousLength
protected

Definition at line 126 of file AsciiXmlParser.hpp.

◆ readNewlines

int BOL::AsciiXmlParser::readNewlines
protected

Definition at line 122 of file AsciiXmlParser.hpp.

◆ rootAttributeMap

std::map< std::string, std::string > BOL::AsciiXmlParser::rootAttributeMap
protected

Definition at line 108 of file AsciiXmlParser.hpp.

◆ rootLineRange

std::pair< int, int > BOL::AsciiXmlParser::rootLineRange
protected

Definition at line 109 of file AsciiXmlParser.hpp.

◆ rootTag

std::string BOL::AsciiXmlParser::rootTag
protected

Definition at line 107 of file AsciiXmlParser.hpp.

◆ streamIsGood

bool BOL::AsciiXmlParser::streamIsGood
protected

Definition at line 120 of file AsciiXmlParser.hpp.

◆ stringParsingStream

std::istringstream BOL::AsciiXmlParser::stringParsingStream
protected

Definition at line 105 of file AsciiXmlParser.hpp.

◆ tagCloser

char const BOL::AsciiXmlParser::tagCloser
staticprotected

Definition at line 95 of file AsciiXmlParser.hpp.

◆ textStream

std::istream* BOL::AsciiXmlParser::textStream
protected

Definition at line 106 of file AsciiXmlParser.hpp.


The documentation for this class was generated from the following files: