comparison OrthancFramework/Sources/HttpServer/WebDavStorage.h @ 4230:b313a0001893

WebDavStorage
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 06 Oct 2020 18:14:26 +0200
parents
children 688435755466
comparison
equal deleted inserted replaced
4229:013d6c6b2387 4230:b313a0001893
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program. If not, see
19 * <http://www.gnu.org/licenses/>.
20 **/
21
22
23
24 #pragma once
25
26 #include "IWebDavBucket.h"
27
28 #include <boost/thread/recursive_mutex.hpp>
29
30 namespace Orthanc
31 {
32 class WebDavStorage : public IWebDavBucket
33 {
34 private:
35 class StorageFile;
36 class StorageFolder;
37
38 StorageFolder* LookupParentFolder(const std::vector<std::string>& path);
39
40 boost::shared_ptr<StorageFolder> root_; // PImpl
41 boost::recursive_mutex mutex_;
42 bool isMemory_;
43
44 public:
45 WebDavStorage(bool isMemory);
46
47 virtual bool IsExistingFolder(const std::vector<std::string>& path) ORTHANC_OVERRIDE;
48
49 virtual bool ListCollection(Collection& collection,
50 const std::vector<std::string>& path) ORTHANC_OVERRIDE;
51
52 virtual bool GetFileContent(MimeType& mime,
53 std::string& content,
54 boost::posix_time::ptime& modificationTime,
55 const std::vector<std::string>& path) ORTHANC_OVERRIDE;
56
57 virtual bool StoreFile(const std::string& content,
58 const std::vector<std::string>& path) ORTHANC_OVERRIDE;
59
60 virtual bool CreateFolder(const std::vector<std::string>& path) ORTHANC_OVERRIDE;
61
62 virtual void Start() ORTHANC_OVERRIDE
63 {
64 }
65
66 virtual void Stop() ORTHANC_OVERRIDE
67 {
68 }
69 };
70 }