/src/wt/src/Wt/WDataInfo.C
Line | Count | Source |
1 | | /* |
2 | | * Copyright (C) 2025 Emweb bv, Herent, Belgium. |
3 | | * |
4 | | * See the LICENSE file for terms of use. |
5 | | */ |
6 | | |
7 | | #include "Wt/WDataInfo.h" |
8 | | |
9 | | #include "Wt/WException.h" |
10 | | |
11 | | namespace Wt { |
12 | | |
13 | | WDataInfo::WDataInfo() |
14 | 0 | { } |
15 | | |
16 | | WDataInfo::WDataInfo(const std::string& url, const std::string& filePath) |
17 | 0 | : url_(url), |
18 | 0 | filePath_(filePath) |
19 | 0 | { } |
20 | | |
21 | | WDataInfo::~WDataInfo() |
22 | 0 | { } |
23 | | |
24 | | void WDataInfo::setFilePath(const std::string& filePath) |
25 | 0 | { |
26 | 0 | filePath_ = filePath; |
27 | 0 | } |
28 | | |
29 | | std::string WDataInfo::filePath() const |
30 | 0 | { |
31 | 0 | if (hasFilePath()) { |
32 | 0 | return filePath_; |
33 | 0 | } |
34 | 0 | return WAbstractDataInfo::filePath(); |
35 | 0 | } |
36 | | |
37 | | void WDataInfo::setUrl(const std::string& url) |
38 | 0 | { |
39 | 0 | url_ = url; |
40 | 0 | } |
41 | | |
42 | | std::string WDataInfo::url() const |
43 | 0 | { |
44 | 0 | if (hasUrl()) { |
45 | 0 | return url_; |
46 | 0 | } |
47 | 0 | return WAbstractDataInfo::url(); |
48 | 0 | } |
49 | | |
50 | | void WDataInfo::setDataUri(const std::string& dataUri) |
51 | 0 | { |
52 | 0 | dataUri_ = dataUri; |
53 | 0 | } |
54 | | |
55 | | std::string WDataInfo::dataUri() const |
56 | 0 | { |
57 | 0 | if (hasDataUri()) { |
58 | 0 | return dataUri_; |
59 | 0 | } |
60 | 0 | return WAbstractDataInfo::dataUri(); |
61 | 0 | } |
62 | | |
63 | | } |