Mercurial > hg > orthanc
comparison OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h @ 4298:db3932f9660d
abi continued
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 18:21:03 +0100 |
parents | 2d5209153b32 |
children | 0a4347203a7e |
comparison
equal
deleted
inserted
replaced
4297:785a2713323e | 4298:db3932f9660d |
---|---|
38 size_t chunkSize_; | 38 size_t chunkSize_; |
39 | 39 |
40 void Initialize(const boost::filesystem::path& path); | 40 void Initialize(const boost::filesystem::path& path); |
41 | 41 |
42 public: | 42 public: |
43 explicit FilesystemHttpSender(const std::string& path) | 43 explicit FilesystemHttpSender(const std::string& path); |
44 { | |
45 Initialize(path); | |
46 } | |
47 | 44 |
48 explicit FilesystemHttpSender(const boost::filesystem::path& path) | 45 explicit FilesystemHttpSender(const boost::filesystem::path& path); |
49 { | |
50 Initialize(path); | |
51 } | |
52 | 46 |
53 FilesystemHttpSender(const std::string& path, | 47 FilesystemHttpSender(const std::string& path, |
54 MimeType contentType) | 48 MimeType contentType); |
55 { | |
56 SetContentType(contentType); | |
57 Initialize(path); | |
58 } | |
59 | 49 |
60 FilesystemHttpSender(const FilesystemStorage& storage, | 50 FilesystemHttpSender(const FilesystemStorage& storage, |
61 const std::string& uuid) | 51 const std::string& uuid); |
62 { | |
63 Initialize(storage.GetPath(uuid)); | |
64 } | |
65 | 52 |
66 /** | 53 /** |
67 * Implementation of the IHttpStreamAnswer interface. | 54 * Implementation of the IHttpStreamAnswer interface. |
68 **/ | 55 **/ |
69 | 56 |
70 virtual uint64_t GetContentLength() ORTHANC_OVERRIDE | 57 virtual uint64_t GetContentLength() ORTHANC_OVERRIDE; |
71 { | |
72 return size_; | |
73 } | |
74 | 58 |
75 virtual bool ReadNextChunk() ORTHANC_OVERRIDE; | 59 virtual bool ReadNextChunk() ORTHANC_OVERRIDE; |
76 | 60 |
77 virtual const char* GetChunkContent() ORTHANC_OVERRIDE | 61 virtual const char* GetChunkContent() ORTHANC_OVERRIDE; |
78 { | |
79 return chunk_.c_str(); | |
80 } | |
81 | 62 |
82 virtual size_t GetChunkSize() ORTHANC_OVERRIDE | 63 virtual size_t GetChunkSize() ORTHANC_OVERRIDE; |
83 { | |
84 return chunkSize_; | |
85 } | |
86 }; | 64 }; |
87 } | 65 } |