44 #ifndef Included_RexxString
45 #define Included_RexxString
54 #define STRING_BAD_VARIABLE 0
56 #define STRING_COMPOUND_NAME 2
57 #define STRING_LITERAL 3
58 #define STRING_LITERAL_DOT 4
59 #define STRING_NUMERIC 5
62 #define STRING_HASLOWER 0x01
63 #define STRING_NOLOWER 0x02
64 #define STRING_NONNUMERIC 0x04
65 #define STRING_ISASCII_CHECKED 0x08
66 #define STRING_ISASCII 0x10
67 #define STRING_EVAL_AS_TEXT 0x20
69 #define INITIAL_NAME_SIZE 10
70 #define EXTENDED_NAME_SIZE 10
72 #define STRIP_BOTH 'B'
73 #define STRIP_LEADING 'L'
74 #define STRIP_TRAILING 'T'
76 #define DATATYPE_ALPHANUMERIC 'A'
77 #define DATATYPE_BINARY 'B'
78 #define DATATYPE_LOWERCASE 'L'
79 #define DATATYPE_MIXEDCASE 'M'
80 #define DATATYPE_NUMBER 'N'
81 #define DATATYPE_SYMBOL 'S'
82 #define DATATYPE_VARIABLE 'V'
83 #define DATATYPE_UPPERCASE 'U'
84 #define DATATYPE_WHOLE_NUMBER 'W'
85 #define DATATYPE_HEX 'X'
86 #define DATATYPE_9DIGITS '9'
87 #define DATATYPE_LOGICAL 'O'
89 #define VERIFY_MATCH 'M'
90 #define VERIFY_NOMATCH 'N'
96 #define HEX_CHAR_STR "0123456789ABCDEFabcdef"
98 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
100 #define LOWER_ALPHA "abcdefghijklmnopqrstuvwxyz"
101 #define MIXED_ALPHA \
102 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
103 #define UPPER_ALPHA "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
119 return "0123456789ABCDEF"[n];
124 inline void *
operator new(
size_t size,
void *ptr){
return ptr;};
129 void checkTE(
const char *method);
197 size_t copyData(
size_t,
char *,
size_t);
284 const char *
caselessLastPos(
const char *needle,
size_t needleLen,
const char *haystack,
size_t haystackLen);
348 inline void set(
size_t s,
int c,
size_t l) { memset((this->
stringData + s), c, l); };
375 return previousEncoding;
434 size_t compareLength =
length;
435 if (compareLength > other->
length) {
436 compareLength = other->
length;
443 else if (length < other->
length) {
451 size_t compareLength =
length;
452 if (compareLength > other->
length) {
453 compareLength = other->
length;
460 else if (length < other->
length) {
469 if ((startCol <
length ) && (startCol < other->
length)) {
470 size_t stringLength =
length;
471 if (stringLength > other->
length) {
472 stringLength = other->
length;
474 stringLength = stringLength - startCol + 1;
475 size_t compareLength = colLength;
476 if (compareLength > stringLength) {
477 compareLength = stringLength;
481 if (result == 0 && stringLength < colLength) {
485 else if (length < other->
length) {
503 if ((startCol <
length ) && (startCol < other->
length)) {
504 size_t stringLength =
length;
505 if (stringLength > other->
length) {
506 stringLength = other->
length;
508 stringLength = stringLength - startCol + 1;
509 size_t compareLength = colLength;
510 if (compareLength > stringLength) {
511 compareLength = stringLength;
515 if (result == 0 && stringLength < colLength) {
519 else if (length < other->
length) {
591 va_start(args, format);
594 s->
finish(n >= 0 ? n : 0);
662 const char *firstPeriod = strchr(cstring,
'.');
663 return (firstPeriod != NULL && *(firstPeriod + 1) ==
'\0');
RexxObject *(RexxObject::* PCPPM)()
void * rmemcpy(void *t, RexxString *s, size_t blen)
char * rstrcat(char *t, RexxString *s)
RexxString * raw_string(stringsize_t l)
RexxString * new_string(const char *s, stringsize_t l)
bool isStem(const char *cstring)
#define STRING_NONNUMERIC
char * rstrcpy(char *t, RexxString *s)
#define STRING_ISASCII_CHECKED
RexxString * new_proxy(const char *name)
char IntToHexDigit(int n)
RexxString * new_upper_string(const char *s, stringsize_t l)
int rmemcmp(const void *t, RexxString *s, size_t blen)
int rstrcmp(const char *t, RexxString *s)
#define STRING_EVAL_AS_TEXT
int rsnprintf(RexxString *s, const char *format,...)
RexxMessage * start(RexxObject **, size_t, size_t)
RexxObject * makeArrayRexx()
RexxString * stringValue()
bool numberValue(wholenumber_t &result, size_t precision)
RexxInteger * isLessOrEqual(RexxObject *)
RexxArray * subWords(RexxInteger *, RexxInteger *)
size_t lastPos(RexxString *needle, size_t start)
RexxInteger * isLessThan(RexxObject *)
RexxString * concatRexx(RexxObject *)
static void createInstance()
const char * caselessLastPos(const char *needle, size_t needleLen, const char *haystack, size_t haystackLen)
RexxInteger * strictEqual(RexxObject *)
RexxInteger * caselessEquals(RexxString *other)
static RexxString * newProxy(const char *)
void checkTE(const char *method)
RexxObject * trunc(RexxInteger *decimals)
RexxString * changeStr(RexxString *, RexxString *, RexxInteger *)
RexxInteger * caselessLastPosRexx(RexxString *, RexxInteger *, RexxInteger *)
void toRxstring(CONSTRXSTRING &r)
RexxObject * xorOp(RexxObject *)
RexxString * translate(RexxString *, RexxString *, RexxString *, RexxInteger *, RexxInteger *)
RexxObject * operatorNot(RexxObject *)
RexxObject * Min(RexxObject **args, size_t argCount, size_t named_argCount)
RexxString * bitOr(RexxString *, RexxString *)
bool primitiveMatch(stringsize_t start, RexxString *other, stringsize_t offset, stringsize_t len)
bool primitiveCaselessIsEqual(RexxObject *)
RexxObject * getEncoding()
int sortCaselessCompare(RexxString *other, size_t startCol, size_t colLength)
bool strCaselessCompare(const char *s)
RexxInteger * strictGreaterThan(RexxObject *)
RexxObject * evaluate(RexxActivation *, RexxExpressionStack *)
RexxString * delstr(RexxInteger *, RexxInteger *)
RexxString * upperRexx(RexxInteger *, RexxInteger *)
HashCode getObjectHashCode()
RexxString * bitAnd(RexxString *, RexxString *)
RexxInteger * wordIndex(RexxInteger *)
size_t caselessPos(RexxString *, size_t)
RexxInteger * notEqual(RexxObject *)
RexxInteger * strictLessOrEqual(RexxObject *)
RexxNumberString * createNumberString()
RexxString * overlay(RexxString *, RexxInteger *, RexxInteger *, RexxString *)
size_t pos(RexxString *, size_t)
RexxObject * lengthRexx()
RexxInteger * abbrev(RexxString *, RexxInteger *)
RexxNumberString * fastNumberString()
RexxObject * format(RexxObject *Integers, RexxObject *Decimals, RexxObject *MathExp, RexxObject *ExpTrigger)
bool doubleValue(double &result)
void toRxstring(RXSTRING &r)
void liveGeneral(int reason)
RexxInteger * caselessMatchChar(RexxInteger *position_, RexxString *matchSet)
RexxString * makeString()
RexxString * subWord(RexxInteger *, RexxInteger *)
RexxObject * logicalOperation(RexxObject *, RexxObject *, unsigned int)
const char * getStringData()
RexxInteger * verify(RexxString *, RexxString *, RexxInteger *, RexxInteger *)
RexxInteger * caselessMatch(RexxInteger *start_, RexxString *other, RexxInteger *offset_, RexxInteger *len_)
RexxString * caselessChangeStr(RexxString *, RexxString *, RexxInteger *)
RexxString * space(RexxInteger *, RexxString *)
RexxString * encodeBase64()
RexxInteger * caselessPosRexx(RexxString *, RexxInteger *, RexxInteger *)
RexxObject * integerDivide(RexxObject *right)
void setNumberString(RexxObject *)
RexxObject * remainder(RexxObject *right)
RexxString * d2x(RexxInteger *)
RexxObject * Max(RexxObject **args, size_t argCount, size_t named_argCount)
RexxInteger * integerValue(size_t precision)
RexxInteger * match(RexxInteger *start_, RexxString *other, RexxInteger *offset_, RexxInteger *len_)
RexxString * concatBlank(RexxObject *)
RexxInteger * caselessCountStrRexx(RexxString *)
RexxNumberString * numberString()
void setEncoding(RexxObject *e)
RexxString * d2c(RexxInteger *)
RexxInteger * lastPosRexx(RexxString *, RexxInteger *, RexxInteger *)
void set(size_t s, int c, size_t l)
static RexxString * newString(const char *, size_t l)
RexxObject * setTextRexx(RexxObject *t)
RexxString * x2dC2d(RexxInteger *, bool)
RexxInteger * compareToRexx(RexxString *other, RexxInteger *start_, RexxInteger *len_)
void setIsASCIIChecked(bool value=true)
RexxObject * getRealValue(RexxActivation *)
RexxInteger * compare(RexxString *, RexxString *)
bool primitiveIsEqual(RexxObject *)
RexxObject * plus(RexxObject *right)
int sortCaselessCompare(RexxString *other)
RexxInteger * caselessCompare(RexxString *, RexxString *)
RexxInteger * strictLessThan(RexxObject *)
RexxInteger * strictGreaterOrEqual(RexxObject *)
bool memCompare(RexxString *other)
void setIsASCII(bool value=true)
RexxString * extract(size_t offset, size_t sublength)
RexxString * bitXor(RexxString *, RexxString *)
RexxString * word(RexxInteger *)
void flatten(RexxEnvelope *envelope)
size_t copyData(size_t, char *, size_t)
RexxString * x2d(RexxInteger *)
RexxString * left(RexxInteger *, RexxString *)
RexxInteger * matchChar(RexxInteger *position_, RexxString *matchSet)
bool memCompare(const char *s, size_t l)
RexxInteger * equal(RexxObject *)
RexxObject * multiply(RexxObject *right)
RexxString * subchar(RexxInteger *)
RexxString * substr(RexxInteger *, RexxInteger *, RexxString *)
RexxString * replaceAt(RexxString *, RexxInteger *, RexxInteger *, RexxString *)
RexxString * concatWithCstring(const char *)
RexxObject * dataType(RexxString *)
static RexxClass * classInstance
size_t caselessLastPos(RexxString *needle, size_t start)
virtual bool logicalValue(logical_t &)
RexxObject * setEncodingRexx(RexxObject *e)
RexxObject * andOp(RexxObject *)
size_t caselessCountStr(RexxString *)
bool isEqual(RexxObject *)
wholenumber_t comp(RexxObject *, RexxString *alternativeOperator=OREF_NULL, RexxInteger **alternativeOperatorResultPtr=NULL)
virtual HashCode getHashValue()
RexxInteger * caselessWordPos(RexxString *, RexxInteger *)
RexxString * concat(RexxString *)
RexxString * concatWith(RexxString *, char)
RexxString * c2d(RexxInteger *)
char putChar(size_t p, char c)
void setText(RexxObject *t)
RexxObject * getValue(RexxActivation *)
RexxInteger * caselessCompareToRexx(RexxString *other, RexxInteger *start_, RexxInteger *len_)
bool endsWith(codepoint_t c)
RexxInteger * posRexx(RexxString *, RexxInteger *, RexxInteger *)
RexxString * stringTrace()
RexxInteger * wordLength(RexxInteger *)
RexxString * concatToCstring(const char *)
wholenumber_t compareTo(RexxObject *)
RexxNumberString * NumberString
RexxString * copies(RexxInteger *)
RexxString * right(RexxInteger *, RexxString *)
bool strCompare(const char *s)
RexxInteger * primitiveCompareTo(RexxString *other, stringsize_t start, stringsize_t len)
void copyToRxstring(RXSTRING &r)
int sortCompare(RexxString *other, size_t startCol, size_t colLength)
RexxInteger * isASCIIRexx()
RexxInteger * countStrRexx(RexxString *)
RexxInteger * wordPos(RexxString *, RexxInteger *)
RexxInteger * caselessAbbrev(RexxString *, RexxInteger *)
RexxInteger * isGreaterOrEqual(RexxObject *)
RexxObject * orOp(RexxObject *)
RexxString * newRexx(RexxObject **, size_t, size_t)
RexxObject * divide(RexxObject *right)
int sortCompare(RexxString *other)
RexxObject * unflatten(RexxEnvelope *)
RexxString * insert(RexxString *, RexxInteger *, RexxInteger *, RexxString *)
RexxString * strip(RexxString *, RexxString *)
RexxString * delWord(RexxInteger *, RexxInteger *)
static RexxString * rawString(size_t l)
RexxInteger * equals(RexxString *other)
void put(size_t s, RexxString *o)
void put(size_t s, const void *b, size_t l)
RexxInteger * primitiveCaselessCompareTo(RexxString *other, stringsize_t start, stringsize_t len)
void finish(stringsize_t l)
RexxInteger * isGreaterThan(RexxObject *)
bool primitiveCaselessMatch(stringsize_t start, RexxString *other, stringsize_t offset, stringsize_t len)
wholenumber_t strictComp(RexxObject *, RexxString *alternativeOperator=NULL, RexxInteger **alternativeOperatorResultPtr=NULL)
RexxObject * power(RexxObject *right)
RexxString * decodeBase64()
RexxString * lowerRexx(RexxInteger *, RexxInteger *)
bool unsignedNumberValue(uwholenumber_t &result, size_t precision)
static PCPPM operatorMethods[]
RexxString * primitiveMakeString()
virtual RexxObject * dynamicTarget(RexxObject **arguments, size_t count, size_t named_count)
RexxInteger * strictNotEqual(RexxObject *)
RexxString * center(RexxInteger *, RexxString *)
static RexxString * newUpperString(const char *, stringsize_t l)
RexxObject * minus(RexxObject *right)
void copyIntoTail(RexxCompoundTail *buffer)
static int caselessCompare(const char *, const char *, size_t)
static int strCaselessCompare(const char *opt1, const char *opt2)
static int vsnprintf(char *buffer, size_t count, const char *format, va_list args)