|
HikoGUI
A low latency retained GUI
|
#include <hikogui/URL.hpp>
Public Member Functions | |
| constexpr | URL (URL const &) noexcept=default |
| constexpr | URL (URL &&) noexcept=default |
| constexpr URL & | operator= (URL const &) noexcept=default |
| constexpr URL & | operator= (URL &&) noexcept=default |
| constexpr | URL (URI const &other) noexcept |
| constexpr | URL (URI &&other) noexcept |
| URL (std::filesystem::path const &path) | |
| std::string | generic_path () const |
| Return a generic path. | |
| std::filesystem::path | filesystem_path () const |
| Create a filesystem path from a file URL. | |
| operator std::filesystem::path () const | |
| std::unique_ptr< resource_view > | loadView () const |
| Load a resource. | |
Public Member Functions inherited from hi::v1::URI | |
| constexpr | URI (URI const &) noexcept=default |
| constexpr | URI (URI &&) noexcept=default |
| constexpr URI & | operator= (URI const &) noexcept=default |
| constexpr URI & | operator= (URI &&) noexcept=default |
| constexpr | URI (std::string_view str) |
| Construct a URL from a string. | |
| constexpr | URI (std::string const &str) |
| constexpr | URI (const char *str) |
| constexpr bool | empty () const noexcept |
| constexpr | operator bool () const noexcept |
| constexpr std::optional< std::string > const & | scheme () const noexcept |
| Get the scheme-component of the URI. | |
| constexpr URI & | set_scheme (std::optional< std::string > const &rhs) |
| Get the scheme-component of the URI. | |
| constexpr std::optional< authority_type > const & | authority () const noexcept |
| Get the authority-component of the URI. | |
| constexpr URI & | set_authority (std::optional< authority_type > const &rhs) noexcept |
| constexpr path_type const & | path () const noexcept |
| constexpr URI & | set_path (path_type const &rhs) |
| constexpr std::optional< std::string > | filename () const noexcept |
| constexpr URI & | remove_filename () noexcept |
| Remove the filename part of the path. | |
| constexpr std::optional< std::string > const & | query () const noexcept |
| Get the query-component of the URI. | |
| constexpr URI & | set_query (std::optional< std::string > const &rhs) noexcept |
| constexpr std::optional< std::string > const & | fragment () const noexcept |
| Get the fragment-component of the URI. | |
| constexpr URI & | set_fragment (std::optional< std::string > const &rhs) noexcept |
Static Public Member Functions | |
| static std::string | make_file_url_string (std::filesystem::path const &path) |
| constexpr static void | validate_file_segment (std::string_view segment) |
| constexpr static void | validate_file_server (std::string_view server) |
| static URL | url_from_current_working_directory () noexcept |
| static URL | url_from_resource_directory () noexcept |
| static URL | url_from_executable_directory () noexcept |
| static URL | url_from_executable_file () noexcept |
| static URL | url_from_application_data_directory () noexcept |
| static URL | url_from_application_log_directory () noexcept |
| static URL | url_from_system_font_directory () noexcept |
| static URL | url_from_application_preferences_file () noexcept |
Static Public Member Functions inherited from hi::v1::URI | |
| static constexpr std::string | decode (auto first, auto last) |
| URI percent-encoding decode function. | |
| static constexpr std::string | decode (auto &&range) |
| URI percent-encoding decode function. | |
| template<char... Extras, typename It , typename ItEnd > | |
| static constexpr std::string | encode (It first, ItEnd last) noexcept |
| URI encode a component. | |
| template<char... Extras, typename Range > | |
| static constexpr std::string | encode (Range &&range) noexcept |
| URI encode a component. | |
Friends | |
| constexpr friend URL | operator/ (URL const &base, URI const &ref) noexcept |
| constexpr friend URL | operator/ (URL const &base, std::string_view ref) noexcept |
Universal Resource Locator.
An instance internally holds a string to an url. This will have the following effects:
Constructors and path manipulations will cause the url to be normalized:
'file:' scheme urls can handle the following:
The url instance may be relative itself; meaning it does not hold a scheme. This is important, because it means that any string passed to the constructor is a valid url. This also means that non of the constructors and non of the methods will ever cause an error.
meaningless-urls could still cause meaningless results when converted to a path. But this is no different from having a meaningless path in the first place.
|
inline |
|
inline |
| std::unique_ptr< resource_view > hi::v1::URL::loadView | ( | ) | const |
Load a resource.