Mercurial > hg > orthanc
comparison Core/Toolbox.cpp @ 2057:54417b0831c4
cont
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 29 Jun 2016 13:40:24 +0200 |
parents | 35ccba7adae9 |
children | ed383e7a6753 |
comparison
equal
deleted
inserted
replaced
2056:e166a902b3c4 | 2057:54417b0831c4 |
---|---|
109 #endif | 109 #endif |
110 | 110 |
111 | 111 |
112 namespace Orthanc | 112 namespace Orthanc |
113 { | 113 { |
114 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 | |
114 static bool finish_; | 115 static bool finish_; |
115 static ServerBarrierEvent barrierEvent_; | 116 static ServerBarrierEvent barrierEvent_; |
116 | 117 |
117 #if defined(_WIN32) | 118 #if defined(_WIN32) |
118 static BOOL WINAPI ConsoleControlHandler(DWORD dwCtrlType) | 119 static BOOL WINAPI ConsoleControlHandler(DWORD dwCtrlType) |
186 ServerBarrierEvent Toolbox::ServerBarrier() | 187 ServerBarrierEvent Toolbox::ServerBarrier() |
187 { | 188 { |
188 const bool stopFlag = false; | 189 const bool stopFlag = false; |
189 return ServerBarrierInternal(&stopFlag); | 190 return ServerBarrierInternal(&stopFlag); |
190 } | 191 } |
192 #endif /* ORTHANC_SANDBOXED */ | |
191 | 193 |
192 | 194 |
193 void Toolbox::ToUpperCase(std::string& s) | 195 void Toolbox::ToUpperCase(std::string& s) |
194 { | 196 { |
195 std::transform(s.begin(), s.end(), s.begin(), toupper); | 197 std::transform(s.begin(), s.end(), s.begin(), toupper); |
675 _NSGetExecutablePath( pathbuf, &bufsize); | 677 _NSGetExecutablePath( pathbuf, &bufsize); |
676 | 678 |
677 return std::string(pathbuf); | 679 return std::string(pathbuf); |
678 } | 680 } |
679 | 681 |
682 #elif defined(ORTHANC_SANDBOXED) && ORTHANC_SANDBOXED == 1 | |
683 // Sandboxed Orthanc, no access to the executable | |
684 | |
680 #else | 685 #else |
681 #error Support your platform here | 686 #error Support your platform here |
682 #endif | 687 #endif |
683 | 688 |
684 | 689 |
690 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 | |
685 std::string Toolbox::GetPathToExecutable() | 691 std::string Toolbox::GetPathToExecutable() |
686 { | 692 { |
687 boost::filesystem::path p(GetPathToExecutableInternal()); | 693 boost::filesystem::path p(GetPathToExecutableInternal()); |
688 return boost::filesystem::absolute(p).string(); | 694 return boost::filesystem::absolute(p).string(); |
689 } | 695 } |
692 std::string Toolbox::GetDirectoryOfExecutable() | 698 std::string Toolbox::GetDirectoryOfExecutable() |
693 { | 699 { |
694 boost::filesystem::path p(GetPathToExecutableInternal()); | 700 boost::filesystem::path p(GetPathToExecutableInternal()); |
695 return boost::filesystem::absolute(p.parent_path()).string(); | 701 return boost::filesystem::absolute(p.parent_path()).string(); |
696 } | 702 } |
703 #endif | |
697 | 704 |
698 | 705 |
699 static const char* GetBoostLocaleEncoding(const Encoding sourceEncoding) | 706 static const char* GetBoostLocaleEncoding(const Encoding sourceEncoding) |
700 { | 707 { |
701 switch (sourceEncoding) | 708 switch (sourceEncoding) |