LibreOffice Module shell (master) 1
|
#include <metainforeader.hxx>
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... | |
ITag * | chooseTagReader (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 |
CKeywordsTag * | m_pKeywords_Builder |
CDummyTag * | m_pDummy_Builder |
CSimpleTag * | m_pSimple_Builder |
Definition at line 33 of file metainforeader.hxx.
|
overridevirtual |
destructor.
Definition at line 107 of file metainforeader.cxx.
References m_pDummy_Builder, m_pKeywords_Builder, and m_pSimple_Builder.
CMetaInfoReader::CMetaInfoReader | ( | const Filepath_t & | DocumentName | ) |
constructor.
Definition at line 29 of file metainforeader.cxx.
References EMPTY_XML_TAG, CBaseReader::Initialize(), m_AllMetaInfo, m_pDummy_Builder, m_pKeywords_Builder, m_pSimple_Builder, META_CONTENT_NAME, 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_KEYWORDS, META_INFO_LANGUAGE, META_INFO_MODIFIED, META_INFO_SUBJECT, and META_INFO_TITLE.
CMetaInfoReader::CMetaInfoReader | ( | StreamInterface * | stream | ) |
Definition at line 66 of file metainforeader.cxx.
References EMPTY_XML_TAG, CBaseReader::Initialize(), m_AllMetaInfo, m_pDummy_Builder, m_pKeywords_Builder, m_pSimple_Builder, META_CONTENT_NAME, 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_KEYWORDS, META_INFO_LANGUAGE, META_INFO_MODIFIED, META_INFO_SUBJECT, META_INFO_TITLE, and stream.
|
overrideprotectedvirtual |
characters occurs when receiving characters
character | content of the information received. |
Implements CBaseReader.
Definition at line 276 of file metainforeader.cxx.
References ITag::addCharacters(), character, HasOnlySpaces(), and m_TagBuilderStack.
|
protected |
choose an appropriate tag reader to handle the tag.
choose an appropriate tag reader
tag_name | the name of the tag. |
XmlAttributes | attribute 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().
|
overrideprotectedvirtual |
end_element occurs when a tag is closed
raw_name | raw name of the tag. |
local_name | local name of the tag. |
Implements CBaseReader.
Definition at line 261 of file metainforeader.cxx.
References ITag::endTag(), m_TagBuilderStack, and saveTagContent().
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().
std::wstring CMetaInfoReader::getTagAttribute | ( | const std::wstring & | TagName, |
const std::wstring & | AttributeName | ||
) |
Get a specific attribute content.
TagName | the name of the tag. |
AttributeName | the 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().
std::wstring CMetaInfoReader::getTagData | ( | const std::wstring & | TagName | ) |
Get a specific tag content, compound tags will be returned as comma separated list.
TagName | the name of the tag that will be retrieved. |
TagName | the 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().
bool CMetaInfoReader::hasTag | ( | const std::wstring & | TagName | ) | const |
check if the Tag is in the target meta.xml file.
TagName | the name of the tag that will be retrieved. |
TagName | the name of the tag that will be retrieve. |
Definition at line 122 of file metainforeader.cxx.
References m_AllMetaInfo.
Referenced by getDefaultLocale(), and getTagData().
bool CMetaInfoReader::hasTagAttribute | ( | const std::wstring & | TagName, |
const std::wstring & | AttributeName | ||
) |
check if the a tag has the specific attribute.
TagName | the name of the tag. |
AttributeName | the name of the attribute. |
Definition at line 147 of file metainforeader.cxx.
References m_AllMetaInfo.
Referenced by getTagAttribute().
|
protected |
save the received content into structure.
tag_name | the name of the tag. |
Definition at line 216 of file metainforeader.cxx.
References CKeywordsTag::getTagContent(), ITag::getTagContent(), 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 end_element().
|
overrideprotectedvirtual |
start_element occurs when a tag is start.
raw_name | raw name of the tag. |
local_name | local name of the tag. |
attributes | attribute structure. |
Implements CBaseReader.
Definition at line 244 of file metainforeader.cxx.
References chooseTagReader(), m_TagBuilderStack, and ITag::startTag().
|
private |
Definition at line 125 of file metainforeader.hxx.
Referenced by chooseTagReader(), CMetaInfoReader(), getDefaultLocale(), getTagAttribute(), getTagData(), hasTag(), hasTagAttribute(), and saveTagContent().
|
private |
Definition at line 132 of file metainforeader.hxx.
Referenced by chooseTagReader(), CMetaInfoReader(), saveTagContent(), and ~CMetaInfoReader().
|
private |
Definition at line 131 of file metainforeader.hxx.
Referenced by chooseTagReader(), CMetaInfoReader(), saveTagContent(), and ~CMetaInfoReader().
|
private |
Definition at line 133 of file metainforeader.hxx.
Referenced by chooseTagReader(), CMetaInfoReader(), saveTagContent(), and ~CMetaInfoReader().
|
private |
Definition at line 128 of file metainforeader.hxx.
Referenced by characters(), end_element(), and start_element().