Mercurial > hg > orthanc
comparison Core/SystemToolbox.cpp @ 2933:4a38d7d4f0e0
new class: OrthancConfiguration
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 27 Nov 2018 17:08:48 +0100 |
parents | ad0e7def3338 |
children | d924f9bb61cc |
comparison
equal
deleted
inserted
replaced
2931:89f2c302fc37 | 2933:4a38d7d4f0e0 |
---|---|
708 std::string value = v.substr(pos + 1); | 708 std::string value = v.substr(pos + 1); |
709 env[key] = value; | 709 env[key] = value; |
710 } | 710 } |
711 } | 711 } |
712 } | 712 } |
713 | |
714 | |
715 std::string SystemToolbox::InterpretRelativePath(const std::string& baseDirectory, | |
716 const std::string& relativePath) | |
717 { | |
718 boost::filesystem::path base(baseDirectory); | |
719 boost::filesystem::path relative(relativePath); | |
720 | |
721 /** | |
722 The following lines should be equivalent to this one: | |
723 | |
724 return (base / relative).string(); | |
725 | |
726 However, for some unknown reason, some versions of Boost do not | |
727 make the proper path resolution when "baseDirectory" is an | |
728 absolute path. So, a hack is used below. | |
729 **/ | |
730 | |
731 if (relative.is_absolute()) | |
732 { | |
733 return relative.string(); | |
734 } | |
735 else | |
736 { | |
737 return (base / relative).string(); | |
738 } | |
739 } | |
713 } | 740 } |