MLBookProc 1.1
 
Loading...
Searching...
No Matches
DCParser Class Reference

The DCParser class. More...

#include <DCParser.h>

Inheritance diagram for DCParser:
XMLParser

Public Member Functions

 DCParser (const std::shared_ptr< AuxFunc > &af)
 DCParser constructor.
 
std::string dcTitle (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book title.
 
std::string dcAuthor (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book author.
 
std::string dcGenre (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book genre.
 
std::string dcDate (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book creation date.
 
std::string dcLanguage (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book language.
 
std::string dcPublisher (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets file publisher.
 
std::string dcIdentifier (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book identifier.
 
std::string dcSource (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book source.
 
std::string dcDescription (const std::string &dc_file_content, const std::vector< XMLTag > &tgv)
 Gets book description.
 
- Public Member Functions inherited from XMLParser
 XMLParser (const std::shared_ptr< AuxFunc > &af)
 XMLParser constructor.
 
std::vector< XMLTagget_tag (const std::string &book, const std::string &tag_id)
 Returns all tags with particular name.
 
std::string get_book_encoding (const std::string &book)
 Returns XML document encoding.
 
std::string get_element_attribute (const std::string &element, const std::string &attr_name)
 Returns XML tag attribute if it was found.
 
std::vector< XMLTaglistAllTags (const std::string &book)
 Parses XML document.
 
void searchTag (const std::vector< XMLTag > &list, const std::string &tag_id, std::vector< XMLTag > &result)
 Searches tag in tag list.
 
void htmlSymbolsReplacement (std::string &book)
 Replaces symbols encoded by "&..." sequences.
 
void removeAllTags (std::string &book)
 Removes all tag elements from XML document.
 

Detailed Description

The DCParser class.

Auxiliary class. Contains methods for DublinCore files parsing. This class is used in ODTParser and EPUBParser. You do not need to call this class methods directly.

Constructor & Destructor Documentation

◆ DCParser()

DCParser::DCParser ( const std::shared_ptr< AuxFunc > & af)

DCParser constructor.

Parameters
afsmart pointer to AuxFunc object.

Member Function Documentation

◆ dcAuthor()

std::string DCParser::dcAuthor ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book author.

This method can be used to get author(s) from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
Author if any, empty string otherwise.

◆ dcDate()

std::string DCParser::dcDate ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book creation date.

This method can be used to get creation date from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
File creation date if any, empty otherwise.

◆ dcDescription()

std::string DCParser::dcDescription ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book description.

This method can be used to get book description from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
Book description if any, empty otherwise.

◆ dcGenre()

std::string DCParser::dcGenre ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book genre.

This method can be used to get genre(s) from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
Gernre if any, empty string otherwise.

◆ dcIdentifier()

std::string DCParser::dcIdentifier ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book identifier.

This method can be used to get identifier from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
Book identifier if any, empty otherwise.

◆ dcLanguage()

std::string DCParser::dcLanguage ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book language.

This method can be used to get language from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
File language if set, empty otherwise.

◆ dcPublisher()

std::string DCParser::dcPublisher ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets file publisher.

This method can be used to get publisher from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
File publisher if set, empty otherwise.

◆ dcSource()

std::string DCParser::dcSource ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book source.

This method can be used to get book source from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
Book source if set, empty otherwise.

◆ dcTitle()

std::string DCParser::dcTitle ( const std::string & dc_file_content,
const std::vector< XMLTag > & tgv )

Gets book title.

This method can be used to get title from DublinCore file.

Parameters
dc_file_contentstring containing file content.
tgvXMLTag vector obtained from XMLParser::listAllTags method.
Returns
Title if any, empty string otherwise.