Mercurial > hg > orthanc
comparison Core/FileStorage/StorageAccessor.cpp @ 1750:55d52567bebb db-changes
LookupResource implemented
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 27 Oct 2015 12:45:50 +0100 |
parents | 2c7d5eb588e6 |
children | 53e045b5a8ec |
comparison
equal
deleted
inserted
replaced
1749:99f4a05f39fa | 1750:55d52567bebb |
---|---|
124 | 124 |
125 // TODO Check the validity of the uncompressed MD5? | 125 // TODO Check the validity of the uncompressed MD5? |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 void StorageAccessor::Read(Json::Value& content, | |
130 const FileInfo& info) | |
131 { | |
132 std::string s; | |
133 Read(s, info); | |
134 | |
135 Json::Reader reader; | |
136 if (!reader.parse(s, content)) | |
137 { | |
138 throw OrthancException(ErrorCode_BadFileFormat); | |
139 } | |
140 } | |
141 | |
142 | |
129 void StorageAccessor::SetupSender(BufferHttpSender& sender, | 143 void StorageAccessor::SetupSender(BufferHttpSender& sender, |
130 const FileInfo& info) | 144 const FileInfo& info) |
131 { | 145 { |
132 area_.Read(sender.GetBuffer(), info.GetUuid(), info.GetContentType()); | 146 area_.Read(sender.GetBuffer(), info.GetUuid(), info.GetContentType()); |
133 sender.SetContentType(GetMimeType(info.GetContentType())); | 147 sender.SetContentType(GetMimeType(info.GetContentType())); |