comparison OrthancServer/main.cpp @ 2018:300599489cab

USE_BOOST_LOCALE_BACKENDS
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 14 Jun 2016 15:51:00 +0200
parents bcc575732aef
children fabf7820d1f1
comparison
equal deleted inserted replaced
2017:08ce34cfacad 2018:300599489cab
31 31
32 32
33 #include "PrecompiledHeadersServer.h" 33 #include "PrecompiledHeadersServer.h"
34 #include "OrthancRestApi/OrthancRestApi.h" 34 #include "OrthancRestApi/OrthancRestApi.h"
35 35
36 #include <fstream>
37 #include <boost/algorithm/string/predicate.hpp> 36 #include <boost/algorithm/string/predicate.hpp>
38 37
39 #include "../Core/Logging.h" 38 #include "../Core/Logging.h"
40 #include "../Core/Uuid.h" 39 #include "../Core/Uuid.h"
41 #include "../Core/HttpServer/EmbeddedResourceHttpHandler.h" 40 #include "../Core/HttpServer/EmbeddedResourceHttpHandler.h"
1111 } 1110 }
1112 else 1111 else
1113 { 1112 {
1114 // Use the first argument that does not start with a "-" as 1113 // Use the first argument that does not start with a "-" as
1115 // the configuration file 1114 // the configuration file
1115
1116 // TODO WHAT IS THE ENCODING?
1116 configurationFile = argv[i]; 1117 configurationFile = argv[i];
1117 } 1118 }
1118 } 1119 }
1119 else if (argument == "--errors") 1120 else if (argument == "--errors")
1120 { 1121 {
1139 { 1140 {
1140 Logging::EnableTraceLevel(true); 1141 Logging::EnableTraceLevel(true);
1141 } 1142 }
1142 else if (boost::starts_with(argument, "--logdir=")) 1143 else if (boost::starts_with(argument, "--logdir="))
1143 { 1144 {
1145 // TODO WHAT IS THE ENCODING?
1144 std::string directory = argument.substr(9); 1146 std::string directory = argument.substr(9);
1145 1147
1146 try 1148 try
1147 { 1149 {
1148 Logging::SetTargetFolder(directory); 1150 Logging::SetTargetFolder(directory);
1154 return -1; 1156 return -1;
1155 } 1157 }
1156 } 1158 }
1157 else if (boost::starts_with(argument, "--logfile=")) 1159 else if (boost::starts_with(argument, "--logfile="))
1158 { 1160 {
1161 // TODO WHAT IS THE ENCODING?
1159 std::string file = argument.substr(10); 1162 std::string file = argument.substr(10);
1160 1163
1161 try 1164 try
1162 { 1165 {
1163 Logging::SetTargetFile(file); 1166 Logging::SetTargetFile(file);
1173 { 1176 {
1174 allowDatabaseUpgrade = true; 1177 allowDatabaseUpgrade = true;
1175 } 1178 }
1176 else if (boost::starts_with(argument, "--config=")) 1179 else if (boost::starts_with(argument, "--config="))
1177 { 1180 {
1181 // TODO WHAT IS THE ENCODING?
1178 std::string configurationSample; 1182 std::string configurationSample;
1179 GetFileResource(configurationSample, EmbeddedResources::CONFIGURATION_SAMPLE); 1183 GetFileResource(configurationSample, EmbeddedResources::CONFIGURATION_SAMPLE);
1180 1184
1181 #if defined(_WIN32) 1185 #if defined(_WIN32)
1182 // Replace UNIX newlines with DOS newlines 1186 // Replace UNIX newlines with DOS newlines