Mercurial > hg > orthanc
comparison Core/FileStorage/FilesystemStorage.cpp @ 1124:790ff7a5b3bf
IStorageArea abstraction
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Sep 2014 16:28:34 +0200 |
parents | 6c5a77637b23 |
children | bf67431a7383 |
comparison
equal
deleted
inserted
replaced
1123:6c5a77637b23 | 1124:790ff7a5b3bf |
---|---|
141 | 141 |
142 return uuid; | 142 return uuid; |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 std::string FilesystemStorage::Create(const std::vector<uint8_t>& content) | |
147 { | |
148 if (content.size() == 0) | |
149 return Create(NULL, 0); | |
150 else | |
151 return Create(&content[0], content.size()); | |
152 } | |
153 | |
154 std::string FilesystemStorage::Create(const std::string& content) | |
155 { | |
156 if (content.size() == 0) | |
157 return Create(NULL, 0); | |
158 else | |
159 return Create(&content[0], content.size()); | |
160 } | |
161 | |
162 void FilesystemStorage::Read(std::string& content, | 146 void FilesystemStorage::Read(std::string& content, |
163 const std::string& uuid) const | 147 const std::string& uuid) const |
164 { | 148 { |
165 content.clear(); | 149 content.clear(); |
166 Toolbox::ReadFile(content, GetPath(uuid).string()); | 150 Toolbox::ReadFile(content, GetPath(uuid).string()); |
167 } | 151 } |
168 | 152 |