15#include <libxml/uri.h>
16#include <libxml/xmlmemory.h>
50 explicit URI(
char const *preformed,
char const *baseuri =
nullptr);
51 explicit URI(
char const *preformed,
URI const &baseuri);
157 std::string
str(
char const *baseuri =
nullptr)
const;
176 std::string
cssStr(
char const *baseuri =
nullptr)
const {
177 return "url(" +
str(baseuri) +
")";
176 std::string
cssStr(
char const *baseuri =
nullptr)
const {
…}
183 bool hasScheme(
const char *scheme)
const;
Represents an URI as per RFC 2396.
bool isOpaque() const
Determines if the URI represented is an 'opaque' URI.
const char * getQuery() const
Return the query, which is the part between "?" and the optional fragment hash ("#")
bool isRelative() const
Determines if the URI represented is 'relative' as per RFC 2396.
const char * getScheme() const
Return the scheme, e.g. "http", or NULL if this is not an absolute URI.
bool hasScheme(const char *scheme) const
True if the scheme equals the given string (not case sensitive)
std::string cssStr(char const *baseuri=nullptr) const
Return a CSS formatted url value.
xmlURI * _xmlURIPtr() const
URI(char const *preformed, char const *baseuri=nullptr)
Constructor from a C-style ASCII string.
static URI from_dirname(char const *path)
URI of a local directory.
std::shared_ptr< xmlURI > m_shared
std::string getMimeType() const
Get the MIME type (e.g. "image/png")
static URI from_href_and_basedir(char const *href, char const *basedir)
Convenience function for the common use case given a xlink:href attribute and a local directory as th...
std::string str(char const *baseuri=nullptr) const
Return the string representation of this URI.
const char * getPath() const
Return the path.
std::string toNativeFilename() const
Convert this URI to a native filename.
bool isNetPath() const
Determines if the relative URI represented is a 'net-path' as per RFC 2396.
const char * getOpaque() const
For an opaque URI, return everything between the scheme colon (":") and the optional fragment hash ("...
bool isAbsolutePath() const
Determines if the relative URI represented is a 'absolute-path' as per RFC 2396.
static URI from_native_filename(char const *path)
Construct a "file" URI from an absolute filename.
const char * getFragment() const
Return the fragment, which is everything after "#".
std::string getContents() const
Return the contents of the file.
bool isRelativePath() const
Determines if the relative URI represented is a 'relative-path' as per RFC 2396.
Helper class to stream background task notifications as a series of messages.
std::string uri_to_iri(const char *uri)
Unescape the UTF-8 parts of the given URI.