StringCount Class Reference 系统

#include <string.h>

详细描述

Class to store the character count for a string operation. StringCount allows you to specify a character count for operations like Insert or GetPart. However it also allows you to specify a StringPosition instead (implicitly defining the count).

Here an example for GetPart. The first parameter of GetPart is the class StringPosition , the second StringCount .

res = str.GetPart(2, 3); // copy from position 2 on three characters
res = str.GetPart(2, StringPosition(3)); // copy from position 2 to position 3 (two characters)

公共成员函数

MAXON_IMPLICIT   StringCount ( Int count)
MAXON_IMPLICIT   StringCount ( StringPosition pos)
MAXON_ATTRIBUTE_FORCE_INLINE Int   ResolvePosition ( Int startPos, Int length) const
MAXON_ATTRIBUTE_FORCE_INLINE Int   ResolveCount ( Int startPos, Int length) const

Private Attributes

Int   _value

Static Private Attributes

static const Int   STRING_COUNT_BIT

构造函数 & 析构函数文档编制

◆  StringCount() [1/2]

MAXON_IMPLICIT StringCount ( Int   count )

Constructor.

参数
[in] count The number of characters.

◆  StringCount() [2/2]

MAXON_IMPLICIT StringCount ( StringPosition   pos )

Constructor from a StringPosition .

参数
[in] pos The string position from the beginning or the end.

成员函数文档编制

◆  ResolvePosition()

MAXON_ATTRIBUTE_FORCE_INLINE Int ResolvePosition ( Int   startPos ,
Int   length  
) const

Calculates the end position of a range based on a given start position and a string length.

参数
[in] startPos The starting position of the range.
[in] length The length of the string.
返回
The end position of the range.

◆  ResolveCount()

MAXON_ATTRIBUTE_FORCE_INLINE Int ResolveCount ( Int   startPos ,
Int   length  
) const

Calculates the character count of a range based on a given start position and a string length.

参数
[in] startPos The starting position of the range.
[in] length The length of the string.
返回
The character count.

Member Data Documentation

◆  STRING_COUNT_BIT

const Int STRING_COUNT_BIT
static private

◆  _value

Int _value
private