3ds Max C++ API Reference
|
#include <strclass.h>
Public Member Functions | |
CStr () | |
CStr (const char *cs) | |
CStr (const CStr &ws) | |
CStr (CStr &&ws) | |
CStr (const MaxSDK::Util::MaxString &ws) | |
CStr (const MaxSDK::Util::MaxStringCast< char > &ws) | |
CStr (const QString &qstring) | |
Conversion constructor, from QString. | |
~CStr () | |
char * | dataForWrite (size_t nchars=(size_t) -1) |
Returns a pointer to this string which can be written to with up to 'nchars' characters. | |
const char * | data () const |
operator const char * () const & | |
operator const char * () &&=delete | |
operator const char * () const &&=delete | |
operator QString () const | |
Conversion operator to QString. | |
void | Resize (int nchars) |
int | Length () const |
int | length () const |
int | ByteCount () const |
int | LanguageCharacterCount () const |
size_t | AllocatedChars () const |
bool | isNull () const |
CStr & | operator= (const CStr &cs) |
CStr & | operator= (CStr &&cs) |
CStr & | operator= (const MaxSDK::Util::MaxString &mstr) |
CStr & | operator= (const MaxSDK::Util::MaxStringCast< char > &mstr) |
CStr & | operator= (const char *cs) |
CStr | operator+ (const CStr &cs) const |
CStr & | operator+= (const CStr &cs) |
CStr & | Append (const CStr &cs) |
CStr & | append (const CStr &cs) |
CStr & | remove (int pos) |
CStr & | remove (int pos, int N) |
CStr | Substr (int start, int nchars) const |
CStr | MultiByteCharacterSubString (int firstCharacterIndex, int numberOfMBCharacters) const |
int | FindMultiByteCharacterFirstByteIndex (int characterIndex) const |
int | FindMultiByteCharacterLastByteIndex (int characterIndex) const |
char | operator[] (int i) const |
Returns the nth character of this string. | |
int | first (char c) const |
int | last (char c) const |
bool | operator== (const CStr &cs) const |
bool | operator== (char c) const |
bool | operator!= (const CStr &cs) const |
bool | operator!= (char c) const |
bool | operator< (const CStr &cs) const |
bool | operator<= (const CStr &ws) const |
bool | operator> (const CStr &ws) const |
bool | operator>= (const CStr &ws) const |
void | toUpper () |
void | toLower () |
int | printf (const char *format,...) |
Write a formatted string into this CStr. | |
int | printf (CStr format,...) |
int | printf_l (const char *format, const _locale_t theLocale,...) |
Write a formatted string into this CStr using specified locale. | |
int | vprintf (const char *format, va_list args) |
Write a formatted string into this CStr. | |
int | vprintf_l (const char *format, const _locale_t theLocale, va_list args) |
Write a formatted string into this CStr using specified locale. | |
wchar_t * | ToBSTR () const |
MaxSDK::Util::MaxStringCastCP | ToCP (UINT cp, size_t *length=NULL) const |
MaxSDK::Util::MaxStringCast< char > | ToACP (size_t *length=NULL) const |
MaxSDK::Util::MaxStringCastUTF8 | ToUTF8 (size_t *length=NULL) const |
MaxSDK::Util::MaxStringCast< WCHAR > | ToOLESTR (size_t *length=NULL) const |
MaxSDK::Util::MaxStringCast< WCHAR > | ToUTF16 (size_t *length=NULL) const |
MaxSDK::Util::MaxStringCast< unsigned int > | ToUTF32 (size_t *length=NULL) const |
MaxSDK::Util::MaxString | ToMaxString () const |
void | ToMaxString (MaxSDK::Util::MaxString &) const |
CStr | ToCStr () const |
WStr | ToWStr () const |
MaxSDK::Util::MaxStringCast< wchar_t > | ToMCHAR (size_t *length=NULL) const |
WStr | ToMSTR () const |
bool | EndsWith (const CStr &s, bool caseSensitive=true) const |
Returns true if the string ends with s; otherwise returns false. | |
bool | EndsWith (char c, bool caseSensitive=true) const |
Returns true if the string ends with c; otherwise returns false. | |
bool | StartsWith (const CStr &s, bool caseSensitive=true) const |
Returns true if the string starts with s; otherwise returns false. | |
bool | StartsWith (char c, bool caseSensitive=true) const |
Returns true if the string starts with c; otherwise returns false. | |
bool | CaseInsensitiveEqual (const char *string) const |
Returns true if the strings compared are the same (regardless of character casing); otherwise returns false. | |
bool | CaseInsensitiveEqual (const CStr &string) const |
size_t | NumberOfLines () const |
Returns the number of line feeds inside a string. | |
size_t | Replace (const char *pFind, const char *pReplaceBy, bool firstOnly=false, size_t startPosition=0) |
Replaces one substring with another in this string. | |
Static Public Member Functions | |
static CStr | FromBSTR (const wchar_t *string, size_t length=(size_t) -1) |
static CStr | FromCP (UINT cp, const char *string, size_t length=(size_t) -1) |
static CStr | FromACP (const char *string, size_t length=(size_t) -1) |
static CStr | FromUTF8 (const char *string, size_t length=(size_t) -1) |
static CStr | FromOLESTR (const wchar_t *string, size_t length=(size_t) -1) |
static CStr | FromUTF16 (const wchar_t *string, size_t length=(size_t) -1) |
static CStr | FromUTF32 (const unsigned int *string, size_t length=(size_t) -1) |
static CStr | FromMaxString (MaxSDK::Util::MaxString &string) |
static CStr | FromCStr (const CStr &string) |
static CStr | FromWStr (const WStr &string) |
static CStr | FromMCHAR (const wchar_t *string, size_t length=(size_t) -1) |
static CStr | FromMSTR (const WStr &string) |
![]() | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new (size_t size, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. | |
static UtilExport void | operator delete (void *ptr) |
Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete[] (void *ptr) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. | |
CStr | ( | ) |
CStr | ( | const char * | cs | ) |
CStr | ( | const MaxSDK::Util::MaxString & | ws | ) |
CStr | ( | const MaxSDK::Util::MaxStringCast< char > & | ws | ) |
CStr | ( | const QString & | qstring | ) |
Conversion constructor, from QString.
~CStr | ( | ) |
Returns a pointer to this string which can be written to with up to 'nchars' characters.
nchars | The minimum number of characters to allocate in the string buffer (excluding the terminating null character). A value of -1 specifies that the existing buffer should be re-used. |
const char * data | ( | ) | const |
operator const char * | ( | ) | const & |
|
delete |
|
delete |
operator QString | ( | ) | const |
Conversion operator to QString.
|
inline |
|
inline |
int ByteCount | ( | ) | const |
int LanguageCharacterCount | ( | ) | const |
size_t AllocatedChars | ( | ) | const |
|
inline |
CStr & operator= | ( | const MaxSDK::Util::MaxString & | mstr | ) |
CStr & operator= | ( | const MaxSDK::Util::MaxStringCast< char > & | mstr | ) |
CStr & operator= | ( | const char * | cs | ) |
char operator[] | ( | int | i | ) | const |
Returns the nth character of this string.
Warning: In some environment, this function may return a partial character, especially for asiatic languages. If you intend to do any advance transformation or interpretation of the returned data, you should consider calling CStr::MultiByteCharacterSubString instead.
i | Index of that character. |
int first | ( | char | c | ) | const |
int last | ( | char | c | ) | const |
bool operator== | ( | const CStr & | cs | ) | const |
bool operator== | ( | char | c | ) | const |
bool operator!= | ( | const CStr & | cs | ) | const |
bool operator!= | ( | char | c | ) | const |
bool operator< | ( | const CStr & | cs | ) | const |
bool operator<= | ( | const CStr & | ws | ) | const |
bool operator> | ( | const CStr & | ws | ) | const |
bool operator>= | ( | const CStr & | ws | ) | const |
void toUpper | ( | ) |
void toLower | ( | ) |
int printf | ( | const char * | format, |
... | |||
) |
Write a formatted string into this CStr.
Writes the format string, filled in by the optional arguments into this CStr. See the ISO C++ documentation for more information on printf and format strings.
format | Specifies how to format the destination string. |
... | optional arguments to format into the destination string. |
int printf_l | ( | const char * | format, |
const _locale_t | theLocale, | ||
... | |||
) |
Write a formatted string into this CStr using specified locale.
Writes the format string, filled in by the optional arguments into this CStr. See the ISO C++ documentation for more information on printf_l and format strings.
format | Specifies how to format the destination string. |
theLocale | The locale to use. |
... | optional arguments to format into the destination string. |
int vprintf | ( | const char * | format, |
va_list | args | ||
) |
Write a formatted string into this CStr.
This method is similar to CStr::printf. Instead of taking a variable list of arguments as parameter, it takes a structure representing a variable list of arguments. This allows CStr objects to be used to build strings based on a format string and a variable number of arguments:
int vprintf_l | ( | const char * | format, |
const _locale_t | theLocale, | ||
va_list | args | ||
) |
Write a formatted string into this CStr using specified locale.
This method is similar to CStr::printf_l. Instead of taking a variable list of arguments as parameter, it takes a structure representing a variable list of arguments. This allows CStr objects to be used to build strings based on a format string, a locale, and a variable number of arguments:
wchar_t * ToBSTR | ( | ) | const |
MaxSDK::Util::MaxStringCastCP ToCP | ( | UINT | cp, |
size_t * | length = NULL |
||
) | const |
MaxSDK::Util::MaxStringCast< char > ToACP | ( | size_t * | length = NULL | ) | const |
MaxSDK::Util::MaxStringCastUTF8 ToUTF8 | ( | size_t * | length = NULL | ) | const |
MaxSDK::Util::MaxStringCast< WCHAR > ToOLESTR | ( | size_t * | length = NULL | ) | const |
MaxSDK::Util::MaxStringCast< WCHAR > ToUTF16 | ( | size_t * | length = NULL | ) | const |
MaxSDK::Util::MaxStringCast< unsigned int > ToUTF32 | ( | size_t * | length = NULL | ) | const |
MaxSDK::Util::MaxString ToMaxString | ( | ) | const |
void ToMaxString | ( | MaxSDK::Util::MaxString & | ) | const |
|
inlinestatic |
|
inline |
WStr ToWStr | ( | ) | const |
|
inline |
WStr ToMSTR | ( | ) | const |
bool EndsWith | ( | const CStr & | s, |
bool | caseSensitive = true |
||
) | const |
Returns true if the string ends with s; otherwise returns false.
s | The string to be searched. |
caseSensitive | If it is true(default), the search is case sensitive; otherwise the search is case insensitive. |
bool EndsWith | ( | char | c, |
bool | caseSensitive = true |
||
) | const |
Returns true if the string ends with c; otherwise returns false.
This function overloads EndsWith().
c | The character to be searched. |
caseSensitive | If it is true(default), the search is case sensitive; otherwise the search is case insensitive. |
bool StartsWith | ( | const CStr & | s, |
bool | caseSensitive = true |
||
) | const |
Returns true if the string starts with s; otherwise returns false.
s | The string to be searched. |
caseSensitive | If it is true(default), the search is case sensitive; otherwise the search is case insensitive. |
bool StartsWith | ( | char | c, |
bool | caseSensitive = true |
||
) | const |
Returns true if the string starts with c; otherwise returns false.
c | The character to be searched. |
caseSensitive | If it is true(default), the search is case sensitive; otherwise the search is case insensitive. |
bool CaseInsensitiveEqual | ( | const char * | string | ) | const |
Returns true if the strings compared are the same (regardless of character casing); otherwise returns false.
string | The string compared with. |
bool CaseInsensitiveEqual | ( | const CStr & | string | ) | const |
size_t NumberOfLines | ( | ) | const |
Returns the number of line feeds inside a string.
size_t Replace | ( | const char * | pFind, |
const char * | pReplaceBy, | ||
bool | firstOnly = false , |
||
size_t | startPosition = 0 |
||
) |
Replaces one substring with another in this string.
pFind | The substring to be replaced. |
pReplaceBy | The string the substring is to be replaced with. |
firstOnly | If true, only first occurrence of 'from' is replaced, otherwise all occurrences are replaced |
startPosition | The character position to start searching from |