HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Util.h File Reference
+ Include dependency graph for Util.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

MX_CORE_API string getVersionString ()
 Return the version of the MaterialX library as a string. More...
 
MX_CORE_API std::tuple< int,
int, int
getVersionIntegers ()
 
MX_CORE_API string createValidName (string name, char replaceChar= '_')
 Create a valid MaterialX name from the given string. More...
 
MX_CORE_API bool isValidName (const string &name)
 Return true if the given string is a valid MaterialX name. More...
 
MX_CORE_API string incrementName (const string &name)
 Increment the numeric suffix of a name. More...
 
MX_CORE_API StringVec splitString (const string &str, const string &sep)
 
MX_CORE_API string replaceSubstrings (string str, const StringMap &stringMap)
 Apply the given substring substitutions to the input string. More...
 
MX_CORE_API string stringToLower (string str)
 Return a copy of the given string with letters converted to lower case. More...
 
MX_CORE_API bool stringEndsWith (const string &str, const string &suffix)
 Return true if the given string ends with the given suffix. More...
 
MX_CORE_API string trimSpaces (const string &str)
 Trim leading and trailing spaces from a string. More...
 
template<typename T >
void hashCombine (size_t &seed, const T &value)
 Combine the hash of a value with an existing seed. More...
 
MX_CORE_API StringVec splitNamePath (const string &namePath)
 Split a name path into string vector. More...
 
MX_CORE_API string createNamePath (const StringVec &nameVec)
 Create a name path from a string vector. More...
 
MX_CORE_API string parentNamePath (const string &namePath)
 Given a name path, return the parent name path. More...
 

Variables

MATERIALX_NAMESPACE_BEGIN
MX_CORE_API const string 
EMPTY_STRING
 

Detailed Description

Utility methods

Definition in file Util.h.

Function Documentation

MX_CORE_API string createNamePath ( const StringVec nameVec)

Create a name path from a string vector.

MX_CORE_API string createValidName ( string  name,
char  replaceChar = '_' 
)

Create a valid MaterialX name from the given string.

MX_CORE_API std::tuple<int, int, int> getVersionIntegers ( )

Return the major, minor, and build versions of the MaterialX library as an integer tuple.

MX_CORE_API string getVersionString ( )

Return the version of the MaterialX library as a string.

template<typename T >
void hashCombine ( size_t &  seed,
const T &  value 
)

Combine the hash of a value with an existing seed.

Definition at line 51 of file Util.h.

MX_CORE_API string incrementName ( const string name)

Increment the numeric suffix of a name.

MX_CORE_API bool isValidName ( const string name)

Return true if the given string is a valid MaterialX name.

MX_CORE_API string parentNamePath ( const string namePath)

Given a name path, return the parent name path.

MX_CORE_API string replaceSubstrings ( string  str,
const StringMap stringMap 
)

Apply the given substring substitutions to the input string.

MX_CORE_API StringVec splitNamePath ( const string namePath)

Split a name path into string vector.

MX_CORE_API StringVec splitString ( const string str,
const string sep 
)

Split a string into a vector of substrings using the given set of separator characters.

MX_CORE_API bool stringEndsWith ( const string str,
const string suffix 
)

Return true if the given string ends with the given suffix.

MX_CORE_API string stringToLower ( string  str)

Return a copy of the given string with letters converted to lower case.

MX_CORE_API string trimSpaces ( const string str)

Trim leading and trailing spaces from a string.

Variable Documentation