|
Http::UploadedFile | info_ |
WAnchor * | downloadLink_ |
| Anchor referencing the file.
|
WCheckBox * | keep_ |
| The check box to keep or discard the uploaded file.
|
Definition at line 73 of file AttachmentEdit.h.
◆ UploadInfo()
AttachmentEdit::UploadInfo::UploadInfo |
( |
const Http::UploadedFile & | f | ) |
|
Definition at line 29 of file AttachmentEdit.C.
30 : WContainerWidget(),
32{
33
34
35
36 keep_ = this->addWidget(std::make_unique<WCheckBox>());
38
39
40
41
42 std::streamsize fsize = 0;
43 {
44 std::ifstream theFile(
info_.spoolFileName().c_str());
45 theFile.seekg(0, std::ios_base::end);
46 fsize = theFile.tellg();
47 theFile.seekg(0);
48 }
49 std::u32string size;
50 if (fsize < 1024)
51 size = WString(std::to_string(fsize)) + U" bytes";
52 else
53 size = WString(std::to_string((int)(fsize / 1024)))
54 + U"kb";
55
56 std::u32string fn = static_cast<std::u32string>
57 (escapeText(WString(
info_.clientFileName())));
58
60 = this->addWidget(std::make_unique<WAnchor>(
"", fn + U
" (<i>" + WString(
info_.contentType())
61 + U"</i>) " + size));
62
63 auto res = std::make_shared<WFileResource>(
info_.contentType(),
info_.spoolFileName());
64 res->suggestFileName(
info_.clientFileName());
66}
WCheckBox * keep_
The check box to keep or discard the uploaded file.
WAnchor * downloadLink_
Anchor referencing the file.
◆ downloadLink_
WAnchor* AttachmentEdit::UploadInfo::downloadLink_ |
◆ info_
Http::UploadedFile AttachmentEdit::UploadInfo::info_ |
◆ keep_
WCheckBox* AttachmentEdit::UploadInfo::keep_ |
The check box to keep or discard the uploaded file.
Definition at line 84 of file AttachmentEdit.h.
The documentation for this class was generated from the following files: