LibreOffice Module shell (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CContentReader Class Reference

#include <contentreader.hxx>

Inheritance diagram for CContentReader:
[legend]
Collaboration diagram for CContentReader:
[legend]

Public Member Functions

virtual ~CContentReader () override
 destructor. More...
 
 CContentReader (const Filepath_t &DocumentName, LocaleSet_t const &DocumentLocale)
 constructor. More...
 
 CContentReader (StreamInterface *stream, LocaleSet_t const &DocumentLocale)
 
ChunkBuffer_t const & getChunkBuffer () const
 Get the chunkbuffer. More...
 
- Public Member Functions inherited from CBaseReader
virtual ~CBaseReader () override
 
- Public Member Functions inherited from i_xml_parser_event_handler
virtual ~i_xml_parser_event_handler ()
 
virtual void start_element (const string_t &raw_name, const string_t &local_name, const xml_tag_attribute_container_t &attributes)=0
 
virtual void end_element (const string_t &raw_name, const string_t &local_name)=0
 
virtual void characters (const string_t &character)=0
 
virtual void ignore_whitespace (const string_t &whitespaces)=0
 
virtual void comment (const string_t &comment)=0
 

Protected Member Functions

virtual void start_element (const string_t &raw_name, const string_t &local_name, const xml_tag_attribute_container_t &attributes) override
 start_element occurs when a tag is start. More...
 
virtual void end_element (const string_t &raw_name, const string_t &local_name) override
 end_element occurs when a tag is closed More...
 
virtual void characters (const string_t &character) override
 characters occurs when receiving characters More...
 
ITagchooseTagReader (const std::wstring &tag_name, const XmlTagAttributes_t &XmlAttributes)
 choose an appropriate tag reader to handle the tag. More...
 
StyleLocaleMap_t const & getStyleMap () const
 Get the list of style locale pair. More...
 
::std::wstring getCurrentContentStyle ()
 get style of the current content. More...
 
void addChunk (LocaleSet_t const &Locale, Content_t const &Content)
 add chunk into Chunk Buffer. More...
 
LocaleSet_t const & getLocale (const StyleName_t &Style)
 get a style's locale field. More...
 
- Protected Member Functions inherited from CBaseReader
 CBaseReader (const Filepath_t &DocumentName)
 constructor of CBaseReader. More...
 
 CBaseReader (StreamInterface *stream)
 
virtual void start_document ()
 
virtual void end_document ()
 
virtual void start_element (const string_t &raw_name, const string_t &local_name, const xml_tag_attribute_container_t &attributes) override=0
 
virtual void end_element (const string_t &raw_name, const string_t &local_name) override=0
 
virtual void characters (const string_t &character) override=0
 
virtual void ignore_whitespace (const string_t &) override
 
virtual void processing_instruction (const std::wstring &, const std::wstring &)
 
virtual void comment (const string_t &) override
 
void Initialize (const std::string &)
 Read interested tag content into respective structure then start parsing process. More...
 

Private Attributes

std::stack< ITag * > m_TagBuilderStack
 
ChunkBuffer_t m_ChunkBuffer
 
StyleLocaleMap_t m_StyleMap
 
LocaleSet_t m_DefaultLocale
 

Detailed Description

Definition at line 30 of file contentreader.hxx.

Constructor & Destructor Documentation

◆ ~CContentReader()

CContentReader::~CContentReader ( )
overridevirtual

destructor.

Definition at line 69 of file contentreader.cxx.

◆ CContentReader() [1/2]

CContentReader::CContentReader ( const Filepath_t DocumentName,
LocaleSet_t const &  DocumentLocale 
)

constructor.

Definition at line 29 of file contentreader.cxx.

References DOC_CONTENT_NAME, CBaseReader::Initialize(), and m_DefaultLocale.

◆ CContentReader() [2/2]

CContentReader::CContentReader ( StreamInterface stream,
LocaleSet_t const &  DocumentLocale 
)

Definition at line 47 of file contentreader.cxx.

References DOC_CONTENT_NAME, CBaseReader::Initialize(), m_DefaultLocale, and stream.

Member Function Documentation

◆ addChunk()

void CContentReader::addChunk ( LocaleSet_t const &  Locale,
Content_t const &  Content 
)
protected

add chunk into Chunk Buffer.

Definition at line 119 of file contentreader.cxx.

References Content, EMPTY_STRING, LF, Locale, m_ChunkBuffer, and SPACE.

Referenced by characters(), and end_element().

◆ characters()

void CContentReader::characters ( const string_t character)
overrideprotectedvirtual

characters occurs when receiving characters

Parameters
charactercontent of the information received.

Implements CBaseReader.

Definition at line 207 of file contentreader.cxx.

References ITag::addCharacters(), addChunk(), character, getCurrentContentStyle(), getLocale(), HasOnlySpaces(), and m_TagBuilderStack.

◆ chooseTagReader()

ITag * CContentReader::chooseTagReader ( const std::wstring &  tag_name,
const XmlTagAttributes_t XmlAttributes 
)
protected

choose an appropriate tag reader to handle the tag.

choose an appropriate tag reader

Parameters
tag_namethe name of the tag.
XmlAttributesattribute structure of the tag to save in.

Definition at line 78 of file contentreader.cxx.

References ITag::addAttributes(), CONTENT_STYLE_PROPERTIES, CONTENT_STYLE_STYLE, CONTENT_STYLE_STYLE_NAME, CONTENT_TEXT_A, CONTENT_TEXT_BOOKMARK_REF, CONTENT_TEXT_H, CONTENT_TEXT_INDEX_TITLE_TEMPLATE, CONTENT_TEXT_P, CONTENT_TEXT_SEQUENCE, CONTENT_TEXT_SPAN, CONTENT_TEXT_STYLE_PROPERTIES, and m_TagBuilderStack.

Referenced by start_element().

◆ end_element()

void CContentReader::end_element ( const string_t raw_name,
const string_t local_name 
)
overrideprotectedvirtual

◆ getChunkBuffer()

ChunkBuffer_t const & CContentReader::getChunkBuffer ( ) const
inline

Get the chunkbuffer.

Returns
the chunkbuffer of the document.

Definition at line 45 of file contentreader.hxx.

References m_ChunkBuffer.

◆ getCurrentContentStyle()

std::wstring CContentReader::getCurrentContentStyle ( )
protected

get style of the current content.

Returns
style of the current content.

Definition at line 109 of file contentreader.cxx.

References CONTENT_TEXT_STYLENAME, ITag::getTagAttribute(), and m_TagBuilderStack.

Referenced by characters(), and end_element().

◆ getLocale()

LocaleSet_t const & CContentReader::getLocale ( const StyleName_t Style)
protected

get a style's locale field.

Definition at line 141 of file contentreader.cxx.

References m_DefaultLocale, m_StyleMap, and Style.

Referenced by characters(), and end_element().

◆ getStyleMap()

StyleLocaleMap_t const & CContentReader::getStyleMap ( ) const
inlineprotected

Get the list of style locale pair.

Returns
the Style-Locale map

Definition at line 96 of file contentreader.hxx.

References m_StyleMap.

◆ start_element()

void CContentReader::start_element ( const string_t raw_name,
const string_t local_name,
const xml_tag_attribute_container_t attributes 
)
overrideprotectedvirtual

start_element occurs when a tag is start.

Parameters
raw_nameraw name of the tag.
local_namelocal name of the tag.
attributesattribute structure.

Implements CBaseReader.

Definition at line 161 of file contentreader.cxx.

References chooseTagReader(), m_TagBuilderStack, and ITag::startTag().

Member Data Documentation

◆ m_ChunkBuffer

ChunkBuffer_t CContentReader::m_ChunkBuffer
private

Definition at line 115 of file contentreader.hxx.

Referenced by addChunk(), and getChunkBuffer().

◆ m_DefaultLocale

LocaleSet_t CContentReader::m_DefaultLocale
private

Definition at line 117 of file contentreader.hxx.

Referenced by CContentReader(), end_element(), and getLocale().

◆ m_StyleMap

StyleLocaleMap_t CContentReader::m_StyleMap
private

Definition at line 116 of file contentreader.hxx.

Referenced by end_element(), getLocale(), and getStyleMap().

◆ m_TagBuilderStack

std::stack<ITag*> CContentReader::m_TagBuilderStack
private

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