Mercurial > hg > orthanc
annotate OrthancFramework/Sources/Compression/ZipReader.h @ 5853:4d932683049d get-scu tip
very first implementation of C-Get SCU
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 29 Oct 2024 17:25:49 +0100 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
4355 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4355 | 8 * |
9 * This program is free software: you can redistribute it and/or | |
10 * modify it under the terms of the GNU Lesser General Public License | |
11 * as published by the Free Software Foundation, either version 3 of | |
12 * the License, or (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, but | |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 * Lesser General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU Lesser General Public | |
20 * License along with this program. If not, see | |
21 * <http://www.gnu.org/licenses/>. | |
22 **/ | |
23 | |
24 | |
25 #pragma once | |
26 | |
27 #include "../OrthancFramework.h" | |
28 | |
29 #if !defined(ORTHANC_SANDBOXED) | |
30 # error The macro ORTHANC_SANDBOXED must be defined | |
31 #endif | |
32 | |
33 #if !defined(ORTHANC_ENABLE_ZLIB) | |
34 # error The macro ORTHANC_ENABLE_ZLIB must be defined | |
35 #endif | |
36 | |
37 #if ORTHANC_ENABLE_ZLIB != 1 | |
38 # error ZLIB support must be enabled to include this file | |
39 #endif | |
40 | |
41 | |
42 #include <stdint.h> | |
43 #include <string> | |
44 #include <boost/noncopyable.hpp> | |
45 #include <boost/shared_ptr.hpp> | |
46 | |
47 | |
48 namespace Orthanc | |
49 { | |
50 class ORTHANC_PUBLIC ZipReader : public boost::noncopyable | |
51 { | |
52 private: | |
53 class MemoryBuffer; | |
54 | |
55 struct PImpl; | |
56 boost::shared_ptr<PImpl> pimpl_; | |
57 | |
58 ZipReader(); | |
59 | |
60 void SeekFirst(); | |
61 | |
62 public: | |
63 ~ZipReader(); | |
64 | |
65 uint64_t GetFilesCount() const; | |
66 | |
4356 | 67 bool ReadNextFile(std::string& filename, |
68 std::string& content); | |
4355 | 69 |
70 static ZipReader* CreateFromMemory(const void* buffer, | |
71 size_t size); | |
72 | |
73 static ZipReader* CreateFromMemory(const std::string& buffer); | |
74 | |
75 #if ORTHANC_SANDBOXED != 1 | |
76 static ZipReader* CreateFromFile(const std::string& path); | |
77 #endif | |
78 | |
79 static bool IsZipMemoryBuffer(const void* buffer, | |
80 size_t size); | |
81 | |
82 static bool IsZipMemoryBuffer(const std::string& content); | |
83 | |
84 #if ORTHANC_SANDBOXED != 1 | |
85 static bool IsZipFile(const std::string& path); | |
86 #endif | |
87 }; | |
88 } |