mirror of https://github.com/kiwix/libkiwix.git
Remove OriginId functions since they are not useful right now
This commit is contained in:
parent
a3ba7619df
commit
19afe9442f
|
@ -292,16 +292,6 @@ class Reader
|
||||||
*/
|
*/
|
||||||
string getScraper() const;
|
string getScraper() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the origId of the zim file.
|
|
||||||
*
|
|
||||||
* The origId is only used in the case of patch zim file and is the Id
|
|
||||||
* of the original zim file.
|
|
||||||
*
|
|
||||||
* @return The origId of the zim file as specified in the zim metadata.
|
|
||||||
*/
|
|
||||||
string getOrigId() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the favicon of the zim file.
|
* Get the favicon of the zim file.
|
||||||
*
|
*
|
||||||
|
|
|
@ -238,11 +238,6 @@ string Reader::getScraper() const
|
||||||
}
|
}
|
||||||
#undef METADATA
|
#undef METADATA
|
||||||
|
|
||||||
string Reader::getOrigId() const
|
|
||||||
{
|
|
||||||
return kiwix::getArchiveOrigId(*zimArchive);
|
|
||||||
}
|
|
||||||
|
|
||||||
Entry Reader::getEntryFromPath(const std::string& path) const
|
Entry Reader::getEntryFromPath(const std::string& path) const
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -94,32 +94,7 @@ std::string getMetaFlavour(const zim::Archive& archive) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getArchiveId(const zim::Archive& archive) {
|
std::string getArchiveId(const zim::Archive& archive) {
|
||||||
std::ostringstream s;
|
return (std::string) archive.getUuid();
|
||||||
s << archive.getUuid();
|
|
||||||
return s.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getArchiveOrigId(const zim::Archive& archive) {
|
|
||||||
std::string value = getMetadata(archive, "startfileuid");
|
|
||||||
if (value.empty()) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
std::string id = value;
|
|
||||||
std::string origID;
|
|
||||||
std::string temp = "";
|
|
||||||
unsigned int k = 0;
|
|
||||||
char tempArray[16] = "";
|
|
||||||
for (unsigned int i = 0; i < id.size(); i++) {
|
|
||||||
if (id[i] == '\n') {
|
|
||||||
tempArray[k] = atoi(temp.c_str());
|
|
||||||
temp = "";
|
|
||||||
k++;
|
|
||||||
} else {
|
|
||||||
temp += id[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
origID = (std::string) zim::Uuid::generate(tempArray);
|
|
||||||
return origID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getArchiveFavicon(const zim::Archive& archive,
|
bool getArchiveFavicon(const zim::Archive& archive,
|
||||||
|
|
|
@ -41,7 +41,6 @@ namespace kiwix
|
||||||
std::string getMetaPublisher(const zim::Archive& archive);
|
std::string getMetaPublisher(const zim::Archive& archive);
|
||||||
std::string getMetaFlavour(const zim::Archive& archive);
|
std::string getMetaFlavour(const zim::Archive& archive);
|
||||||
std::string getArchiveId(const zim::Archive& archive);
|
std::string getArchiveId(const zim::Archive& archive);
|
||||||
std::string getArchiveOrigId(const zim::Archive& archive);
|
|
||||||
|
|
||||||
bool getArchiveFavicon(const zim::Archive& archive,
|
bool getArchiveFavicon(const zim::Archive& archive,
|
||||||
std::string& content, std::string& mimeType);
|
std::string& content, std::string& mimeType);
|
||||||
|
|
Loading…
Reference in New Issue