载入中...
搜索中...
未找到

An immutable, canonical URI value. 更多...

#include <Uri.h>

Public 成员函数

UriScheme scheme () const noexcept
 Return the parsed scheme.
 
std::string_view path () const noexcept
 Return the virtual path, borrowed from this URI until it is moved or destroyed.
 
std::string_view query () const noexcept
 Return the query component without ?, borrowed from this URI.
 
std::string_view fragment () const noexcept
 Return the fragment component without #, borrowed from this URI.
 
const std::string & format () const noexcept
 Return the stable canonical URI text owned by this value.
 

静态 Public 成员函数

static Result< Uri > parse (std::string_view text)
 Parse and canonicalize a resource URI.
 
static Result< Uri > fromParts (UriScheme scheme, std::string_view path, std::string_view query={}, std::string_view fragment={})
 Construct a URI from validated components.
 

友元

bool operator== (const Uri &, const Uri &) noexcept=default
 Compare canonical URI values.
 

详细描述

An immutable, canonical URI value.

This type accepts only the five engine resource schemes. It deliberately does not accept file://, URLs, or a bare path. URI values own their text and are safe to retain across frames; they contain no borrowed pointers and have no thread affinity.

在文件 Uri.h 第 44 行定义.

成员函数说明

◆ format()

const std::string & eve::Uri::format ( ) const
inlinenoexcept

Return the stable canonical URI text owned by this value.

在文件 Uri.h 第 78 行定义.

◆ fragment()

std::string_view eve::Uri::fragment ( ) const
inlinenoexcept

Return the fragment component without #, borrowed from this URI.

在文件 Uri.h 第 75 行定义.

◆ fromParts()

Result< Uri > eve::Uri::fromParts ( UriScheme  scheme,
std::string_view  path,
std::string_view  query = {},
std::string_view  fragment = {} 
)
static

Construct a URI from validated components.

参数
schemeOne of the supported resource schemes.
pathRelative virtual path; . and .. segments are forbidden.
queryOptional query component without the leading ?.
fragmentOptional fragment component without the leading #.
返回
A canonical URI or a structured parse diagnostic.

在文件 Uri.cpp 第 159 行定义.

引用了 path.

◆ parse()

Result< Uri > eve::Uri::parse ( std::string_view  text)
static

Parse and canonicalize a resource URI.

参数
textURI in scheme://path[?query][#fragment] form.
返回
A checked URI value, or a parse diagnostic for malformed, unsupported, absolute, or path-like input.

在文件 Uri.cpp 第 157 行定义.

引用了 text.

◆ path()

std::string_view eve::Uri::path ( ) const
inlinenoexcept

Return the virtual path, borrowed from this URI until it is moved or destroyed.

在文件 Uri.h 第 69 行定义.

◆ query()

std::string_view eve::Uri::query ( ) const
inlinenoexcept

Return the query component without ?, borrowed from this URI.

在文件 Uri.h 第 72 行定义.

◆ scheme()

UriScheme eve::Uri::scheme ( ) const
inlinenoexcept

Return the parsed scheme.

在文件 Uri.h 第 66 行定义.

友元及相关函数文档

◆ operator==

bool operator== ( const Uri &  ,
const Uri &   
)
friend

Compare canonical URI values.


该类的文档由以下文件生成: