Mercurial > hg > orthanc
comparison OrthancServer/main.cpp @ 2140:aa4b8895cd23
reorganization
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 16:12:47 +0100 |
parents | dd609a99d39a |
children | 5a8840920121 |
comparison
equal
deleted
inserted
replaced
2139:764c9157301b | 2140:aa4b8895cd23 |
---|---|
610 it = luaScripts.begin(); it != luaScripts.end(); ++it) | 610 it = luaScripts.begin(); it != luaScripts.end(); ++it) |
611 { | 611 { |
612 std::string path = Configuration::InterpretStringParameterAsPath(*it); | 612 std::string path = Configuration::InterpretStringParameterAsPath(*it); |
613 LOG(WARNING) << "Installing the Lua scripts from: " << path; | 613 LOG(WARNING) << "Installing the Lua scripts from: " << path; |
614 std::string script; | 614 std::string script; |
615 Toolbox::ReadFile(script, path); | 615 SystemToolbox::ReadFile(script, path); |
616 | 616 |
617 LuaScripting::Locker locker(context.GetLua()); | 617 LuaScripting::Locker locker(context.GetLua()); |
618 locker.GetLua().Execute(script); | 618 locker.GetLua().Execute(script); |
619 } | 619 } |
620 } | 620 } |
655 | 655 |
656 bool restart; | 656 bool restart; |
657 | 657 |
658 for (;;) | 658 for (;;) |
659 { | 659 { |
660 ServerBarrierEvent event = Toolbox::ServerBarrier(restApi.LeaveBarrierFlag()); | 660 ServerBarrierEvent event = SystemToolbox::ServerBarrier(restApi.LeaveBarrierFlag()); |
661 restart = restApi.IsResetRequestReceived(); | 661 restart = restApi.IsResetRequestReceived(); |
662 | 662 |
663 if (!restart && | 663 if (!restart && |
664 event == ServerBarrierEvent_Reload) | 664 event == ServerBarrierEvent_Reload) |
665 { | 665 { |
1200 // Replace UNIX newlines with DOS newlines | 1200 // Replace UNIX newlines with DOS newlines |
1201 boost::replace_all(configurationSample, "\n", "\r\n"); | 1201 boost::replace_all(configurationSample, "\n", "\r\n"); |
1202 #endif | 1202 #endif |
1203 | 1203 |
1204 std::string target = argument.substr(9); | 1204 std::string target = argument.substr(9); |
1205 Toolbox::WriteFile(configurationSample, target); | 1205 SystemToolbox::WriteFile(configurationSample, target); |
1206 return 0; | 1206 return 0; |
1207 } | 1207 } |
1208 else | 1208 else |
1209 { | 1209 { |
1210 LOG(WARNING) << "Option unsupported by the core of Orthanc: " << argument; | 1210 LOG(WARNING) << "Option unsupported by the core of Orthanc: " << argument; |
1221 | 1221 |
1222 if (std::string(ORTHANC_VERSION) == "mainline") | 1222 if (std::string(ORTHANC_VERSION) == "mainline") |
1223 { | 1223 { |
1224 try | 1224 try |
1225 { | 1225 { |
1226 boost::filesystem::path exe(Toolbox::GetPathToExecutable()); | 1226 boost::filesystem::path exe(SystemToolbox::GetPathToExecutable()); |
1227 std::time_t creation = boost::filesystem::last_write_time(exe); | 1227 std::time_t creation = boost::filesystem::last_write_time(exe); |
1228 boost::posix_time::ptime converted(boost::posix_time::from_time_t(creation)); | 1228 boost::posix_time::ptime converted(boost::posix_time::from_time_t(creation)); |
1229 version += " (" + boost::posix_time::to_iso_string(converted) + ")"; | 1229 version += " (" + boost::posix_time::to_iso_string(converted) + ")"; |
1230 } | 1230 } |
1231 catch (...) | 1231 catch (...) |