Mercurial > hg > orthanc
comparison Core/Toolbox.cpp @ 803:4689e400e0fa
directory to store the results of the unit tests
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 May 2014 09:29:11 +0200 |
parents | ecedd89055db |
children | 8ce2f69436ca |
comparison
equal
deleted
inserted
replaced
802:82b07ab959f4 | 803:4689e400e0fa |
---|---|
822 { | 822 { |
823 throw OrthancException(ErrorCode_BadFileFormat); | 823 throw OrthancException(ErrorCode_BadFileFormat); |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
827 | |
828 void Toolbox::CreateDirectory(const std::string& path) | |
829 { | |
830 if (boost::filesystem::exists(path)) | |
831 { | |
832 if (!boost::filesystem::is_directory(path)) | |
833 { | |
834 throw OrthancException("Cannot create the directory over an existing file: " + path); | |
835 } | |
836 } | |
837 else | |
838 { | |
839 if (!boost::filesystem::create_directories(path)) | |
840 { | |
841 throw OrthancException("Unable to create the directory: " + path); | |
842 } | |
843 } | |
844 } | |
827 } | 845 } |
828 | 846 |