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

A semantically named resource locator. 更多...

#include <Uri.h>

Public 成员函数

UriScheme scheme () const noexcept
 Return the resource namespace.
 
std::string_view path () const noexcept
 Return the relative virtual path, borrowed from this value.
 
std::string_view query () const noexcept
 Return the query component, borrowed from this value.
 
std::string_view fragment () const noexcept
 Return the fragment component, borrowed from this value.
 
const std::string & format () const noexcept
 Return the stable canonical URI text owned by this value.
 
const Uri & uri () const noexcept
 Return the structural URI view owned by this resource URI.
 

静态 Public 成员函数

static Result< ResourceUri > parse (std::string_view text)
 Parse a supported resource URI.
 
static Result< ResourceUri > fromParts (UriScheme scheme, std::string_view path, std::string_view query={}, std::string_view fragment={})
 Construct a resource URI from validated components.
 
static Result< ResourceUri > fromLegacyProjectPath (std::string_view path)
 Explicitly convert a legacy project-relative path.
 

友元

bool operator== (const ResourceUri &, const ResourceUri &) noexcept=default
 Compare resource URI values.
 

详细描述

A semantically named resource locator.

Uri is the structural parser; ResourceUri is the type exposed at resource-module boundaries. Keeping this wrapper distinct prevents an arbitrary future URI value from being passed where a resource locator is expected, while retaining one canonical representation internally.

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

成员函数说明

◆ format()

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

Return the stable canonical URI text owned by this value.

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

◆ fragment()

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

Return the fragment component, borrowed from this value.

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

◆ fromLegacyProjectPath()

Result< ResourceUri > eve::ResourceUri::fromLegacyProjectPath ( std::string_view  path)
static

Explicitly convert a legacy project-relative path.

参数
pathThe old string facade's virtual path, not a URI.
返回
project://path after legacy separator normalization, or a diagnostic. Inputs containing :// are never reinterpreted.

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

引用了 path.

被这些函数引用 eve::filesystem::ResourceReader::read().

◆ fromParts()

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

Construct a resource URI from validated components.

参数
schemeSupported resource namespace.
pathRelative virtual path.
queryOptional query component without ?.
fragmentOptional fragment component without #.
返回
A checked resource URI or a parse diagnostic.

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

引用了 path.

◆ parse()

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

Parse a supported resource URI.

参数
textStrict virtual URI; a bare filesystem path is rejected.
返回
A checked resource URI or a parse diagnostic.

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

引用了 text.

被这些函数引用 eve::AssetRef::parse(), eve::ResourceRef::parse() , 以及 eve::filesystem::ResourceReader::read().

◆ path()

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

Return the relative virtual path, borrowed from this value.

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

◆ query()

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

Return the query component, borrowed from this value.

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

◆ scheme()

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

Return the resource namespace.

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

◆ uri()

const Uri & eve::ResourceUri::uri ( ) const
inlinenoexcept

Return the structural URI view owned by this resource URI.

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

友元及相关函数文档

◆ operator==

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

Compare resource URI values.


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