HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stringUtils.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/arch/attributes.h"
#include "pxr/base/arch/inttypes.h"
#include "pxr/base/tf/api.h"
#include "pxr/base/tf/enum.h"
#include <cstdarg>
#include <cstring>
#include <list>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
+ Include dependency graph for stringUtils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TfDictionaryLessThan
 
struct  TfStreamFloat
 
struct  TfStreamDouble
 

Functions

TF_API std::string TfStringPrintf (const char *fmt,...)
 
TF_API std::string TfVStringPrintf (const std::string &fmt, va_list ap)
 
TF_API std::string TfVStringPrintf (const char *fmt, va_list ap)
 Bloat-avoidance version of TfVStringPrintf() More...
 
std::string TfSafeString (const char *ptr)
 
std::string TfIntToString (int i)
 Returns the given integer as a string. More...
 
TF_API double TfStringToDouble (const std::string &txt)
 
TF_API double TfStringToDouble (const char *text)
 
TF_API long TfStringToLong (const std::string &txt, bool *outOfRange=NULL)
 
TF_API long TfStringToLong (const char *txt, bool *outOfRange=NULL)
 
TF_API unsigned long TfStringToULong (const std::string &txt, bool *outOfRange=NULL)
 
TF_API unsigned long TfStringToULong (const char *txt, bool *outOfRange=NULL)
 
TF_API int64_t TfStringToInt64 (const std::string &txt, bool *outOfRange=NULL)
 
TF_API int64_t TfStringToInt64 (const char *txt, bool *outOfRange=NULL)
 
TF_API uint64_t TfStringToUInt64 (const std::string &txt, bool *outOfRange=NULL)
 
TF_API uint64_t TfStringToUInt64 (const char *txt, bool *outOfRange=NULL)
 
bool Tf_StringStartsWithImpl (char const *s, size_t slen, char const *prefix, size_t prelen)
 
bool TfStringStartsWith (const std::string &s, const char *prefix)
 Returns true if s starts with prefix. More...
 
bool TfStringStartsWith (const std::string &s, const std::string &prefix)
 
TF_API bool TfStringStartsWith (const std::string &s, const TfToken &prefix)
 
bool Tf_StringEndsWithImpl (char const *s, size_t slen, char const *suffix, size_t suflen)
 
bool TfStringEndsWith (const std::string &s, const char *suffix)
 Returns true if s ends with suffix. More...
 
bool TfStringEndsWith (const std::string &s, const std::string &suffix)
 
TF_API bool TfStringEndsWith (const std::string &s, const TfToken &suffix)
 
TF_API bool TfStringContains (const std::string &s, const char *substring)
 Returns true if s contains substring. More...
 
bool TfStringContains (const std::string &s, const std::string &substring)
 
TF_API bool TfStringContains (const std::string &s, const TfToken &substring)
 
TF_API std::string TfStringToLower (const std::string &source)
 Makes all characters in source lowercase, and returns the result. More...
 
TF_API std::string TfStringToUpper (const std::string &source)
 Makes all characters in source uppercase, and returns the result. More...
 
TF_API std::string TfStringCapitalize (const std::string &source)
 
TF_API std::string TfStringTrimLeft (const std::string &s, const char *trimChars=" \n\t\r")
 
TF_API std::string TfStringTrimRight (const std::string &s, const char *trimChars=" \n\t\r")
 
TF_API std::string TfStringTrim (const std::string &s, const char *trimChars=" \n\t\r")
 
TF_API std::string TfStringGetCommonPrefix (std::string a, std::string b)
 
TF_API std::string TfStringGetSuffix (const std::string &name, char delimiter= '.')
 
TF_API std::string TfStringGetBeforeSuffix (const std::string &name, char delimiter= '.')
 
TF_API std::string TfGetBaseName (const std::string &fileName)
 Returns the base name of a file (final component of the path). More...
 
TF_API std::string TfGetPathName (const std::string &fileName)
 
TF_API std::string TfStringReplace (const std::string &source, const std::string &from, const std::string &to)
 
template<class ForwardIterator >
std::string TfStringJoin (ForwardIterator begin, ForwardIterator end, const char *separator=" ")
 
TF_API std::string TfStringJoin (const std::vector< std::string > &strings, const char *separator=" ")
 
TF_API std::string TfStringJoin (const std::set< std::string > &strings, const char *separator=" ")
 
TF_API std::vector< std::stringTfStringSplit (std::string const &src, std::string const &separator)
 
TF_API std::vector< std::stringTfStringTokenize (const std::string &source, const char *delimiters=" \t\n")
 
TF_API std::set< std::stringTfStringTokenizeToSet (const std::string &source, const char *delimiters=" \t\n")
 
TF_API std::vector< std::stringTfQuotedStringTokenize (const std::string &source, const char *delimiters=" \t\n", std::string *errors=NULL)
 
TF_API std::vector< std::stringTfMatchedStringTokenize (const std::string &source, char openDelimiter, char closeDelimiter, char escapeCharacter= '\0', std::string *errors=NULL)
 
std::vector< std::stringTfMatchedStringTokenize (const std::string &source, char openDelimiter, char closeDelimiter, std::string *errors)
 
template<typename T >
std::enable_if<!std::is_enum
< T >::value, std::string >
::type 
TfStringify (const T &v)
 
template<typename T >
std::enable_if< std::is_enum
< T >::value, std::string >
::type 
TfStringify (const T &v)
 
TF_API std::string TfStringify (bool v)
 
TF_API std::string TfStringify (std::string const &)
 
TF_API std::string TfStringify (float)
 
TF_API std::string TfStringify (double)
 
TF_API bool TfDoubleToString (double d, char *buffer, int len, bool emitTrailingZero)
 
TF_API std::ostream & operator<< (std::ostream &o, TfStreamFloat t)
 
TF_API std::ostream & operator<< (std::ostream &o, TfStreamDouble t)
 
template<typename T >
TfUnstringify (const std::string &instring, bool *status=NULL)
 
template<>
TF_API bool TfUnstringify (const std::string &instring, bool *status)
 
template<>
TF_API std::string TfUnstringify (const std::string &instring, bool *status)
 
TF_API std::string TfStringGlobToRegex (const std::string &s)
 
TF_API std::string TfEscapeString (const std::string &in)
 
TF_API void TfEscapeStringReplaceChar (const char **in, char **out)
 
TF_API std::string TfStringCatPaths (const std::string &prefix, const std::string &suffix)
 
bool TfIsValidIdentifier (std::string const &identifier)
 
TF_API std::string TfMakeValidIdentifier (const std::string &in)
 
TF_API std::string TfGetXmlEscapedString (const std::string &in)
 

Detailed Description

Definitions of basic string utilities in tf.

Definition in file stringUtils.h.

Function Documentation

template<typename T >
std::enable_if<std::is_enum<T>::value, std::string>::type TfStringify ( const T &  v)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 533 of file stringUtils.h.