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

#include <metainforeader.hxx>

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

Public Member Functions

virtual ~CMetaInfoReader () override
 destructor. More...
 
 CMetaInfoReader (const Filepath_t &DocumentName)
 constructor. More...
 
 CMetaInfoReader (StreamInterface *stream)
 
bool hasTag (const std::wstring &TagName) const
 check if the Tag is in the target meta.xml file. More...
 
std::wstring getTagData (const std::wstring &TagName)
 Get a specific tag content, compound tags will be returned as comma separated list. More...
 
bool hasTagAttribute (const std::wstring &TagName, const std::wstring &AttributeName)
 check if the a tag has the specific attribute. More...
 
std::wstring getTagAttribute (const std::wstring &TagName, const std::wstring &AttributeName)
 Get a specific attribute content. More...
 
LocaleSet_t getDefaultLocale ()
 Get the default language of the whole document. 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...
 
void saveTagContent (const std::wstring &tag_name)
 save the received content into structure. 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

XmlTags_t m_AllMetaInfo
 
std::stack< ITag * > m_TagBuilderStack
 
CKeywordsTagm_pKeywords_Builder
 
CDummyTagm_pDummy_Builder
 
CSimpleTagm_pSimple_Builder
 

Detailed Description

Definition at line 33 of file metainforeader.hxx.

Constructor & Destructor Documentation

◆ ~CMetaInfoReader()

CMetaInfoReader::~CMetaInfoReader ( )
overridevirtual

destructor.

Definition at line 107 of file metainforeader.cxx.

References m_pDummy_Builder, m_pKeywords_Builder, and m_pSimple_Builder.

◆ CMetaInfoReader() [1/2]

CMetaInfoReader::CMetaInfoReader ( const Filepath_t DocumentName)

◆ CMetaInfoReader() [2/2]

CMetaInfoReader::CMetaInfoReader ( StreamInterface stream)

Member Function Documentation

◆ characters()

void CMetaInfoReader::characters ( const string_t character)
overrideprotectedvirtual

characters occurs when receiving characters

Parameters
charactercontent of the information received.

Implements CBaseReader.

Definition at line 276 of file metainforeader.cxx.

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

◆ chooseTagReader()

ITag * CMetaInfoReader::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 194 of file metainforeader.cxx.

References m_AllMetaInfo, m_pDummy_Builder, m_pKeywords_Builder, m_pSimple_Builder, META_INFO_AUTHOR, META_INFO_CREATION, META_INFO_CREATOR, META_INFO_DESCRIPTION, META_INFO_DOCUMENT_NUMBER, META_INFO_DOCUMENT_STATISTIC, META_INFO_EDITING_TIME, META_INFO_GENERATOR, META_INFO_KEYWORD, META_INFO_KEYWORDS, META_INFO_LANGUAGE, META_INFO_MODIFIED, META_INFO_SUBJECT, and META_INFO_TITLE.

Referenced by start_element().

◆ end_element()

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

end_element occurs when a tag is closed

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

Implements CBaseReader.

Definition at line 261 of file metainforeader.cxx.

References ITag::endTag(), m_TagBuilderStack, and saveTagContent().

◆ getDefaultLocale()

LocaleSet_t CMetaInfoReader::getDefaultLocale ( )

Get the default language of the whole document.

Get the default language of the whole document, if no such field, en-US is returned.

Definition at line 178 of file metainforeader.cxx.

References EN_US_LOCALE(), hasTag(), isValidLocale(), m_AllMetaInfo, and META_INFO_LANGUAGE.

Referenced by COooFilter::Load().

◆ getTagAttribute()

std::wstring CMetaInfoReader::getTagAttribute ( const std::wstring &  TagName,
const std::wstring &  AttributeName 
)

Get a specific attribute content.

Parameters
TagNamethe name of the tag.
AttributeNamethe name of the attribute.

Definition at line 159 of file metainforeader.cxx.

References EMPTY_STRING, hasTagAttribute(), and m_AllMetaInfo.

Referenced by writer_document_statistic_reader::fill_description_section(), calc_document_statistic_reader::fill_description_section(), draw_impress_math_document_statistic_reader::fill_description_section(), and CColumnInfo::GetItemData().

◆ getTagData()

std::wstring CMetaInfoReader::getTagData ( const std::wstring &  TagName)

Get a specific tag content, compound tags will be returned as comma separated list.

Parameters
TagNamethe name of the tag that will be retrieved.
TagNamethe name of the tag that will be retrieve.

Definition at line 132 of file metainforeader.cxx.

References EMPTY_STRING, hasTag(), and m_AllMetaInfo.

Referenced by writer_document_statistic_reader::fill_description_section(), calc_document_statistic_reader::fill_description_section(), draw_impress_math_document_statistic_reader::fill_description_section(), document_statistic_reader::fill_origin_section(), CInfoTip::GetInfoTip(), CColumnInfo::GetItemData(), COooFilter::GetValue(), and CPropertySheet::InitPropPageSummary().

◆ hasTag()

bool CMetaInfoReader::hasTag ( const std::wstring &  TagName) const

check if the Tag is in the target meta.xml file.

Parameters
TagNamethe name of the tag that will be retrieved.
TagNamethe name of the tag that will be retrieve.

Definition at line 122 of file metainforeader.cxx.

References m_AllMetaInfo.

Referenced by getDefaultLocale(), and getTagData().

◆ hasTagAttribute()

bool CMetaInfoReader::hasTagAttribute ( const std::wstring &  TagName,
const std::wstring &  AttributeName 
)

check if the a tag has the specific attribute.

Parameters
TagNamethe name of the tag.
AttributeNamethe name of the attribute.

Definition at line 147 of file metainforeader.cxx.

References m_AllMetaInfo.

Referenced by getTagAttribute().

◆ saveTagContent()

void CMetaInfoReader::saveTagContent ( const std::wstring &  tag_name)
protected

◆ start_element()

void CMetaInfoReader::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 244 of file metainforeader.cxx.

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

Member Data Documentation

◆ m_AllMetaInfo

XmlTags_t CMetaInfoReader::m_AllMetaInfo
private

◆ m_pDummy_Builder

CDummyTag* CMetaInfoReader::m_pDummy_Builder
private

◆ m_pKeywords_Builder

CKeywordsTag* CMetaInfoReader::m_pKeywords_Builder
private

◆ m_pSimple_Builder

CSimpleTag* CMetaInfoReader::m_pSimple_Builder
private

◆ m_TagBuilderStack

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

Definition at line 128 of file metainforeader.hxx.

Referenced by characters(), end_element(), and start_element().


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