This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SdfAssetPath Class Reference

Contains an asset path and optional evaluated and resolved paths. More...

#include <assetPath.h>

Public Member Functions

Constructors
SDF_API SdfAssetPath ()
 Construct an empty asset path.
 
SDF_API SdfAssetPath (const std::string &authoredPath)
 Construct an asset path with authoredPath and no associated evaluated or resolved path.
 
SDF_API SdfAssetPath (const std::string &authoredPath, const std::string &resolvedPath)
 Construct an asset path with authoredPath and an associated resolvedPath.
 
SDF_API SdfAssetPath (const SdfAssetPathParams &params)
 Construct an asset path using a SdfAssetPathParams object.
 
Accessors
const std::string & GetAuthoredPath () const &
 Returns the asset path as it was authored in the original layer.
 
std::string GetAuthoredPath () const &&
 Overload for rvalues, move out the asset path.
 
const std::string & GetEvaluatedPath () const &
 Return the evaluated asset path, if any.
 
std::string GetEvaluatedPath () const &&
 Overload for rvalues, move out the evaluated path.
 
const std::string & GetAssetPath () const &
 Return the asset path.
 
std::string GetAssetPath () const &&
 Overload for rvalues, move out the asset path.
 
const std::string & GetResolvedPath () const &
 Return the resolved asset path, if any.
 
std::string GetResolvedPath () const &&
 Overload for rvalues, move out the asset path.
 
Setters
void SetAuthoredPath (const std::string &authoredPath)
 Sets the authored path.
 
void SetEvaluatedPath (const std::string &evaluatedPath)
 Sets the evaluated path.
 
void SetResolvedPath (const std::string &resolvedPath)
 Sets the resolved path. This value is the result of asset resolution.
 

Friends

void swap (SdfAssetPath &lhs, SdfAssetPath &rhs)
 

Operators

bool operator== (const SdfAssetPath &rhs) const
 Equality, including the evaluated and resolved paths.
 
bool operator!= (const SdfAssetPath &rhs) const
 Inequality operator.
 
SDF_API bool operator< (const SdfAssetPath &rhs) const
 Ordering first by asset path, resolved path, then by evaluated path.
 
bool operator<= (const SdfAssetPath &rhs) const
 Less than or equal operator.
 
bool operator> (const SdfAssetPath &rhs) const
 Greater than operator.
 
bool operator>= (const SdfAssetPath &rhs) const
 Greater than or equal operator.
 
size_t GetHash () const
 Hash function.
 
size_t hash_value (const SdfAssetPath &ap)
 

Detailed Description

Contains an asset path and optional evaluated and resolved paths.

When this class is used to author scene description, the value returned by GetAssetPath() is serialized out, all other fields are ignored. Asset paths may contain non-control UTF-8 encoded characters. Specifically, U+0000..U+001F (C0 controls), U+007F (delete), and U+0080..U+009F (C1 controls) are disallowed. Attempts to construct asset paths with such characters will issue a TfError and produce the default-constructed empty asset path.

Definition at line 72 of file assetPath.h.

Constructor & Destructor Documentation

◆ SdfAssetPath() [1/4]

SDF_API SdfAssetPath ( )

Construct an empty asset path.

◆ SdfAssetPath() [2/4]

SDF_API SdfAssetPath ( const std::string &  authoredPath)
explicit

Construct an asset path with authoredPath and no associated evaluated or resolved path.

If the passed authoredPath is not valid UTF-8 or contains C0 or C1 control characters, raise a TfError and return the default-constructed empty asset path.

◆ SdfAssetPath() [3/4]

SDF_API SdfAssetPath ( const std::string &  authoredPath,
const std::string &  resolvedPath 
)

Construct an asset path with authoredPath and an associated resolvedPath.

If either the passed authoredPath or resolvedPath are not valid UTF-8 or either contain C0 or C1 control characters, raise a TfError and return the default-constructed empty asset path.

◆ SdfAssetPath() [4/4]

SDF_API SdfAssetPath ( const SdfAssetPathParams params)

Construct an asset path using a SdfAssetPathParams object.

If any fields of the passed in structure are not valid UTF-8 or either contain C0 or C1 control, characters, raise a TfError and return the default-constructed empty asset path.

Member Function Documentation

◆ GetAssetPath() [1/2]

const std::string & GetAssetPath ( ) const &
inline

