comparison Resources/Orthanc/Core/SystemToolbox.cpp @ 202:e7f90aba3c97

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 26 Mar 2018 18:10:34 +0200
parents 03afbee0cc7b
children 795d71f66f31
comparison
equal deleted inserted replaced
201:e9c7a78a3e77 202:e7f90aba3c97
180 void SystemToolbox::ReadFile(std::string& content, 180 void SystemToolbox::ReadFile(std::string& content,
181 const std::string& path) 181 const std::string& path)
182 { 182 {
183 if (!IsRegularFile(path)) 183 if (!IsRegularFile(path))
184 { 184 {
185 LOG(ERROR) << std::string("The path does not point to a regular file: ") << path; 185 LOG(ERROR) << "The path does not point to a regular file: " << path;
186 throw OrthancException(ErrorCode_RegularFileExpected); 186 throw OrthancException(ErrorCode_RegularFileExpected);
187 } 187 }
188 188
189 boost::filesystem::ifstream f; 189 boost::filesystem::ifstream f;
190 f.open(path, std::ifstream::in | std::ifstream::binary); 190 f.open(path, std::ifstream::in | std::ifstream::binary);
208 const std::string& path, 208 const std::string& path,
209 size_t headerSize) 209 size_t headerSize)
210 { 210 {
211 if (!IsRegularFile(path)) 211 if (!IsRegularFile(path))
212 { 212 {
213 LOG(ERROR) << std::string("The path does not point to a regular file: ") << path; 213 LOG(ERROR) << "The path does not point to a regular file: " << path;
214 throw OrthancException(ErrorCode_RegularFileExpected); 214 throw OrthancException(ErrorCode_RegularFileExpected);
215 } 215 }
216 216
217 boost::filesystem::ifstream f; 217 boost::filesystem::ifstream f;
218 f.open(path, std::ifstream::in | std::ifstream::binary); 218 f.open(path, std::ifstream::in | std::ifstream::binary);