// // Created by WolverinDEV on 28/04/2020. // #include "./LocalFileServer.h" using namespace ts::server; using LocalFileServer = file::LocalFileServer; std::shared_ptr server_instance{}; bool file::initialize(std::string &error) { server_instance = std::make_shared(); if(!server_instance->initialize(error)) { server_instance = nullptr; return false; } return true; } void file::finalize() { auto server = std::exchange(server_instance, nullptr); if(!server) return; server->finalize(); } std::shared_ptr file::server() { return server_instance; } LocalFileServer::~LocalFileServer() {} bool LocalFileServer::initialize(std::string &error) { if(!this->file_system_.initialize(error, "file-root/")) return false; return true; } void LocalFileServer::finalize() { } file::filesystem::AbstractProvider &LocalFileServer::file_system() { return this->file_system_; }