Add missing method to get the zim metadata.

According to https://wiki.openzim.org/wiki/Metadata
This commit is contained in:
Matthieu Gautier 2019-09-12 15:33:07 +02:00
parent 1245d4e467
commit bd91e89785
2 changed files with 72 additions and 0 deletions

View File

@ -205,6 +205,13 @@ class Reader
*/ */
string getDescription() const; string getDescription() const;
/**
* Get the long description of the zim file.
*
* @return The long description of the zim file as specifed in the zim metadata.
*/
string getLongDescription() const;
/** /**
* Get the language of the zim file. * Get the language of the zim file.
* *
@ -212,6 +219,13 @@ class Reader
*/ */
string getLanguage() const; string getLanguage() const;
/**
* Get the license of the zim file.
*
* @return The license of the zim file as specified in the zim metadata.
*/
string getLicense() const;
/** /**
* Get the tags of the zim file. * Get the tags of the zim file.
* *
@ -219,6 +233,34 @@ class Reader
*/ */
string getTags() const; string getTags() const;
/**
* Get the relations of the zim file.
*
* @return The relation of the zim file as specified in the zim metadata.
*/
string getRelation() const;
/**
* Get the flavour of the zim file.
*
* @return The flavour of the zim file as specified in the zim metadata.
*/
string getFlavour() const;
/**
* Get the source of the zim file.
*
* @return The source of the zim file as specified in the zim metadata.
*/
string getSource() const;
/**
* Get the scraper of the zim file.
*
* @return The scraper of the zim file as specified in the zim metadata.
*/
string getScraper() const;
/** /**
* Get the origId of the zim file. * Get the origId of the zim file.
* *

View File

@ -337,15 +337,45 @@ string Reader::getDescription() const
return value; return value;
} }
string Reader::getLongDescription() const
{
METATAG("LongDescription")
}
string Reader::getLanguage() const string Reader::getLanguage() const
{ {
METATAG("Language") METATAG("Language")
} }
string Reader::getLicense() const
{
METATAG("License")
}
string Reader::getTags() const string Reader::getTags() const
{ {
METATAG("Tags") METATAG("Tags")
} }
string Reader::getRelation() const
{
METATAG("Relation")
}
string Reader::getFlavour() const
{
METATAG("Flavour")
}
string Reader::getSource() const
{
METATAG("Source")
}
string Reader::getScraper() const
{
METATAG("Scraper")
}
#undef METATAG #undef METATAG
string Reader::getOrigId() const string Reader::getOrigId() const