annotate Common/BaseStorage.h @ 153:6dd8bb916573

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Jun 2024 14:29:22 +0200
parents 3c7e0374f28e
children
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
145
3c7e0374f28e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
3 * Copyright (C) 2020-2023 Osimis S.A., Belgium
3c7e0374f28e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
4 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
3c7e0374f28e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
5 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
6 *
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
7 * 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
8 * 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
9 * 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
10 * 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
11 *
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
12 * 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
13 * 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
14 * 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
15 * Affero General Public License for more details.
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
16 *
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
17 * 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
18 * 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
19 **/
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
20
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 20
diff changeset
21
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
22 #pragma once
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
23
78
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
24 #include "IStorage.h"
153
6dd8bb916573 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 145
diff changeset
25
6dd8bb916573 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 145
diff changeset
26 #include <Compatibility.h>
6dd8bb916573 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 145
diff changeset
27
77
80792bb9600e new HybridMode
Alain Mazy <am@osimis.io>
parents: 70
diff changeset
28 #include <boost/filesystem.hpp>
80792bb9600e new HybridMode
Alain Mazy <am@osimis.io>
parents: 70
diff changeset
29
80792bb9600e new HybridMode
Alain Mazy <am@osimis.io>
parents: 70
diff changeset
30 namespace fs = boost::filesystem;
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
31
78
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
32 class BaseStorage : public IStorage
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
33 {
20
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
34 bool enableLegacyStorageStructure_;
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
35 std::string rootPath_;
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
36
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
37 protected:
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
38
78
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
39 BaseStorage(const std::string& nameForLogs, bool enableLegacyStorageStructure):
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
40 IStorage(nameForLogs),
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
41 enableLegacyStorageStructure_(enableLegacyStorageStructure)
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
42 {}
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
43
64
c4f56973a279 Fix reading/deleting DCM header files that were saved with plugin v 1.2.0 and Orthanc 1.9.3 which had a .unk extension
Alain Mazy <am@osimis.io>
parents: 56
diff changeset
44 std::string GetPath(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled, bool useAlternateExtension = false);
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
45
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
46 public:
153
6dd8bb916573 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 145
diff changeset
47 virtual void SetRootPath(const std::string& rootPath) ORTHANC_OVERRIDE
20
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
48 {
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
49 rootPath_ = rootPath;
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
50 }
968eb1c78aed Added 'RootPath' configuration
Alain Mazy
parents: 15
diff changeset
51
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
52 static std::string GetPath(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled, bool legacyFileStructure, const std::string& rootFolder);
77
80792bb9600e new HybridMode
Alain Mazy <am@osimis.io>
parents: 70
diff changeset
53 static fs::path GetOrthancFileSystemPath(const std::string& uuid, const std::string& fileSystemRootPath);
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
54
70
16e419fe80c5 Google & Azure: Added the "EnableLegacyUnknownFiles" configuration option
Alain Mazy <am@osimis.io>
parents: 64
diff changeset
55 static bool ReadCommonConfiguration(bool& enableLegacyStorageStructure, bool& storageContainsUnknownFiles, const OrthancPlugins::OrthancConfiguration& pluginSection);
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents:
diff changeset
56 };