meeeeerge
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
#include <experimental/filesystem>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
@@ -36,6 +37,8 @@ using namespace Poco::Util;
|
|||||||
using namespace Poco::JSON;
|
using namespace Poco::JSON;
|
||||||
using namespace Poco;
|
using namespace Poco;
|
||||||
|
|
||||||
|
namespace fs = std::experimental::filesystem;
|
||||||
|
|
||||||
FlippRServer::FlippRServer() :
|
FlippRServer::FlippRServer() :
|
||||||
help_requested(false),
|
help_requested(false),
|
||||||
input_port(9980),
|
input_port(9980),
|
||||||
@@ -197,6 +200,19 @@ TCPServer* FlippRServer::build_input_server()
|
|||||||
return new TCPServer(new input::InputSocketHandlerFactory(this->input_driver), port);
|
return new TCPServer(new input::InputSocketHandlerFactory(this->input_driver), port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string FlippRServer::create_directory(std::string file_name)
|
||||||
|
{
|
||||||
|
std::string runtime_dir = this->get_runtime_dir();
|
||||||
|
|
||||||
|
fs::path path = runtime_dir + file_name;
|
||||||
|
if(!fs::exists(path))
|
||||||
|
{
|
||||||
|
fs::create_directory(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
void FlippRServer::defineOptions(OptionSet& options)
|
void FlippRServer::defineOptions(OptionSet& options)
|
||||||
{
|
{
|
||||||
ServerApplication::defineOptions(options);
|
ServerApplication::defineOptions(options);
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
void initialize_output_driver();
|
void initialize_output_driver();
|
||||||
void initialize_input_driver();
|
void initialize_input_driver();
|
||||||
|
|
||||||
|
std::string create_directory(std::string file_name);
|
||||||
void parse_server_config_file();
|
void parse_server_config_file();
|
||||||
|
|
||||||
std::string get_runtime_dir();
|
std::string get_runtime_dir();
|
||||||
|
|||||||
Reference in New Issue
Block a user