comparison OrthancServer/Plugins/Samples/WebDavFilesystem/Plugin.cpp @ 5572:f0dc99bc811c

removed circular dependency of OrthancPluginsCppWrapper with Orthanc::Logging
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Apr 2024 15:50:01 +0200
parents 48b8dae6dc77
children f7adfb22e20e
comparison
equal deleted inserted replaced
5571:addccb1590d2 5572:f0dc99bc811c
162 { 162 {
163 std::unique_ptr<File> protection(f); 163 std::unique_ptr<File> protection(f);
164 164
165 if (content_.find(name) != content_.end()) 165 if (content_.find(name) != content_.end())
166 { 166 {
167 OrthancPlugins::LogError("Already existing: " + name); 167 ORTHANC_PLUGINS_LOG_ERROR("Already existing: " + name);
168 ORTHANC_PLUGINS_THROW_EXCEPTION(BadRequest); 168 ORTHANC_PLUGINS_THROW_EXCEPTION(BadRequest);
169 } 169 }
170 else 170 else
171 { 171 {
172 content_[name] = protection.release(); 172 content_[name] = protection.release();
175 175
176 void CreateSubfolder(const std::string& name) 176 void CreateSubfolder(const std::string& name)
177 { 177 {
178 if (content_.find(name) != content_.end()) 178 if (content_.find(name) != content_.end())
179 { 179 {
180 OrthancPlugins::LogError("Already existing: " + name); 180 ORTHANC_PLUGINS_LOG_ERROR("Already existing: " + name);
181 ORTHANC_PLUGINS_THROW_EXCEPTION(BadRequest); 181 ORTHANC_PLUGINS_THROW_EXCEPTION(BadRequest);
182 } 182 }
183 else 183 else
184 { 184 {
185 content_[name] = new Folder; 185 content_[name] = new Folder;
190 { 190 {
191 Content::iterator found = content_.find(name); 191 Content::iterator found = content_.find(name);
192 192
193 if (found == content_.end()) 193 if (found == content_.end())
194 { 194 {
195 OrthancPlugins::LogError("Cannot delete inexistent path: " + name); 195 ORTHANC_PLUGINS_LOG_ERROR("Cannot delete inexistent path: " + name);
196 ORTHANC_PLUGINS_THROW_EXCEPTION(InexistentItem); 196 ORTHANC_PLUGINS_THROW_EXCEPTION(InexistentItem);
197 } 197 }
198 else 198 else
199 { 199 {
200 assert(found->second != NULL); 200 assert(found->second != NULL);
213 213
214 static std::vector<std::string> GetParentPath(const std::vector<std::string>& path) 214 static std::vector<std::string> GetParentPath(const std::vector<std::string>& path)
215 { 215 {
216 if (path.empty()) 216 if (path.empty())
217 { 217 {
218 OrthancPlugins::LogError("Empty path"); 218 ORTHANC_PLUGINS_LOG_ERROR("Empty path");
219 ORTHANC_PLUGINS_THROW_EXCEPTION(ParameterOutOfRange); 219 ORTHANC_PLUGINS_THROW_EXCEPTION(ParameterOutOfRange);
220 } 220 }
221 else 221 else
222 { 222 {
223 std::vector<std::string> p(path.size() - 1); 223 std::vector<std::string> p(path.size() - 1);