Mercurial > hg > orthanc
comparison Core/FileStorage/StorageAccessor.h @ 2394:75c779ca948c
fix compilation without Web server
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Aug 2017 16:23:10 +0200 |
parents | a3a65de1840f |
children | 5edec967055e |
comparison
equal
deleted
inserted
replaced
2393:807ddffc0eeb | 2394:75c779ca948c |
---|---|
31 **/ | 31 **/ |
32 | 32 |
33 | 33 |
34 #pragma once | 34 #pragma once |
35 | 35 |
36 #if !defined(ORTHANC_ENABLE_CIVETWEB) | |
37 # error Macro ORTHANC_ENABLE_CIVETWEB must be defined to use this file | |
38 #endif | |
39 | |
40 #if !defined(ORTHANC_ENABLE_MONGOOSE) | |
41 # error Macro ORTHANC_ENABLE_MONGOOSE must be defined to use this file | |
42 #endif | |
43 | |
36 #include "IStorageArea.h" | 44 #include "IStorageArea.h" |
37 #include "FileInfo.h" | 45 #include "FileInfo.h" |
38 #include "../HttpServer/BufferHttpSender.h" | 46 |
39 #include "../RestApi/RestApiOutput.h" | 47 #if ORTHANC_ENABLE_CIVETWEB == 1 || ORTHANC_ENABLE_MONGOOSE == 1 |
48 # include "../HttpServer/BufferHttpSender.h" | |
49 # include "../RestApi/RestApiOutput.h" | |
50 #endif | |
40 | 51 |
41 #include <vector> | 52 #include <vector> |
42 #include <string> | 53 #include <string> |
43 #include <boost/noncopyable.hpp> | 54 #include <boost/noncopyable.hpp> |
44 #include <stdint.h> | 55 #include <stdint.h> |
49 class StorageAccessor : boost::noncopyable | 60 class StorageAccessor : boost::noncopyable |
50 { | 61 { |
51 private: | 62 private: |
52 IStorageArea& area_; | 63 IStorageArea& area_; |
53 | 64 |
65 #if ORTHANC_ENABLE_CIVETWEB == 1 || ORTHANC_ENABLE_MONGOOSE == 1 | |
54 void SetupSender(BufferHttpSender& sender, | 66 void SetupSender(BufferHttpSender& sender, |
55 const FileInfo& info, | 67 const FileInfo& info, |
56 const std::string& mime); | 68 const std::string& mime); |
69 #endif | |
57 | 70 |
58 public: | 71 public: |
59 StorageAccessor(IStorageArea& area) : area_(area) | 72 StorageAccessor(IStorageArea& area) : area_(area) |
60 { | 73 { |
61 } | 74 } |
84 void Remove(const FileInfo& info) | 97 void Remove(const FileInfo& info) |
85 { | 98 { |
86 area_.Remove(info.GetUuid(), info.GetContentType()); | 99 area_.Remove(info.GetUuid(), info.GetContentType()); |
87 } | 100 } |
88 | 101 |
102 #if ORTHANC_ENABLE_CIVETWEB == 1 || ORTHANC_ENABLE_MONGOOSE == 1 | |
89 void AnswerFile(HttpOutput& output, | 103 void AnswerFile(HttpOutput& output, |
90 const FileInfo& info, | 104 const FileInfo& info, |
91 const std::string& mime); | 105 const std::string& mime); |
92 | 106 |
93 void AnswerFile(RestApiOutput& output, | 107 void AnswerFile(RestApiOutput& output, |
94 const FileInfo& info, | 108 const FileInfo& info, |
95 const std::string& mime); | 109 const std::string& mime); |
110 #endif | |
96 }; | 111 }; |
97 } | 112 } |