Classes | Functions
Balau::Resource Namespace Reference

The unified resource class hierarchy. More...

Classes

class  ByteReadResource
 A read-only resource which is read as bytes. More...
 
class  ByteWriteResource
 A write-only resource which is written from bytes. More...
 
class  File
 A file on the local file system. More...
 
class  FileByteReadResource
 A read-only standard file on a file system which is read as bytes. More...
 
class  FileByteWriteResource
 A write only standard file on a file system which is written as bytes. More...
 
class  FileUtf32To8WriteResource
 A write-only UTF-8 resource in a standard file on a file system, which is written with UTF-32 characters. More...
 
class  FileUtf8To32ReadResource
 A read-only file based UTF-8 resource which is read as UTF-32 characters. More...
 
class  Http
 An HTTP URL. More...
 
class  HttpByteReadResource
 A read-only HTTP resource which is read as bytes. More...
 
class  Https
 An HTTPS URL. More...
 
class  HttpsByteReadResource
 A read-only HTTP resource which is read as bytes. More...
 
class  HttpsUtf8To32ReadResource
 A read-only HTTP UTF-8 resource which is read as UTF-32 characters. More...
 
class  HttpUtf8To32ReadResource
 A read-only HTTP UTF-8 resource which is read as UTF-32 characters. More...
 
class  RecursiveUriIterator
 An abstract read iterator that iterates recursively. More...
 
class  Resource
 Abstract base class of resource classes. More...
 
class  StringUri
 An immediate string pseudo-URI. More...
 
class  StringUriByteReadResource
 A read-only String URI resource which is read as bytes. More...
 
class  StringUriByteWriteResource
 A write only String URI that is written as bytes. More...
 
class  StringUriUtf32To8WriteResource
 A write-only UTF-8 resource in a standard file on a file system, which is written with UTF-32 characters. More...
 
class  StringUriUtf8To32ReadResource
 A read-only String UTF-8 resource which is read as UTF-32 characters. More...
 
class  Uri
 An abstract universal resource identifier. More...
 
struct  UriComponents
 Parses a URI and provides views into the URI's components. More...
 
class  UriDispatcher
 Visitor interface for URIs. More...
 
class  UriIterator
 An abstract read iterator. More...
 
class  Url
 An abstract Url (either http or https). More...
 
class  Utf32To8WriteResource
 A write-only UTF-8 resource, which is written with UTF-32 characters. More...
 
class  Utf8To32ReadResource
 A read-only UTF-8 resource which is read in as UTF-32 characters. More...
 
class  ZipEntry
 An entry in a zip archive on the local file system. More...
 
class  ZipEntryByteReadResource
 A read-only entry in a zip file which is read as bytes. More...
 
class  ZipEntryUtf8To32ReadResource
 A read-only entry in a zip file which is read as UTF-8 characters and implicitly converted to UTF-32 characters. More...
 
class  ZipFile
 A zip file on the local file system. More...
 

Functions

void fromString (std::unique_ptr< Uri > &uri, std::string_view value)
 Create a unique pointer URI from the supplied string. More...
 
void fromString (std::shared_ptr< Uri > &uri, std::string_view value)
 Create a shared pointer URI from the supplied string. More...
 
void fromString (std::shared_ptr< const Uri > &uri, std::string_view value)
 Create a shared const pointer URI from the supplied string. More...
 
void fromString (File &destination, std::string_view value)
 Overwrite the supplied file URI by assignment by converting the supplied UTF-8 string to a file URI. More...
 
std::unique_ptr< Urioperator/ (const std::unique_ptr< Uri > &uri, const std::string &pathComponent)
 Appends the path component to the supplied URI, returning a new URI. More...
 
bool operator== (const UriComponents &lhs, const UriComponents &rhs)
 Returns true if the two URI component instances are equal. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const Https &https)
 Print the HTTPs URL as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const Http &http)
 Print the HTTP URL as a UTF-8 string. More...
 
std::string toString (const Uri &uri)
 Print the URI as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const UriComponents &uriComponents)
 Print the URI components as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const ZipFile &zipFile)
 Print the zip file URI as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const File &file)
 Print the file URI as a UTF-8 string. More...
 

Detailed Description

The unified resource class hierarchy.

Function Documentation

◆ fromString() [1/4]

void Balau::Resource::fromString ( std::unique_ptr< Uri > &  uri,
std::string_view  value 
)

Create a unique pointer URI from the supplied string.

Parameters
urithe unique pointer container to place the new URI instance into
valuethe input string

◆ fromString() [2/4]

void Balau::Resource::fromString ( std::shared_ptr< Uri > &  uri,
std::string_view  value 
)
inline

Create a shared pointer URI from the supplied string.

Parameters
urithe shared pointer container to place the new URI instance into
valuethe input string

◆ fromString() [3/4]

void Balau::Resource::fromString ( std::shared_ptr< const Uri > &  uri,
std::string_view  value 
)
inline

Create a shared const pointer URI from the supplied string.

Parameters
urithe shared pointer container to place the new URI instance into
valuethe input string

◆ fromString() [4/4]

void Balau::Resource::fromString ( File destination,
std::string_view  value 
)
inline

Overwrite the supplied file URI by assignment by converting the supplied UTF-8 string to a file URI.

Returns
a file URI

◆ operator/()

std::unique_ptr<Uri> Balau::Resource::operator/ ( const std::unique_ptr< Uri > &  uri,
const std::string &  pathComponent 
)
inline

Appends the path component to the supplied URI, returning a new URI.

If the URI type does not permit appending of path components, UnsupportedOperationException is thrown.

◆ operator==()

bool Balau::Resource::operator== ( const UriComponents lhs,
const UriComponents rhs 
)
inline

Returns true if the two URI component instances are equal.

This function will not normalise the URIs.

Returns
true if the two URI component instances are equal

◆ toString() [1/6]

Balau::U8String<AllocatorT> Balau::Resource::toString ( const Https https)
inline

Print the HTTPs URL as a UTF-8 string.

Returns
a UTF-8 string containing the HTTPs URL

◆ toString() [2/6]

Balau::U8String<AllocatorT> Balau::Resource::toString ( const Http http)
inline

Print the HTTP URL as a UTF-8 string.

Returns
a UTF-8 string containing the HTTP URL

◆ toString() [3/6]

std::string Balau::Resource::toString ( const Uri uri)
inline

Print the URI as a UTF-8 string.

This function does not normalise the URI.

Returns
a UTF-8 string representing the URI

◆ toString() [4/6]

std::string toString ( const UriComponents uriComponents)
inline

Print the URI components as a UTF-8 string.

This function does not normalise the URI.

Returns
a UTF-8 string representing the URI components

◆ toString() [5/6]

std::string toString ( const ZipFile zipFile)
inline

Print the zip file URI as a UTF-8 string.

Returns
a UTF-8 string representing the zip file URI

◆ toString() [6/6]

Balau::U8String<AllocatorT> Balau::Resource::toString ( const File file)
inline

Print the file URI as a UTF-8 string.

Returns
a UTF-8 string representing the file URI