annotate Common/BaseStoragePlugin.h @ 56:b922ae86bbe1

full static linking against AWS SDK
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Jun 2021 15:00:36 +0200
parents 968eb1c78aed
children c4f56973a279
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
1 /**
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
2 * Cloud storage plugins for Orthanc
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
3 * Copyright (C) 2020-2021 Osimis S.A., Belgium
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
4 *
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
5 * This program is free software: you can redistribute it and/or
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
6 * modify it under the terms of the GNU Affero General Public License
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
7 * as published by the Free Software Foundation, either version 3 of
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
8 * the License, or (at your option) any later version.
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
9 *
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
10 * This program is distributed in the hope that it will be useful, but
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
13 * Affero General Public License for more details.
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
14 *
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
15 * You should have received a copy of the GNU Affero General Public License
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
17 **/
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
18
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
19
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
20 #pragma once
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
21
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
22 #include "IStoragePlugin.h"
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
23
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
24 class BaseStoragePlugin : public IStoragePlugin
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
25 {
20
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
26 bool enableLegacyStorageStructure_;
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
27 std::string rootPath_;
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
28
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
29 protected:
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
30
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
31 BaseStoragePlugin(bool enableLegacyStorageStructure):
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
32 enableLegacyStorageStructure_(enableLegacyStorageStructure)
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
33 {}
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
34
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
35 std::string GetPath(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled);
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
36
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
37 public:
20
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
38 virtual void SetRootPath(const std::string& rootPath)
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
39 {
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
40 rootPath_ = rootPath;
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
41 }
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
42
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
43 static std::string GetPath(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled, bool legacyFileStructure, const std::string& rootFolder);
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
44 static std::string GetOrthancFileSystemPath(const std::string& uuid, const std::string& fileSystemRootPath);
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
45
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
46 static bool ReadCommonConfiguration(bool& enableLegacyStorageStructure, const OrthancPlugins::OrthancConfiguration& pluginSection);
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
47 };