Mercurial > hg > orthanc-object-storage
annotate Common/IStoragePlugin.h @ 39:50d0be413c42
implemented ReadRange (only in Azure plugin right now)
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 17 Mar 2021 16:02:53 +0100 |
parents | f55b2afdf53d |
children | b922ae86bbe1 |
rev | line source |
---|---|
1 | 1 /** |
2 * Cloud storage plugins for Orthanc | |
37
f55b2afdf53d
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
20
diff
changeset
|
3 * Copyright (C) 2020-2021 Osimis S.A., Belgium |
1 | 4 * |
5 * This program is free software: you can redistribute it and/or | |
6 * modify it under the terms of the GNU Affero General Public License | |
7 * as published by the Free Software Foundation, either version 3 of | |
8 * the License, or (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, but | |
11 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Affero General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Affero General Public License | |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 **/ | |
18 | |
19 #pragma once | |
20 | |
21 #include <orthanc/OrthancCPlugin.h> | |
22 #include <OrthancPluginCppWrapper.h> | |
23 | |
24 class StoragePluginException : public std::runtime_error | |
25 { | |
26 public: | |
27 StoragePluginException(const std::string& what) | |
28 : std::runtime_error(what) | |
29 { | |
30 } | |
31 }; | |
32 | |
33 | |
34 | |
35 | |
36 // each "plugin" must also provide these global methods | |
37 //class XXXStoragePluginFactory | |
38 //{ | |
39 //public: | |
40 // const char* GetStoragePluginName(); | |
41 // IStoragePlugin* CreateStoragePlugin(const OrthancPlugins::OrthancConfiguration& orthancConfig); | |
42 //}; | |
43 | |
44 class IStoragePlugin | |
45 { | |
46 public: | |
47 class IWriter | |
48 { | |
49 public: | |
50 IWriter() | |
51 {} | |
52 | |
53 virtual ~IWriter() {} | |
54 virtual void Write(const char* data, size_t size) = 0; | |
55 }; | |
56 | |
57 class IReader | |
58 { | |
59 public: | |
60 IReader() | |
61 {} | |
62 | |
63 virtual ~IReader() {} | |
64 virtual size_t GetSize() = 0; | |
39
50d0be413c42
implemented ReadRange (only in Azure plugin right now)
Alain Mazy <am@osimis.io>
parents:
37
diff
changeset
|
65 virtual void ReadWhole(char* data, size_t size) = 0; |
50d0be413c42
implemented ReadRange (only in Azure plugin right now)
Alain Mazy <am@osimis.io>
parents:
37
diff
changeset
|
66 virtual void ReadRange(char* data, size_t size, size_t fromOffset) = 0; |
1 | 67 }; |
68 | |
69 public: | |
20 | 70 virtual void SetRootPath(const std::string& rootPath) = 0; |
1 | 71 |
72 virtual IWriter* GetWriterForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled) = 0; | |
73 virtual IReader* GetReaderForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled) = 0; | |
74 virtual void DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled) = 0; | |
15 | 75 virtual const char* GetConfigurationSectionName() = 0; |
1 | 76 }; |