Mercurial > hg > orthanc-dicomweb
changeset 103:cf5002bc63a8
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 28 Jan 2016 17:09:48 +0100 |
parents | 5e87ad1c7d7d |
children | 4274441e21d4 |
files | Orthanc/Core/Enumerations.cpp Orthanc/Core/Enumerations.h Orthanc/Core/Toolbox.cpp Orthanc/Core/Toolbox.h |
diffstat | 4 files changed, 31 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Orthanc/Core/Enumerations.cpp Mon Jan 04 14:27:19 2016 +0100 +++ b/Orthanc/Core/Enumerations.cpp Thu Jan 28 17:09:48 2016 +0100 @@ -897,7 +897,7 @@ std::string s = specificCharacterSet; Toolbox::ToUpperCase(s); - // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/ + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 // https://github.com/dcm4che/dcm4che/blob/master/dcm4che-core/src/main/java/org/dcm4che3/data/SpecificCharacterSet.java if (s == "ISO_IR 6" || s == "ISO_IR 192" || @@ -1046,7 +1046,7 @@ const char* GetDicomSpecificCharacterSet(Encoding encoding) { - // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/ + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 switch (encoding) { case Encoding_Utf8:
--- a/Orthanc/Core/Enumerations.h Mon Jan 04 14:27:19 2016 +0100 +++ b/Orthanc/Core/Enumerations.h Thu Jan 28 17:09:48 2016 +0100 @@ -314,7 +314,8 @@ }; - // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/ + // Specific Character Sets + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 enum Encoding { Encoding_Ascii, @@ -338,7 +339,7 @@ }; - // https://www.dabsoft.ch/dicom/3/C.7.6.3.1.2/ + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.7.6.3.1.2 enum PhotometricInterpretation { PhotometricInterpretation_ARGB, // Retired
--- a/Orthanc/Core/Toolbox.cpp Mon Jan 04 14:27:19 2016 +0100 +++ b/Orthanc/Core/Toolbox.cpp Thu Jan 28 17:09:48 2016 +0100 @@ -127,6 +127,7 @@ } #endif + void Toolbox::USleep(uint64_t microSeconds) { #if defined(_WIN32) @@ -208,7 +209,7 @@ void Toolbox::ReadFile(std::string& content, const std::string& path) { - if (!boost::filesystem::is_regular_file(path)) + if (!IsRegularFile(path)) { LOG(ERROR) << std::string("The path does not point to a regular file: ") << path; throw OrthancException(ErrorCode_RegularFileExpected); @@ -268,7 +269,7 @@ { if (boost::filesystem::exists(path)) { - if (boost::filesystem::is_regular_file(path)) + if (IsRegularFile(path)) { boost::filesystem::remove(path); } @@ -1382,5 +1383,26 @@ return static_cast<int>(getpid()); #endif } + + + bool Toolbox::IsRegularFile(const std::string& path) + { + namespace fs = boost::filesystem; + + try + { + if (fs::exists(path)) + { + fs::file_status status = fs::status(path); + return (status.type() == boost::filesystem::regular_file || + status.type() == boost::filesystem::reparse_file); // Fix BitBucket issue #11 + } + } + catch (fs::filesystem_error&) + { + } + + return false; + } }