Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::SdlResourceLocator Class Reference

#include <SdlResourceLocator.h>

Inheritance diagram for ph::SdlResourceLocator:
ph::IResourceIdentifierResolver

Public Member Functions

 SdlResourceLocator (const SdlIOContext &ctx)
 
bool resolve (ResourceIdentifier &identifier) override
 Resolve the identifier;.
 
Path toPath (std::string_view sri) const
 
std::string toBundleSRI (std::string_view sri) const
 
std::string toExternalSRI (std::string_view sri) const
 
ResourceIdentifier toBundleIdentifier (const Path &path) const
 Get an identifier representing the path.
 
ResourceIdentifier toExternalIdentifier (const Path &path) const
 Get an identifier representing the path.
 
ESriType getType (std::string_view identifier) const
 Tries to get type information from a potential SRI.
 
- Public Member Functions inherited from ph::IResourceIdentifierResolver
 IResourceIdentifierResolver ()=default
 
 IResourceIdentifierResolver (const IResourceIdentifierResolver &other)=default
 
 IResourceIdentifierResolver (IResourceIdentifierResolver &&other) noexcept=default
 
virtual ~IResourceIdentifierResolver ()=default
 
IResourceIdentifierResolveroperator= (const IResourceIdentifierResolver &rhs)=default
 
IResourceIdentifierResolveroperator= (IResourceIdentifierResolver &&rhs) noexcept=default
 

Static Public Member Functions

static bool isRecognized (std::string_view sdlValueStr)
 Check whether the string is a SDL resource identifier. Checks the format of the string only. Does not test whether the identifier actually points to a valid resource or not. This utility is useful when a quick test for the content of the value string is desired.
 

Additional Inherited Members

- Static Protected Member Functions inherited from ph::IResourceIdentifierResolver
static void setResolved (ResourceIdentifier &identifier, Path resolved)
 
static void setResolved (ResourceIdentifier &identifier, std::string resolved)
 
static void clearResolved (ResourceIdentifier &identifier)
 

Constructor & Destructor Documentation

◆ SdlResourceLocator()

ph::SdlResourceLocator::SdlResourceLocator ( const SdlIOContext & ctx)
explicit

Member Function Documentation

◆ getType()

ESriType ph::SdlResourceLocator::getType ( std::string_view identifier) const

Tries to get type information from a potential SRI.

Parameters
identifierThe identifier to get type from. Does not need to be a SRI.
Returns
Type of the identifier. ESriType::Unknown if not a SRI.

◆ isRecognized()

bool ph::SdlResourceLocator::isRecognized ( std::string_view sdlValueStr)
static

Check whether the string is a SDL resource identifier. Checks the format of the string only. Does not test whether the identifier actually points to a valid resource or not. This utility is useful when a quick test for the content of the value string is desired.

◆ resolve()

bool ph::SdlResourceLocator::resolve ( ResourceIdentifier & identifier)
overridevirtual

Resolve the identifier;.

Returns
Whether the resolve was successful.

Implements ph::IResourceIdentifierResolver.

◆ toBundleIdentifier()

ResourceIdentifier ph::SdlResourceLocator::toBundleIdentifier ( const Path & path) const

Get an identifier representing the path.

Returns
A bundle identifier resolving to path.

◆ toBundleSRI()

std::string ph::SdlResourceLocator::toBundleSRI ( std::string_view sri) const

◆ toExternalIdentifier()

ResourceIdentifier ph::SdlResourceLocator::toExternalIdentifier ( const Path & path) const

Get an identifier representing the path.

Returns
An external identifier resolving to path.

◆ toExternalSRI()

std::string ph::SdlResourceLocator::toExternalSRI ( std::string_view sri) const

◆ toPath()

Path ph::SdlResourceLocator::toPath ( std::string_view sri) const

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