Move back used helper functions to the public API.

- Add docstring
- Move the declaration in kiwix namespace.
- Adapt our include to include the right headers.
This commit is contained in:
Matthieu Gautier
2021-06-30 15:22:58 +02:00
parent 09d843da3a
commit b70c92cade
19 changed files with 249 additions and 97 deletions

View File

@ -5,7 +5,7 @@
#include "../include/manager.h"
#include "../include/server.h"
#include "../include/name_mapper.h"
#include "../src/tools/pathTools.h"
#include "../include/tools.h"
using TestContextImpl = std::vector<std::pair<std::string, std::string> >;
struct TestContext : TestContextImpl {
@ -81,8 +81,8 @@ private: // data
ZimFileServer::ZimFileServer(int serverPort, std::string libraryFilePath)
: manager(&this->library)
{
if ( isRelativePath(libraryFilePath) )
libraryFilePath = computeAbsolutePath(getCurrentDirectory(), libraryFilePath);
if ( kiwix::isRelativePath(libraryFilePath) )
libraryFilePath = kiwix::computeAbsolutePath(kiwix::getCurrentDirectory(), libraryFilePath);
manager.readFile(libraryFilePath, true, true);
run(serverPort);