Vuo  1.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Static Public Member Functions | Static Public Attributes | List of all members
VuoStringUtilities Class Reference

Description

Functions for dealing with strings.

Static Public Member Functions

static bool beginsWith (string wholeString, string beginning)
 Returns true if wholeString begins with beginning.
 
static bool endsWith (string wholeString, string ending)
 Returns true if wholeString ends with ending.
 
static string substrAfter (string wholeString, string beginning)
 Returns the substring of wholeString that follows beginning, or an empty string if wholeString does not begin with beginning.
 
static string substrBefore (string wholeString, string ending)
 Returns the substring of wholeString that precedes ending, or an empty string if wholeString does not end with ending.
 
static string replaceAll (string wholeString, char originalChar, char replacementChar)
 Returns a string constructed by replacing all instances of originalChar with replacementChar in wholeString.
 
static size_t replaceAll (string &wholeString, string originalSubstring, string replacementSubstring)
 Replaces all instances of originalSubstring with replacementSubstring in wholeString.
 
static vector< string > split (const string &wholeString, char delimiter)
 Splits wholeString into parts, as separated by delimiter.
 
static string join (vector< string > partialStrings, char delimiter)
 Combines partialStrings, separated by delimiter, into one string.
 
static string prefixSymbolName (string symbolName, string moduleKey)
 Returns a string that starts with moduleKey and ends with symbolName.
 
static bool isValidCharInIdentifier (char ch)
 Check whether a character is valid for an identifier, i.e., matches [A-Za-z0-9_].
 
static string transcodeToIdentifier (string str)
 Transforms a string into a valid identifier:
 
static string transcodeToGraphvizIdentifier (const string &originalString)
 Escapes backslashes, quotes, angle brackets, and pipes in the string, making it a valid identifier in the Graphviz DOT language.
 
static string transcodeFromGraphvizIdentifier (const string &graphvizIdentifier)
 Removes escapes for backslashes, quotes, angle brackets, and pipes in the Graphviz identifier, making it a normal string.
 
static string generateHtmlFromMarkdown (const string &markdownString)
 Converts markdownString (a Markdown document) to HTML.
 
static string generateHtmlFromMarkdownLine (const string &markdownString)
 Converts markdownString (a single line of Markdown text) to HTML.
 
static string expandCamelCase (string camelCaseString)
 Inserts spaces at CamelCase transitions within the input camelCaseString, capitalizes the first letter of the string, and returns the result.
 
static string makeRandomHash (int length)
 Returns a random sequence of alphanumeric characters.
 
static long hash (const string &s)
 Generates an integer hash value for the string.
 

Static Public Attributes

static const std::locale locale
 For hashing strings.
 
static const std::collate< char > & collate = std::use_facet<std::collate<char> >(VuoStringUtilities::locale)
 For hashing strings.
 

Member Function Documentation

bool VuoStringUtilities::beginsWith ( string  wholeString,
string  beginning 
)
static

Returns true if wholeString begins with beginning.

bool VuoStringUtilities::endsWith ( string  wholeString,
string  ending 
)
static

Returns true if wholeString ends with ending.

string VuoStringUtilities::expandCamelCase ( string  camelCaseString)
static

Inserts spaces at CamelCase transitions within the input camelCaseString, capitalizes the first letter of the string, and returns the result.

string VuoStringUtilities::generateHtmlFromMarkdown ( const string &  markdownString)
static

Converts markdownString (a Markdown document) to HTML.

The returned HTML includes a paragraph wrapper around each line of text.

string VuoStringUtilities::generateHtmlFromMarkdownLine ( const string &  markdownString)
static

Converts markdownString (a single line of Markdown text) to HTML.

The returned HTML does not include a paragraph wrapper.

static long VuoStringUtilities::hash ( const string &  s)
inlinestatic

Generates an integer hash value for the string.

bool VuoStringUtilities::isValidCharInIdentifier ( char  ch)
static

Check whether a character is valid for an identifier, i.e., matches [A-Za-z0-9_].

string VuoStringUtilities::join ( vector< string >  partialStrings,
char  delimiter 
)
static

Combines partialStrings, separated by delimiter, into one string.

string VuoStringUtilities::makeRandomHash ( int  length)
static

Returns a random sequence of alphanumeric characters.

string VuoStringUtilities::prefixSymbolName ( string  symbolName,
string  moduleKey 
)
static

Returns a string that starts with moduleKey and ends with symbolName.

Useful for adding a unique prefix to a symbol name.

string VuoStringUtilities::replaceAll ( string  wholeString,
char  originalChar,
char  replacementChar 
)
static

Returns a string constructed by replacing all instances of originalChar with replacementChar in wholeString.

size_t VuoStringUtilities::replaceAll ( string &  wholeString,
string  originalSubstring,
string  replacementSubstring 
)
static

Replaces all instances of originalSubstring with replacementSubstring in wholeString.

Returns the number of instances replaced.

vector< string > VuoStringUtilities::split ( const string &  wholeString,
char  delimiter 
)
static

Splits wholeString into parts, as separated by delimiter.

string VuoStringUtilities::substrAfter ( string  wholeString,
string  beginning 
)
static

Returns the substring of wholeString that follows beginning, or an empty string if wholeString does not begin with beginning.

string VuoStringUtilities::substrBefore ( string  wholeString,
string  ending 
)
static

Returns the substring of wholeString that precedes ending, or an empty string if wholeString does not end with ending.

string VuoStringUtilities::transcodeFromGraphvizIdentifier ( const string &  graphvizIdentifier)
static

Removes escapes for backslashes, quotes, angle brackets, and pipes in the Graphviz identifier, making it a normal string.

string VuoStringUtilities::transcodeToGraphvizIdentifier ( const string &  originalString)
static

Escapes backslashes, quotes, angle brackets, and pipes in the string, making it a valid identifier in the Graphviz DOT language.

string VuoStringUtilities::transcodeToIdentifier ( string  str)
static

Transforms a string into a valid identifier:

  • Replace whitespace and '.'s with '_'s
  • Make sure all characters match [A-Za-z0-9_]

Member Data Documentation

const std::collate< char > & VuoStringUtilities::collate = std::use_facet<std::collate<char> >(VuoStringUtilities::locale)
static

For hashing strings.

const std::locale VuoStringUtilities::locale
static

For hashing strings.


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