libebook::FictionBook2ParserContext Class Reference

Base class for all contexts. More...

#include <FictionBook2ParserContext.h>

Inheritance diagram for libebook::FictionBook2ParserContext:
libebook::FictionBook2XMLParserContext libebook::FictionBook2AuthorContext libebook::FictionBook2BookNameContext libebook::FictionBook2BookTitleContext libebook::FictionBook2CityContext libebook::FictionBook2CoverpageContext libebook::FictionBook2CustomInfoContext libebook::FictionBook2DataContextBase libebook::FictionBook2DateContext libebook::FictionBook2DescriptionContext libebook::FictionBook2EmailContext libebook::FictionBook2FirstNameContext libebook::FictionBook2GenreContext libebook::FictionBook2HistoryContext libebook::FictionBook2HomePageContext libebook::FictionBook2IdContext libebook::FictionBook2IsbnContext libebook::FictionBook2KeywordsContext libebook::FictionBook2LangContext libebook::FictionBook2LastNameContext libebook::FictionBook2MiddleNameContext libebook::FictionBook2NicknameContext libebook::FictionBook2NodeContextBase libebook::FictionBook2OutputContext libebook::FictionBook2OutputDocumentClassContext libebook::FictionBook2PartContext libebook::FictionBook2ProgramUsedContext libebook::FictionBook2PublisherContext libebook::FictionBook2PublishInfoContext libebook::FictionBook2SequenceContext libebook::FictionBook2SkipElementContext libebook::FictionBook2SrcLangContext libebook::FictionBook2SrcOcrContext libebook::FictionBook2SrcTitleInfoContext libebook::FictionBook2SrcUrlContext libebook::FictionBook2StyleContextBase libebook::FictionBook2TextContextBase libebook::FictionBook2TextInfoContext libebook::FictionBook2TitleInfoContext libebook::FictionBook2TranslatorContext libebook::FictionBook2VersionContext libebook::FictionBook2YearContext

Public Member Functions

 FictionBook2ParserContext (FictionBook2ParserContext *parentContext, FictionBook2Collector *collector=nullptr)
 Create a new context with parentContext as parent. More...
 
FictionBook2XMLParserContextleaveContext () const override
 Destroy this context and return parent. More...
 
FictionBook2CollectorgetCollector () const
 Get the collector. More...
 
FictionBook2ParserContextgetParentContext () const
 Get the parent context. More...
 
- Public Member Functions inherited from libebook::FictionBook2XMLParserContext
virtual ~FictionBook2XMLParserContext ()=0
 
virtual FictionBook2XMLParserContextelement (const FictionBook2TokenData &name, const FictionBook2TokenData &ns)=0
 Create a context for parsing a child element. More...
 
virtual void startOfElement ()=0
 Signalize the start of an element. More...
 
virtual void endOfElement ()=0
 Signalize the end of an element. More...
 
virtual void attribute (const FictionBook2TokenData &name, const FictionBook2TokenData *ns, const char *value)=0
 Process an attribute. More...
 
virtual void endOfAttributes ()=0
 Signalize the end of attributes. More...
 
virtual void text (const char *value)=0
 Process textual content of an element. More...
 

Private Member Functions

 FictionBook2ParserContext (const FictionBook2ParserContext &other)
 
FictionBook2ParserContextoperator= (const FictionBook2ParserContext &other)
 

Private Attributes

FictionBook2Collector *const m_collector
 
FictionBook2ParserContext *const m_parentContext
 

Detailed Description

Base class for all contexts.

Constructor & Destructor Documentation

◆ FictionBook2ParserContext() [1/2]

libebook::FictionBook2ParserContext::FictionBook2ParserContext ( const FictionBook2ParserContext other)
private

◆ FictionBook2ParserContext() [2/2]

libebook::FictionBook2ParserContext::FictionBook2ParserContext ( FictionBook2ParserContext parentContext,
FictionBook2Collector collector = nullptr 
)
explicit

Create a new context with parentContext as parent.

Parameters
[in]parentContextA parent context.
[in]collectorA collector for the context's content.

Member Function Documentation

◆ getCollector()

FictionBook2Collector * libebook::FictionBook2ParserContext::getCollector ( ) const

Get the collector.

Returns
The collector.

Referenced by libebook::FictionBook2ParaContextBase::attribute(), libebook::FictionBook2TableContext::attribute(), libebook::FictionBook2CiteContext::attribute(), libebook::FictionBook2CellContext::attribute(), libebook::FictionBook2EpigraphContext::attribute(), libebook::FictionBook2ImageContext::attribute(), libebook::FictionBook2PoemContext::attribute(), libebook::FictionBook2SectionContext::attribute(), libebook::FictionBook2TitleContext::attribute(), libebook::FictionBook2ParaContextBase::endOfElement(), libebook::FictionBook2BodyContext::endOfElement(), libebook::FictionBook2TableContext::endOfElement(), libebook::FictionBook2AContext::endOfElement(), libebook::FictionBook2CellContext::endOfElement(), libebook::FictionBook2EmptyLineContext::endOfElement(), libebook::FictionBook2InlineImageContext::endOfElement(), libebook::FictionBook2ImageContext::endOfElement(), libebook::FictionBook2TrContext::endOfElement(), libebook::FictionBook2CustomInfoContext::endOfElement(), libebook::FictionBook2StanzaContext::endOfElement(), libebook::FictionBook2TitleInfoContext::endOfElement(), libebook::FictionBook2CellContext::openCell(), libebook::FictionBook2TrContext::openRow(), libebook::FictionBook2ParaContextBase::startOfElement(), libebook::FictionBook2BodyContext::startOfElement(), libebook::FictionBook2TableContext::startOfElement(), libebook::FictionBook2PoemContext::startOfElement(), libebook::FictionBook2BinaryContext::text(), libebook::FictionBook2AContext::text(), libebook::FictionBook2BookTitleContext::text(), libebook::FictionBook2DateContext::text(), libebook::FictionBook2StyleContextBase::text(), libebook::FictionBook2KeywordsContext::text(), libebook::FictionBook2LangContext::text(), libebook::FictionBook2PublisherContext::text(), libebook::FictionBook2SrcUrlContext::text(), and libebook::FictionBook2VersionContext::text().

◆ getParentContext()

FictionBook2ParserContext * libebook::FictionBook2ParserContext::getParentContext ( ) const

Get the parent context.

Returns
The parent context.

Referenced by libebook::FictionBook2SkipElementContext::leaveContext().

◆ leaveContext()

FictionBook2XMLParserContext * libebook::FictionBook2ParserContext::leaveContext ( ) const
overridevirtual

Destroy this context and return parent.

Todo:
It would be handier to use shared_ptr to manage the context lifetimes.
Returns
The parent context.

Implements libebook::FictionBook2XMLParserContext.

Reimplemented in libebook::FictionBook2SkipElementContext.

◆ operator=()

FictionBook2ParserContext& libebook::FictionBook2ParserContext::operator= ( const FictionBook2ParserContext other)
private

Member Data Documentation

◆ m_collector

FictionBook2Collector* const libebook::FictionBook2ParserContext::m_collector
private

Referenced by getCollector().

◆ m_parentContext

FictionBook2ParserContext* const libebook::FictionBook2ParserContext::m_parentContext
private

Referenced by getParentContext(), and leaveContext().


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

Generated for libe-book by doxygen 1.8.14