The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QuoteStack Class Reference

#include <gbfosis.h>

+ Collaboration diagram for QuoteStack:

Classes

class  QuoteInstance
 

Public Member Functions

void clear ()
 
bool empty ()
 
void handleQuote (char *buf, char *quotePos, SWBuf &text)
 
 QuoteStack ()
 
virtual ~QuoteStack ()
 

Private Types

typedef std::stack< QuoteInstanceQuoteInstanceStack
 

Private Attributes

QuoteInstanceStack quotes
 

Detailed Description

Definition at line 34 of file gbfosis.h.

Member Typedef Documentation

typedef std::stack<QuoteInstance> QuoteStack::QuoteInstanceStack
private

Definition at line 51 of file gbfosis.h.

Constructor & Destructor Documentation

QuoteStack::QuoteStack ( )

Definition at line 400 of file gbfosis.cpp.

400  {
401  clear();
402 }
void clear()
Definition: gbfosis.cpp:405
QuoteStack::~QuoteStack ( )
virtual

Definition at line 410 of file gbfosis.cpp.

410  {
411  clear();
412 }
void clear()
Definition: gbfosis.cpp:405

Member Function Documentation

void QuoteStack::clear ( )

Definition at line 405 of file gbfosis.cpp.

405  {
406  while (!quotes.empty()) quotes.pop();
407 }
QuoteInstanceStack quotes
Definition: gbfosis.h:52
bool QuoteStack::empty ( )
inline

Definition at line 58 of file gbfosis.h.

58 { return quotes.empty(); }
QuoteInstanceStack quotes
Definition: gbfosis.h:52
void QuoteStack::handleQuote ( char *  buf,
char *  quotePos,
SWBuf text 
)

Definition at line 415 of file gbfosis.cpp.

415  {
416 //QuoteInstance(char startChar = '\"', char level = 1, string uniqueID = "", char continueCount = 0) {
417  if (!quotes.empty()) {
418  QuoteInstance last = quotes.top();
419  if (last.startChar == *quotePos) {
420  text += "</quote>";
421  quotes.pop();
422  }
423  else {
424  quotes.push(QuoteInstance(*quotePos, last.level+1));
425  quotes.top().pushStartStream(text);
426  }
427  }
428  else {
429  quotes.push(QuoteInstance(*quotePos));
430  quotes.top().pushStartStream(text);
431  }
432 }
QuoteInstanceStack quotes
Definition: gbfosis.h:52

Member Data Documentation

QuoteInstanceStack QuoteStack::quotes
private

Definition at line 52 of file gbfosis.h.


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