Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::address::IoUri Class Reference

Audio file or device URI. More...

#include <io_uri.h>

Inheritance diagram for roc::address::IoUri:
Collaboration diagram for roc::address::IoUri:

Public Member Functions

 IoUri (core::IArena &)
 Initialize empty URI. More...
 
bool is_valid () const
 Returns true if the URI has all required fields (scheme and path). More...
 
bool is_file () const
 Returns true if the scheme is "file". More...
 
bool is_special_file () const
 Returns true if the scheme is "file" and the path is "-". More...
 
void clear ()
 Clear all fields. More...
 
const char * scheme () const
 URI scheme. May be "file" or device type, e.g. "alsa". More...
 
ROC_ATTR_NODISCARD bool set_scheme (const char *str, size_t str_len)
 Set URI scheme. String should not be zero-terminated. More...
 
const char * path () const
 URI path. May be device name or file path depending on scheme. More...
 
ROC_ATTR_NODISCARD bool set_encoded_path (const char *str, size_t str_len)
 Set URI path. String should be percent-encoded. String should not be zero-terminated. More...
 
ROC_ATTR_NODISCARD bool format_encoded_path (core::StringBuilder &dst) const
 Get URI path. String will be percent-encoded. More...
 

Detailed Description

Audio file or device URI.

Definition at line 25 of file io_uri.h.

Constructor & Destructor Documentation

◆ IoUri()

roc::address::IoUri::IoUri ( core::IArena )
explicit

Initialize empty URI.

Member Function Documentation

◆ clear()

void roc::address::IoUri::clear ( )

Clear all fields.

◆ format_encoded_path()

ROC_ATTR_NODISCARD bool roc::address::IoUri::format_encoded_path ( core::StringBuilder dst) const

Get URI path. String will be percent-encoded.

◆ is_file()

bool roc::address::IoUri::is_file ( ) const

Returns true if the scheme is "file".

◆ is_special_file()

bool roc::address::IoUri::is_special_file ( ) const

Returns true if the scheme is "file" and the path is "-".

◆ is_valid()

bool roc::address::IoUri::is_valid ( ) const

Returns true if the URI has all required fields (scheme and path).

◆ path()

const char* roc::address::IoUri::path ( ) const

URI path. May be device name or file path depending on scheme.

◆ scheme()

const char* roc::address::IoUri::scheme ( ) const

URI scheme. May be "file" or device type, e.g. "alsa".

◆ set_encoded_path()

ROC_ATTR_NODISCARD bool roc::address::IoUri::set_encoded_path ( const char *  str,
size_t  str_len 
)

Set URI path. String should be percent-encoded. String should not be zero-terminated.

◆ set_scheme()

ROC_ATTR_NODISCARD bool roc::address::IoUri::set_scheme ( const char *  str,
size_t  str_len 
)

Set URI scheme. String should not be zero-terminated.


The documentation for this class was generated from the following file: