Public Member Functions | Private Member Functions | Private Attributes | List of all members
libebook::FictionBook2ParserContext Class Reference

Base class for all contexts. More...

`#include <FictionBook2ParserContext.h>`

Inheritance diagram for libebook::FictionBook2ParserContext:

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

## Private Member Functions
| FictionBook2ParserContext (const FictionBook2ParserContext &other)
FictionBook2ParserContext & | operator= (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] | parentContext | A parent context.
  [in] | collector | A collector for the context's content.

## Member Function Documentation

## ◆ getCollector()

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

Get the collector.

Returns
  The collector.

Referenced by libebook::FictionBook2CellContext::attribute(), libebook::FictionBook2CiteContext::attribute(), libebook::FictionBook2EpigraphContext::attribute(), libebook::FictionBook2ImageContext::attribute(), libebook::FictionBook2ParaContextBase::attribute(), libebook::FictionBook2PoemContext::attribute(), libebook::FictionBook2SectionContext::attribute(), libebook::FictionBook2TableContext::attribute(), libebook::FictionBook2TitleContext::attribute(), libebook::FictionBook2AContext::endOfElement(), libebook::FictionBook2BodyContext::endOfElement(), libebook::FictionBook2CellContext::endOfElement(), libebook::FictionBook2CustomInfoContext::endOfElement(), libebook::FictionBook2EmptyLineContext::endOfElement(), libebook::FictionBook2ImageContext::endOfElement(), libebook::FictionBook2InlineImageContext::endOfElement(), libebook::FictionBook2ParaContextBase::endOfElement(), libebook::FictionBook2StanzaContext::endOfElement(), libebook::FictionBook2TableContext::endOfElement(), libebook::FictionBook2TitleInfoContext::endOfElement(), libebook::FictionBook2TrContext::endOfElement(), libebook::FictionBook2CellContext::openCell(), libebook::FictionBook2TrContext::openRow(), libebook::FictionBook2BodyContext::startOfElement(), libebook::FictionBook2ParaContextBase::startOfElement(), libebook::FictionBook2PoemContext::startOfElement(), libebook::FictionBook2TableContext::startOfElement(), libebook::FictionBook2AContext::text(), libebook::FictionBook2BinaryContext::text(), libebook::FictionBook2BookTitleContext::text(), libebook::FictionBook2DateContext::text(), libebook::FictionBook2KeywordsContext::text(), libebook::FictionBook2LangContext::text(), libebook::FictionBook2PublisherContext::text(), libebook::FictionBook2SrcUrlContext::text(), libebook::FictionBook2StyleContextBase::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
| override virtual

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:

- FictionBook2ParserContext.h
- FictionBook2ParserContext.cpp