Hot Door CORE 0.8.3
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Typedefs | Functions
hdicoreStrings.h File Reference

Header file for plugin unicode string manipulation. More...

#include <vector>
#include "hdicoreTypes.h"
Include dependency graph for hdicoreStrings.h:

Typedefs

typedef std::vector< std::string > hdi::core::strings::StringVector
 

Functions

uint32_t hdi::core::strings::substrCount (const std::string &str_, const std::string &substr_)
 Gets the number of times a substring occurs in a given string.
 
bool hdi::core::strings::split (const std::string &str_, const std::string &delim_, StringVector &elements__)
 Tokenizes a string by a given substring delimiter.
 
std::string hdi::core::strings::trim (const std::string &str_)
 Trims the whitespace from both ends of a string, returning a duplicate.
 
std::string hdi::core::strings::uppercase (const std::string &str_)
 Uppercases an entire string, returning a duplicate.
 
std::string hdi::core::strings::lowercase (const std::string &str_)
 Lowercases an entire string, returning a duplicate.
 
std::string hdi::core::strings::replaceAll (const std::string &subject_, const std::string &search_, const std::string &replace_)
 Replaces all instances of a search string, in a subject string, with a given replacement.
 
UTF16String hdi::core::strings::utf8ToUTF16 (const UTF8String &str_)
 Converts the given UTF-8 string to a UTF-16 string.
 
UTF32String hdi::core::strings::utf8ToUTF32 (const UTF8String &str_)
 Converts the given UTF-8 string to a UTF-32 string.
 
UTF8String hdi::core::strings::utf16ToUTF8 (const UTF16String &str_)
 Converts the given UTF-16 string to a UTF-8 string.
 
UTF32String hdi::core::strings::utf16ToUTF32 (const UTF16String &str_)
 Converts the given UTF-16 string to a UTF-32 string.
 
UTF8String hdi::core::strings::utf32ToUTF8 (const UTF32String &str_)
 Converts the given UTF-32 string to a UTF-8 string.
 
UTF16String hdi::core::strings::utf32ToUTF16 (const UTF32String &str_)
 Converts the given UTF-32 string to a UTF-16 string.
 

Detailed Description

Header file for plugin unicode string manipulation.

Function Documentation

◆ lowercase()

std::string hdi::core::strings::lowercase ( const std::string &  str_)

Lowercases an entire string, returning a duplicate.

Author
GW
Date
08/2013
Parameters
str_String to lowercase, as UTF-8
Returns
Value of str_ argument but with alphabetic characters lowercased, as UTF-8

◆ replaceAll()

std::string hdi::core::strings::replaceAll ( const std::string &  subject_,
const std::string &  search_,
const std::string &  replace_ 
)

Replaces all instances of a search string, in a subject string, with a given replacement.

Author
GW
Date
08/2013
Parameters
subject_String in which the search_ substring will be replaced with replace_, as UTF-8
search_Substring to search for and ultimately replace, as UTF-8
replace_Replacement string for search_, as UTF-8
Returns
Value of subject_ argument as UTF-8, but with all instances of search_ argument value replaced with the value of the replace_ argument

◆ split()

bool hdi::core::strings::split ( const std::string &  str_,
const std::string &  delim_,
StringVector &  elements__ 
)

Tokenizes a string by a given substring delimiter.

Author
GW
Date
08/2013
Parameters
str_String to tokenize, as UTF-8
delim_Delimiter to use for tokenization, as UTF-8
elements__String vector for the delimited results, as UTF-8
Returns
true if the string could be split, false otherwise (only fails if str_ doesn't contain delim_)

◆ substrCount()

uint32_t hdi::core::strings::substrCount ( const std::string &  str_,
const std::string &  substr_ 
)

Gets the number of times a substring occurs in a given string.

Author
GW
Date
08/2013
Parameters
str_Primary string, as UTF-8, from which the count of substr_ is acquired
substr_Potential substring of str_, as UTF-8
Returns
The number of times substr_ occurs in str_

◆ trim()

std::string hdi::core::strings::trim ( const std::string &  str_)

Trims the whitespace from both ends of a string, returning a duplicate.

Author
GW
Date
08/2013
Parameters
str_String to trim, as UTF-8
Returns
Value of str_ argument but with prefixing and suffixing whitespace removed, as UTF-8

◆ uppercase()

std::string hdi::core::strings::uppercase ( const std::string &  str_)

Uppercases an entire string, returning a duplicate.

Author
GW
Date
08/2013
Parameters
str_String to uppercase, as UTF-8
Returns
Value of str_ argument but with alphabetic characters uppercased, as UTF-8

◆ utf16ToUTF32()

UTF32String hdi::core::strings::utf16ToUTF32 ( const UTF16String str_)

Converts the given UTF-16 string to a UTF-32 string.

Author
GW
Date
10/2015
Parameters
str_UTF-16 string to convert
Returns
Resultant UTF-32 string

◆ utf16ToUTF8()

UTF8String hdi::core::strings::utf16ToUTF8 ( const UTF16String str_)

Converts the given UTF-16 string to a UTF-8 string.

Author
GW
Date
10/2015
Parameters
str_UTF-16 string to convert
Returns
Resultant UTF-8 string

◆ utf32ToUTF16()

UTF16String hdi::core::strings::utf32ToUTF16 ( const UTF32String str_)

Converts the given UTF-32 string to a UTF-16 string.

Author
GW
Date
10/2015
Parameters
str_UTF-32 string to convert
Returns
Resultant UTF-16 string

◆ utf32ToUTF8()

UTF8String hdi::core::strings::utf32ToUTF8 ( const UTF32String str_)

Converts the given UTF-32 string to a UTF-8 string.

Author
GW
Date
10/2015
Parameters
str_UTF-32 string to convert
Returns
Resultant UTF-8 string

◆ utf8ToUTF16()

UTF16String hdi::core::strings::utf8ToUTF16 ( const UTF8String str_)

Converts the given UTF-8 string to a UTF-16 string.

Author
GW
Date
10/2015
Parameters
str_UTF-8 string to convert
Returns
Resultant UTF-16 string

◆ utf8ToUTF32()

UTF32String hdi::core::strings::utf8ToUTF32 ( const UTF8String str_)

Converts the given UTF-8 string to a UTF-32 string.

Author
GW
Date
10/2015
Parameters
str_UTF-8 string to convert
Returns
Resultant UTF-32 string