-
首页
-
C4D R23.110 C++ SDK
CString Class Reference
系统
#include <string.h>
详细描述
Class
to store 8 bit strings. The
CString
stores 8 bit characters. Any characters are legal, including 0C (for example
CString
("\0\0\0\0", 4) will result in a
CString
with length 4). CStrings are reference-counted objects. This means that as long as you copy and do not modify strings they are just referenced. The first modification breaks the link and it becomes a unique new object. For error handling see
String
.
Member Typedef Documentation
◆
ConstIterator
◆
Iterator
◆
ValueType
构造函数 & 析构函数文档编制
◆
CString()
[1/4]
Constructor for Char array. If you have static Char strings use "..."_cs instead.
-
参数
-
[in]
|
str
|
C string block.
|
[in]
|
count
|
Number of characters, -1 to auto detect the length of the string (search for the first 0).
|
◆
CString()
[2/4]
Constructor to create a string with a specific length and a default character.
-
参数
-
[in]
|
count
|
Number of characters of the new string.
|
[in]
|
fillChar
|
Character to fill the string with.
|
◆
CString()
[3/4]
Constructor from a Char
Block
. If you have static strings use "..."_cs instead.
-
参数
-
◆
CString()
[4/4]
Constructor to create a
CString
from a
String
. The lower byte of each character will be copied, whereas the upper byte will be discarded.
-
参数
-
[in]
|
str
|
Unicode string.
|
[in]
|
stringEncoding
|
Encoding for the string. By default utf8 is selected. If a nullptr is passed the data is truncated to Char and no conversion takes place.
|
成员函数文档编制
◆
MAXON_DEFAULT_REFERENCE_CONSTRUCTORS()
MAXON_DEFAULT_REFERENCE_CONSTRUCTORS
|
(
|
CString
|
,
|
|
|
Reference
|
|
|
)
|
|
|
◆
operator[]()
[1/2]
Index operator to access single characters of the string.
-
参数
-
[in]
|
pos
|
Position within the string the first character starts with an index of 0. If the position is out of boundaries 0 will be returned.
|
-
返回
-
Utf32Char for read (right of =), Utf32Char& for write (left of =).
◆
operator[]()
[2/2]
Index operator to access single characters of the string.
-
参数
-
[in]
|
position
|
Position within the string the first character starts with an index of 0. if the position is out of boundaries no changes will be made.
|
-
返回
-
Utf32Char for read (right of =), Utf32Char& for write (left of =).
◆
Begin()
◆
End()
◆
IsEmpty()
Returns if the string length is zero.
-
返回
-
True if the string doesn't contain any character, or if it is a nullptr.
◆
IsPopulated()
Bool
IsPopulated
|
(
|
|
)
|
const
|
Returns if the string contains any characters.
-
返回
-
True if the string contains any character.
◆
operator+=()
◆
operator const Char *()
operator const
Char
*
|
(
|
|
)
|
const
|
Conversion to const Char*, returns the pointer to a null-terminated C string.
-
返回
-
Pointer to null terminated C string (can never be a nullptr).
◆
operator Block< const Char >()
Converts this
CString
to a block of characters. The null-terminator isn't part of the block.
-
返回
-
Block
of characters of this
CString
.
◆
GetLineEnd()
static const
CString
& GetLineEnd
|
(
|
|
)
|
|
|
static
|
Returns a string with the platform specific line ending.
-
返回
-
String
containing the line ending ("\r\n" or "\r").
◆
operator->()
void operator->
|
(
|
|
)
|
const
|
|
private
|