Return the asset path.

If the the evaluated path is not empty, it will be returned, otherwise the raw, authored path is returned. The value this function returns is the exact input that is passed to asset resolution.

Definition at line 199 of file assetPath.h.

◆ GetAssetPath() [2/2]

std::string GetAssetPath ( ) const &&
inline

Overload for rvalues, move out the asset path.

Definition at line 204 of file assetPath.h.

◆ GetAuthoredPath() [1/2]

const std::string & GetAuthoredPath ( ) const &
inline

Returns the asset path as it was authored in the original layer.

When authoring scene description, this value is used for serialization.

Definition at line 169 of file assetPath.h.

◆ GetAuthoredPath() [2/2]

std::string GetAuthoredPath ( ) const &&
inline

Overload for rvalues, move out the asset path.

Definition at line 174 of file assetPath.h.

◆ GetEvaluatedPath() [1/2]

const std::string & GetEvaluatedPath ( ) const &
inline

Return the evaluated asset path, if any.

The evaluated path's value consists of the authored path with any expression variables evaluated. If the authored path does not contain any expression variables, this field will be empty.

Note that SdfAssetPath carries an evaluated path only if its creator passed one to the constructor. SdfAssetPath never performs variable expression evaluation itself.

Definition at line 186 of file assetPath.h.

◆ GetEvaluatedPath() [2/2]

std::string GetEvaluatedPath ( ) const &&
inline

Overload for rvalues, move out the evaluated path.

Definition at line 191 of file assetPath.h.

◆ GetHash()

size_t GetHash ( ) const
inline

Hash function.

Definition at line 148 of file assetPath.h.

◆ GetResolvedPath() [1/2]

const std::string & GetResolvedPath ( ) const &
inline

Return the resolved asset path, if any.

This is the resolved value of GetAssetPath()

Note that SdfAssetPath carries a resolved path only if its creator passed one to the constructor. SdfAssetPath never performs resolution itself.

Definition at line 215 of file assetPath.h.

◆ GetResolvedPath() [2/2]

std::string GetResolvedPath ( ) const &&
inline

Overload for rvalues, move out the asset path.

Definition at line 220 of file assetPath.h.

◆ operator!=()

bool operator!= ( const SdfAssetPath rhs) const
inline

Inequality operator.

See also
SdfAssetPath::operator==(const SdfAssetPath&)

Definition at line 122 of file assetPath.h.

◆ operator<()

SDF_API bool operator< ( const SdfAssetPath rhs) const

Ordering first by asset path, resolved path, then by evaluated path.

◆ operator<=()

bool operator<= ( const SdfAssetPath rhs) const
inline

Less than or equal operator.

See also
SdfAssetPath::operator<(const SdfAssetPath&)

Definition at line 131 of file assetPath.h.

◆ operator==()

bool operator== ( const SdfAssetPath rhs) const
inline

Equality, including the evaluated and resolved paths.

Definition at line 114 of file assetPath.h.

◆ operator>()

bool operator> ( const SdfAssetPath rhs) const
inline

Greater than operator.

See also
SdfAssetPath::operator<(const SdfAssetPath&)

Definition at line 137 of file assetPath.h.

◆ operator>=()

bool operator>= ( const SdfAssetPath rhs) const
inline

Greater than or equal operator.

See also
SdfAssetPath::operator<(const SdfAssetPath&)

Definition at line 143 of file assetPath.h.

◆ SetAuthoredPath()

void SetAuthoredPath ( const std::string &  authoredPath)
inline

Sets the authored path.

This value is the path exactly as it is authored in the layer.

Definition at line 231 of file assetPath.h.

◆ SetEvaluatedPath()

void SetEvaluatedPath ( const std::string &  evaluatedPath)
inline

Sets the evaluated path.

This value is the result of performing variable expression resolution on the authored path.

Definition at line 237 of file assetPath.h.

◆ SetResolvedPath()

void SetResolvedPath ( const std::string &  resolvedPath)
inline

Sets the resolved path. This value is the result of asset resolution.

Definition at line 242 of file assetPath.h.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( const SdfAssetPath ap)
friend

Definition at line 160 of file assetPath.h.

◆ swap

void swap ( SdfAssetPath lhs,
SdfAssetPath rhs 
)
friend

Definition at line 249 of file assetPath.h.


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