Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.cpp @ 2127:bfa92c9328d7
cleaning up
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 13:59:36 +0100 |
parents | 2b1520efa282 |
children | 9329ba17a069 |
comparison
equal
deleted
inserted
replaced
2126:03b065778fc3 | 2127:bfa92c9328d7 |
---|---|
366 throw; | 366 throw; |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 void ServerContext::ReadDicomAsJson(std::string& result, | |
372 const std::string& instancePublicId) | |
373 { | |
374 ReadFile(result, instancePublicId, FileContentType_DicomAsJson, true /* decompress if needed */); | |
375 } | |
376 | |
377 | |
371 void ServerContext::ReadDicomAsJson(Json::Value& result, | 378 void ServerContext::ReadDicomAsJson(Json::Value& result, |
372 const std::string& instancePublicId) | 379 const std::string& instancePublicId) |
373 { | 380 { |
374 std::string s; | 381 std::string tmp; |
375 ReadFile(s, instancePublicId, FileContentType_DicomAsJson, true /* decompress if needed */); | 382 ReadDicomAsJson(tmp, instancePublicId); |
376 | 383 |
377 Json::Reader reader; | 384 Json::Reader reader; |
378 if (!reader.parse(s, result)) | 385 if (!reader.parse(tmp, result)) |
379 { | 386 { |
380 throw OrthancException(ErrorCode_CorruptedFile); | 387 throw OrthancException(ErrorCode_CorruptedFile); |
381 } | 388 } |
382 } | 389 } |
383 | 390 |