#include <string.h>
Class to store the position in a string for a string operation. StringPosition just consists of an integer value. If it is positive, it indicates the absolute position. If it is negative it indicates the position from the end, e.g. -1 refers to the last character.
Here an example for GetPart. The first parameter of GetPart is the class StringPosition , the second StringCount .
res = str.GetPart(4, 3); // copy from position 4 on 3 characters
公共成员函数 |
|
MAXON_IMPLICIT | StringPosition ( Int pos) |
MAXON_ATTRIBUTE_FORCE_INLINE Int | ResolvePosition ( Int length) const |
Protected Attributes |
|
Int | _value |
Friends |
|
class | StringCount |
MAXON_IMPLICIT StringPosition | ( | Int | pos | ) |
Constructor.
[in] | pos | If pos is >= 0 it designates the absolute position. If pos is negative it relative to the end. E.g. -1 refers to the last character. |
MAXON_ATTRIBUTE_FORCE_INLINE Int ResolvePosition | ( | Int | length | ) | const |
Calculates the absolute position in a string based on the contents of this class and a given string length.
[in] | length | The length of the string. |
|
friend |
|
protected |