Wt
4.12.1
|
An abstract base class storing information of a resource. More...
Public Member Functions | |
virtual std::string | filePath () const |
Returns a path to a file containing the data. More... | |
virtual std::string | url () const |
Returns the URL of the data. 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 | hasFilePath () const |
Returns whether this contains a path to a file. More... | |
virtual bool | hasUrl () const |
Returns whether this contains a URL. More... | |
virtual bool | hasDataUri () const |
Returns whether this can return the data in data URI format. More... | |
An abstract base class storing information of a resource.
This is an abstract class which is meant to store/compute information about a resource/file. Its primary use is to map URIs to file paths. This is to avoid confusion when rendering out these resources, so that depending on the context the resources is created under, locating the file correctly happens.
|
virtual |
Returns the data in data URI format.
This returns the data in data URI format (see: https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data).
By default this will throw an exception.
Reimplemented in Wt::WDataInfo.
|
virtual |
Returns a path to a file containing the data.
This returns a path to a file containing the data. This should point to a path that exists on the system.
By default this will throw an exception.
Reimplemented in Wt::WDocRootDataInfo, and Wt::WDataInfo.
|
virtual |
Returns whether this can return the data in data URI format.
This returns whether dataUri() returns the data in data URI format.
By default this returns false
.
Reimplemented in Wt::WDataInfo.
|
virtual |
Returns whether this contains a path to a file.
This returns whether filePath returns a path to a file containing the data.
By default this returns false
.
Reimplemented in Wt::WDocRootDataInfo, and Wt::WDataInfo.
|
virtual |
Returns whether this contains a URL.
This returns whether url() returns a URL of the data.
By default this returns false
.
Reimplemented in Wt::WDocRootDataInfo, and Wt::WDataInfo.
|
virtual |
Returns the name of the Data.
This returns the name of the data. This is mainly use for error reporting.
By default this will return url() if hasUrl() is true
. In case it is false
, it will return filePath() if hasFilePath() is true
, and it will return an empty string otherwise.
|
virtual |
Returns the URL of the data.
This returns the URL of the data. This can be both an absolute URL or a URL relative to the application's base URL.
By default this will throw an exception.
Reimplemented in Wt::WDocRootDataInfo, and Wt::WDataInfo.