Mercurial > hg > orthanc
comparison OrthancFramework/Sources/HttpServer/FilesystemHttpSender.cpp @ 4298:db3932f9660d
abi continued
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 18:21:03 +0100 |
parents | bf7b9edf6b81 |
children | d9473bd5ed43 |
comparison
equal
deleted
inserted
replaced
4297:785a2713323e | 4298:db3932f9660d |
---|---|
41 file_.seekg(0, file_.end); | 41 file_.seekg(0, file_.end); |
42 size_ = file_.tellg(); | 42 size_ = file_.tellg(); |
43 file_.seekg(0, file_.beg); | 43 file_.seekg(0, file_.beg); |
44 } | 44 } |
45 | 45 |
46 FilesystemHttpSender::FilesystemHttpSender(const std::string& path) | |
47 { | |
48 Initialize(path); | |
49 } | |
50 | |
51 FilesystemHttpSender::FilesystemHttpSender(const boost::filesystem::path& path) | |
52 { | |
53 Initialize(path); | |
54 } | |
55 | |
56 FilesystemHttpSender::FilesystemHttpSender(const std::string& path, | |
57 MimeType contentType) | |
58 { | |
59 SetContentType(contentType); | |
60 Initialize(path); | |
61 } | |
62 | |
63 FilesystemHttpSender::FilesystemHttpSender(const FilesystemStorage& storage, | |
64 const std::string& uuid) | |
65 { | |
66 Initialize(storage.GetPath(uuid)); | |
67 } | |
68 | |
69 uint64_t FilesystemHttpSender::GetContentLength() | |
70 { | |
71 return size_; | |
72 } | |
73 | |
46 | 74 |
47 bool FilesystemHttpSender::ReadNextChunk() | 75 bool FilesystemHttpSender::ReadNextChunk() |
48 { | 76 { |
49 if (chunk_.size() == 0) | 77 if (chunk_.size() == 0) |
50 { | 78 { |
61 | 89 |
62 chunkSize_ = static_cast<size_t>(file_.gcount()); | 90 chunkSize_ = static_cast<size_t>(file_.gcount()); |
63 | 91 |
64 return chunkSize_ > 0; | 92 return chunkSize_ > 0; |
65 } | 93 } |
94 | |
95 const char *FilesystemHttpSender::GetChunkContent() | |
96 { | |
97 return chunk_.c_str(); | |
98 } | |
99 | |
100 size_t FilesystemHttpSender::GetChunkSize() | |
101 { | |
102 return chunkSize_; | |
103 } | |
66 } | 104 } |