Introduce readLanguagesFromFeed()

Added a new function to read languages stored in an OPDS feed
This commit is contained in:
Nikhil Tanwar
2023-07-11 15:42:51 +05:30
parent 7feb89c30e
commit a28c2973e9
3 changed files with 51 additions and 0 deletions

View File

@ -26,6 +26,8 @@
#include <cstdint>
namespace kiwix {
typedef std::pair<std::string, std::string> LangNameCodePair;
typedef std::vector<LangNameCodePair> FeedLanguages;
/**
* Return the current directory.
@ -226,5 +228,12 @@ std::string getBestPublicIp();
*/
std::string beautifyFileSize(uint64_t number);
/**
* Load languages stored in an OPDS stream.
*
* @param content the OPDS stream.
* @return vector containing pairs of language code and their corresponding full language name.
*/
FeedLanguages readLanguagesFromFeed(const std::string& content);
}
#endif // KIWIX_TOOLS_H