Wt
4.12.1
|
A class that stores information of a file in the docroot. More...
Public Member Functions | |
WDocRootDataInfo (const std::string &path) | |
Creates a WDocRootDataInfo. More... | |
void | setRelativePath (const std::string &path) |
Set the path, which should be relative to the WApplication's docroot . | |
std::string | filePath () const override |
Returns a path to a file containing the data. More... | |
std::string | url () const override |
Returns the URL of the data. More... | |
bool | hasFilePath () const override |
Returns whether this contains a file path. More... | |
bool | hasUrl () const override |
Returns whether this contains a url. More... | |
![]() | |
virtual std::string | dataUri () const |
Returns the data in data URI format. More... | |
virtual std::string | name () const |
Returns the name of the Data. More... | |
virtual bool | hasDataUri () const |
Returns whether this can return the data in data URI format. More... | |
A class that stores information of a file in the docroot.
This class stores the URL and the file path of a file inside of the docroot.
When providing a path to the constructor, the path ought to be relative to the docroot
of the WApplication.
The URL will contain the URL relative to the application's base URL, and the file path will contain the absolute path to the file in the docroot.
Wt::WDocRootDataInfo::WDocRootDataInfo | ( | const std::string & | path | ) |
Creates a WDocRootDataInfo.
Creates a WDocRootDataInfo with the given path
. The path must be relative to the WApplication's docroot
.
|
overridevirtual |
Returns a path to a file containing the data.
Throws if the path
provided to the constructor or set with setRelativePath() was an empty string.
Reimplemented from Wt::WAbstractDataInfo.
|
overridevirtual |
Returns whether this contains a file path.
This returns whether the path
provided to the constructor or set with setRelativePath() was a non-empty string.
Reimplemented from Wt::WAbstractDataInfo.
|
overridevirtual |
Returns whether this contains a url.
This returns whether the path
provided to the constructor or set with setRelativePath() was a non-empty string.
Reimplemented from Wt::WAbstractDataInfo.
|
overridevirtual |
Returns the URL of the data.
Throws if the path
provided to the constructor or set with setRelativePath() was an empty string.
Reimplemented from Wt::WAbstractDataInfo.