21 #include "prtx/prtx.h" 29 # pragma warning(push) 30 # pragma warning(disable : 4251 4231 4660) 38 typedef std::shared_ptr<URI>
URIPtr;
59 class PRTX_EXPORTS_API
URI {
70 static const std::wstring QUERY_TEXTURE_WIDTH;
71 static const std::wstring QUERY_TEXTURE_HEIGHT;
72 static const std::wstring QUERY_TEXTURE_FORMAT;
73 static const std::wstring QUERY_TEXTURE_NAME;
94 static URIPtr create(
const std::wstring& fullURI);
102 virtual bool isValid()
const = 0;
107 virtual bool isFilePath()
const = 0;
115 virtual bool isComposite()
const = 0;
122 virtual URIPtr getNestedURI()
const = 0;
132 virtual const std::wstring& wstring()
const = 0;
139 virtual std::string string()
const = 0;
145 virtual std::wstring getNativeFormat()
const = 0;
154 virtual const std::wstring& getScheme()
const = 0;
159 virtual const std::wstring& getHost()
const = 0;
165 virtual std::wstring getPath()
const = 0;
171 virtual std::wstring getBaseName()
const = 0;
177 virtual const std::wstring& getExtension()
const = 0;
182 virtual bool hasQuery()
const = 0;
187 virtual const std::wstring& getQuery()
const = 0;
196 virtual std::wstring getQuery(
const std::wstring& key)
const = 0;
201 virtual bool hasFragment()
const = 0;
206 virtual const std::wstring& getFragment()
const = 0;
215 virtual std::wstring getFragment(
const std::wstring &key)
const = 0;
218 virtual ~
URI() =
default;
222 URI(
const URI&) =
default;
266 PRTX_EXPORTS_API
URIPtr createDataURI(
const std::string& mediaType,
bool base64,
const uint8_t* data,
size_t dataSize);
276 const std::wstring& outerScheme,
277 const std::wstring& outerPath,
278 const std::wstring& outerQuery = {},
279 const std::wstring& outerFragment = {}
306 PRTX_EXPORTS_API
URIPtr addQuery(
const URIPtr& uri,
const std::wstring& key,
const std::wstring& value);
314 PRTX_EXPORTS_API
URIPtr addQuery(
const URIPtr& uri,
const std::map<std::wstring, std::wstring>& queries);
371 const uint8_t*& address,
380 PRTX_EXPORTS_API std::string
percentEncode(
const std::string& s);
387 PRTX_EXPORTS_API std::wstring
percentEncode(
const std::wstring& s);
394 PRTX_EXPORTS_API std::string
percentDecode(
const std::string& percentEncodedString);
412 # pragma warning(pop) URIPtr createFileURI(const std::wstring &percentEncodedAbsolutePath)
URIPtr removeFragment(const URIPtr &uri)
static const std::wstring SCHEME_MEMORY
"memory" scheme, see prtx::URIUtils::createMemoryURI()
Definition: URI.h:64
std::vector< URIPtr > URIPtrVector
vector of shared pointers to prtx::URI
Definition: URI.h:39
static const std::wstring SCHEME_FILE
"file" scheme, e.g. file:/local/file/system/file.ext
Definition: URI.h:61
static const std::wstring DELIM_FRAGMENT_ITEM
fragment item delimiting character '&'
Definition: URI.h:79
std::string percentDecode(const std::string &percentEncodedString)
URIPtr removeQuery(const URIPtr &uri)
static const std::wstring SCHEME_SAMBA
samba "smb" scheme, e.g. smb://host/share syntax
Definition: URI.h:62
static const std::wstring SCHEME_ZIP
"zip" scheme
Definition: URI.h:66
static const std::wstring SCHEME_BUILTIN
"builtin" scheme
Definition: URI.h:68
URIPtr createCompositeURI(const URIPtr &nestedURI, const std::wstring &outerScheme, const std::wstring &outerPath, const std::wstring &outerQuery={}, const std::wstring &outerFragment={})
static const std::wstring DELIM_SCHEME
scheme delimiting character ':'
Definition: URI.h:75
static const std::wstring DELIM_QUERY_ITEM
query item delimiting character '&'
Definition: URI.h:77
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
static const std::wstring SCHEME_DATA
"data" scheme, see http://tools.ietf.org/html/rfc2397
Definition: URI.h:67
std::shared_ptr< URI > URIPtr
shared pointer implementation of prtx::URI
Definition: URI.h:37
void parseMemoryURI(const URIPtr &uri, const uint8_t *&address, size_t &byteCount)
static const std::wstring DELIM_ENTRY
composite/nested URI delimiting character '!'
Definition: URI.h:80
URIPtr createDataURI(const std::string &mediaType, bool base64, const uint8_t *data, size_t dataSize)
static const std::wstring SCHEME_RPK
rule package "rpk" scheme, see prtx::URIUtils::createCompositeURI()
Definition: URI.h:65
URIPtr replaceFilename(const URIPtr &uri, const std::wstring &newFileName)
static const std::wstring SCHEME_UNC
UNC scheme, e.g. \ syntax.
Definition: URI.h:63
URIPtr addFragment(const URIPtr &uri, const std::wstring &key, const std::wstring &value)
std::string percentEncode(const std::string &s)
URIPtr createMemoryURI(const uint8_t *ptr, size_t size, const std::wstring &ext)
static const std::wstring DELIM_FRAGMENT
fragment delimiting character '#'
Definition: URI.h:78
URIPtr addQuery(const URIPtr &uri, const std::wstring &key, const std::wstring &value)
URIPtr replaceExtension(const URIPtr &uri, const std::wstring &newExtWithSep)
URIPtr createBuiltinURI(const std::wstring &name)
static const std::wstring DELIM_QUERY
query delimiting character '?'
Definition: URI.h:76