comparison Core/FileStorage/FilesystemStorage.cpp @ 1126:bf67431a7383

handling of file content type in IStorageArea
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Sep 2014 17:01:42 +0200
parents 790ff7a5b3bf
children 67c3c1e4a6e0
comparison
equal deleted inserted replaced
1125:20ddab7e9ae8 1126:bf67431a7383
83 root_ = root; 83 root_ = root;
84 84
85 Toolbox::CreateDirectory(root); 85 Toolbox::CreateDirectory(root);
86 } 86 }
87 87
88 std::string FilesystemStorage::Create(const void* content, size_t size) 88 std::string FilesystemStorage::Create(const void* content,
89 size_t size,
90 FileContentType /*type*/)
89 { 91 {
90 std::string uuid; 92 std::string uuid;
91 boost::filesystem::path path; 93 boost::filesystem::path path;
92 94
93 for (;;) 95 for (;;)
142 return uuid; 144 return uuid;
143 } 145 }
144 146
145 147
146 void FilesystemStorage::Read(std::string& content, 148 void FilesystemStorage::Read(std::string& content,
147 const std::string& uuid) const 149 const std::string& uuid,
150 FileContentType /*type*/) const
148 { 151 {
149 content.clear(); 152 content.clear();
150 Toolbox::ReadFile(content, GetPath(uuid).string()); 153 Toolbox::ReadFile(content, GetPath(uuid).string());
151 } 154 }
152 155
207 List result; 210 List result;
208 ListAllFiles(result); 211 ListAllFiles(result);
209 212
210 for (List::const_iterator it = result.begin(); it != result.end(); ++it) 213 for (List::const_iterator it = result.begin(); it != result.end(); ++it)
211 { 214 {
212 Remove(*it); 215 Remove(*it, FileContentType_Unknown /*ignored in this class*/);
213 } 216 }
214 } 217 }
215 218
216 219
217 void FilesystemStorage::Remove(const std::string& uuid) 220 void FilesystemStorage::Remove(const std::string& uuid,
221 FileContentType /*type*/)
218 { 222 {
219 LOG(INFO) << "Deleting file " << uuid; 223 LOG(INFO) << "Deleting file " << uuid;
220 namespace fs = boost::filesystem; 224 namespace fs = boost::filesystem;
221 225
222 fs::path p = GetPath(uuid); 226 fs::path p = GetPath(uuid);