RexxMutableBuffer Class Reference

#include <MutableBufferClass.hpp>

Inheritance diagram for RexxMutableBuffer:
[legend]

Public Member Functions

void * operator new (size_t size, void *ptr)
 
void * operator new (size_t size, RexxClass *bufferClass)
 
void * operator new (size_t size)
 
 RexxMutableBuffer ()
 
 RexxMutableBuffer (size_t, size_t)
 
 RexxMutableBuffer (RESTORETYPE restoreType)
 
void live (size_t)
 
void liveGeneral (int reason)
 
void flatten (RexxEnvelope *envelope)
 
RexxObjectcopy ()
 
void ensureCapacity (size_t addedLength)
 
RexxObjectlengthRexx ()
 
RexxMutableBufferappend (RexxObject *)
 
RexxMutableBufferappendCstring (const char *, size_t blength)
 
RexxMutableBufferinsert (RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
RexxMutableBufferoverlay (RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
RexxMutableBufferreplaceAt (RexxObject *str, RexxObject *pos, RexxObject *len, RexxObject *pad)
 
RexxMutableBuffermydelete (RexxObject *, RexxObject *)
 
RexxStringsubstr (RexxInteger *startPosition, RexxInteger *len, RexxString *pad)
 
RexxIntegerlastPos (RexxString *needle, RexxInteger *_start, RexxInteger *_range)
 
RexxIntegerposRexx (RexxString *needle, RexxInteger *_start, RexxInteger *_range)
 
RexxIntegercaselessLastPos (RexxString *needle, RexxInteger *_start, RexxInteger *_range)
 
RexxIntegercaselessPos (RexxString *needle, RexxInteger *_start, RexxInteger *_range)
 
RexxStringsubchar (RexxInteger *startPosition)
 
RexxIntegergetBufferSize ()
 
RexxObjectsetBufferSize (RexxInteger *)
 
RexxArraymakeArrayRexx (RexxString *div)
 
RexxArraymakeArray ()
 
RexxStringmakeString ()
 
RexxStringprimitiveMakeString ()
 
RexxIntegercountStrRexx (RexxString *needle)
 
RexxIntegercaselessCountStrRexx (RexxString *needle)
 
RexxMutableBufferchangeStr (RexxString *needle, RexxString *newNeedle, RexxInteger *countArg)
 
RexxMutableBuffercaselessChangeStr (RexxString *needle, RexxString *newNeedle, RexxInteger *countArg)
 
RexxMutableBufferupper (RexxInteger *_start, RexxInteger *_length)
 
RexxMutableBufferlower (RexxInteger *_start, RexxInteger *_length)
 
RexxMutableBuffertranslate (RexxString *tableo, RexxString *tablei, RexxString *pad, RexxInteger *, RexxInteger *)
 
RexxIntegermatch (RexxInteger *start_, RexxString *other, RexxInteger *offset_, RexxInteger *len_)
 
RexxIntegercaselessMatch (RexxInteger *start_, RexxString *other, RexxInteger *offset_, RexxInteger *len_)
 
bool primitiveMatch (stringsize_t start, RexxString *other, stringsize_t offset, stringsize_t len)
 
bool primitiveCaselessMatch (stringsize_t start, RexxString *other, stringsize_t offset, stringsize_t len)
 
RexxIntegermatchChar (RexxInteger *position_, RexxString *matchSet)
 
RexxIntegercaselessMatchChar (RexxInteger *position_, RexxString *matchSet)
 
RexxIntegerverify (RexxString *, RexxString *, RexxInteger *, RexxInteger *)
 
RexxStringsubWord (RexxInteger *, RexxInteger *)
 
RexxArraysubWords (RexxInteger *, RexxInteger *)
 
RexxStringword (RexxInteger *)
 
RexxIntegerwordIndex (RexxInteger *)
 
RexxIntegerwordLength (RexxInteger *)
 
RexxIntegerwords ()
 
RexxIntegerwordPos (RexxString *, RexxInteger *)
 
RexxIntegercaselessWordPos (RexxString *, RexxInteger *)
 
RexxMutableBufferdelWord (RexxInteger *position, RexxInteger *plength)
 
RexxMutableBufferspace (RexxInteger *space_count, RexxString *pad)
 
const char * getStringData ()
 
size_t getLength ()
 
void setLength (size_t l)
 
size_t getBufferLength ()
 
RexxObjectsetBufferLength (size_t)
 
char * getData ()
 
void copyData (size_t offset, const char *string, size_t l)
 
void openGap (size_t offset, size_t _size, size_t tailSize)
 
void closeGap (size_t offset, size_t _size, size_t tailSize)
 
void adjustGap (size_t offset, size_t _size, size_t _newSize)
 
void setData (size_t offset, codepoint_t character, size_t l)
 
char getCharB (size_t offset)
 
size_t setDataLength (size_t l)
 
size_t getCapacity ()
 
char * setCapacity (size_t newLength)
 
bool checkIsASCII ()
 
RexxIntegerisASCIIRexx ()
 
bool isASCIIChecked ()
 
void setIsASCIIChecked (bool value=true)
 
bool isASCII ()
 
void setIsASCII (bool value=true)
 
RexxObjectgetEncoding ()
 
void setEncoding (RexxObject *e)
 
RexxObjectsetEncodingRexx (RexxObject *e)
 
- Public Member Functions inherited from RexxObject
void * operator new (size_t, RexxClass *)
 
void * operator new (size_t, RexxClass *, RexxObject **, size_t, size_t)
 
void * operator new (size_t size, void *objectPtr)
 
void operator delete (void *, void *)
 
void operator delete (void *)
 
void operator delete (void *, RexxClass *)
 
void operator delete (void *, RexxClass *, RexxObject **, size_t)
 
RexxObjectnewRexx (RexxObject **arguments, size_t argCount, size_t named_argCount)
 
RexxObjectnewObject ()
 
 operator RexxInternalObject * ()
 
 RexxObject ()
 
 RexxObject (RESTORETYPE restoreType)
 
void initializeNewObject (size_t size, size_t mark, void *vft, RexxBehaviour *b)
 
void initializeNewObject (size_t mark, void *vft, RexxBehaviour *b)
 
virtual ~RexxObject ()
 
virtual RexxObjectdefMethod (RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
 
virtual RexxStringdefaultName ()
 
virtual RexxObjectunknown (RexxString *msg, RexxArray *args, RexxDirectory *named_args)
 
virtual RexxIntegerhasMethod (RexxString *msg)
 
bool hasUninitMethod ()
 
RexxObjectinit ()
 
void uninit ()
 
void live (size_t)
 
void liveGeneral (int reason)
 
void flatten (RexxEnvelope *)
 
RexxObjectcopy ()
 
HashCode hash ()
 
bool truthValue (int)
 
virtual bool logicalValue (logical_t &)
 
virtual bool numberValue (wholenumber_t &result, size_t precision)
 
virtual bool numberValue (wholenumber_t &result)
 
virtual bool unsignedNumberValue (stringsize_t &result, size_t precision)
 
virtual bool unsignedNumberValue (stringsize_t &result)
 
virtual bool doubleValue (double &result)
 
RexxNumberStringnumberString ()
 
RexxIntegerintegerValue (size_t)
 
RexxStringmakeString ()
 
RexxTextmakeText ()
 
void copyIntoTail (RexxCompoundTail *buffer)
 
RexxArraymakeArray ()
 
RexxStringstringValue ()
 
RexxTexttextValue ()
 
RexxStringrequestString ()
 
RexxStringrequestStringNoNOSTRING ()
 
RexxTextrequestText ()
 
RexxIntegerrequestInteger (size_t)
 
bool requestNumber (wholenumber_t &, size_t)
 
bool requestUnsignedNumber (stringsize_t &, size_t)
 
RexxArrayrequestArray ()
 
RexxDirectoryrequestDirectory ()
 
RexxStringrequiredString (RexxString *kind, size_t)
 
RexxStringrequiredString (RexxString *kind, const char *)
 
RexxStringrequiredString ()
 
RexxIntegerrequiredInteger (RexxString *kind, size_t, size_t)
 
wholenumber_t requiredNumber (RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
stringsize_t requiredPositive (RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
stringsize_t requiredNonNegative (RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
bool isEqual (RexxObject *)
 
bool isInstanceOf (RexxClass *)
 
RexxObjectisInstanceOfRexx (RexxClass *)
 
RexxObjectisNilRexx ()
 
RexxMethodinstanceMethod (RexxString *)
 
RexxSupplierinstanceMethods (RexxClass *)
 
RexxMethodinstanceMethodRexx (RexxString *)
 
RexxSupplierinstanceMethodsRexx (RexxClass *)
 
RexxObjectdynamicTargetRexx (RexxObject **arguments, size_t argCount, size_t named_argCount)
 
RexxStringobjectName ()
 
RexxObjectobjectNameEquals (RexxObject *)
 
RexxClassclassObject ()
 
RexxObjectsetMethod (RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
 
RexxObjectunsetMethod (RexxString *)
 
RexxObjectrequestRexx (RexxString *)
 
RexxMessagestart (RexxObject **, size_t, size_t)
 
RexxMessagestartWith (RexxObject *, RexxArray *, RexxObject **, size_t)
 
RexxObjectsend (RexxObject **, size_t, size_t)
 
RexxObjectsendWith (RexxObject *, RexxArray *, RexxObject **, size_t)
 
RexxMessagestartCommon (RexxObject *message, RexxObject **arguments, size_t argCount, size_t named_argCount)
 
RexxStringoref ()
 
RexxObjectpmdict ()
 
RexxObjectrun (RexxObject **, size_t, size_t)
 
bool messageSend (RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true, bool dynamicTarget=true)
 
bool messageSend (RexxString *, RexxObject **, size_t, size_t, RexxObject *, ProtectedObject &, bool processUnknown=true, bool dynamicTarget=true)
 
RexxMethodcheckPrivate (RexxMethod *, RexxErrorCodes &)
 
RexxMethodcheckPackage (RexxMethod *, RexxErrorCodes &)
 
void processUnknown (RexxErrorCodes, RexxString *, RexxObject **, size_t, size_t, ProtectedObject &)
 
void processProtectedMethod (RexxString *, RexxMethod *, RexxObject **, size_t, size_t, ProtectedObject &)
 
void sendMessage (RexxString *, RexxArray *, RexxDirectory *, ProtectedObject &)
 
void sendMessage (RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount, ProtectedObject &result)
 
void sendMessage (RexxString *message, ProtectedObject &result)
 
void sendMessage (RexxString *message, RexxObject *argument1, ProtectedObject &result)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, ProtectedObject &)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, ProtectedObject &)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, ProtectedObject &)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, ProtectedObject &)
 
RexxObjectsendMessage (RexxString *, RexxArray *, RexxDirectory *=OREF_NULL)
 
RexxObjectsendMessage (RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount)
 
RexxObjectsendMessage (RexxString *message)
 
RexxObjectsendMessage (RexxString *message, RexxObject *argument1)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
RexxObjectdefMethods (RexxDirectory *)
 
void setObjectVariable (RexxString *, RexxObject *, RexxObject *)
 
RexxObjectgetObjectVariable (RexxString *)
 
RexxObjectgetObjectVariable (RexxString *, RexxObject *)
 
void addObjectVariables (RexxVariableDictionary *)
 
void copyObjectVariables (RexxObject *newObject)
 
RexxObjectsuperScope (RexxObject *)
 
RexxMethodsuperMethod (RexxString *, RexxObject *)
 
RexxObjectmdict ()
 
RexxObjectsetMdict (RexxObject *)
 
RexxBehaviourbehaviourObject ()
 
const char * idString ()
 
RexxStringid ()
 
RexxMethodmethodLookup (RexxString *name)
 
RexxVariableDictionarygetObjectVariables (RexxObject *)
 
void guardOn (RexxActivity *activity, RexxObject *scope)
 
void guardOff (RexxActivity *activity, RexxObject *scope)
 
RexxObjectequal (RexxObject *)
 
RexxObjectnotEqual (RexxObject *other)
 
RexxObjectstrictEqual (RexxObject *)
 
RexxObjectstrictNotEqual (RexxObject *other)
 
RexxIntegeridentityHashRexx ()
 
RexxObjecthashCode ()
 
RexxStringstringRexx ()
 
RexxStringconcatRexx (RexxObject *)
 
RexxStringconcatBlank (RexxObject *)
 
RexxObjectmakeStringRexx ()
 
RexxObjectmakeArrayRexx ()
 
RexxStringdefaultNameRexx ()
 
RexxObjectcopyRexx ()
 
RexxObjectunknownRexx (RexxString *, RexxArray *, RexxObject **, size_t)
 
RexxObjecthasMethodRexx (RexxString *)
 
void * getCSelf ()
 
void * getCSelf (RexxObject *scope)
 
bool equalValue (RexxObject *other)
 
virtual wholenumber_t compareTo (RexxObject *)
 
 koper (operator_plus) koper(operator_minus) koper(operator_multiply) koper(operator_divide) koper(operator_integerDivide) koper(operator_remainder) koper(operator_power) koper(operator_abuttal) koper(operator_concat) koper(operator_concatBlank) koper(operator_equal) koper(operator_notEqual) koper(operator_isGreaterThan) koper(operator_isBackslashGreaterThan) koper(operator_isLessThan) koper(operator_isBackslashLessThan) koper(operator_isGreaterOrEqual) koper(operator_isLessOrEqual) koper(operator_strictEqual) koper(operator_strictNotEqual) koper(operator_strictGreaterThan) koper(operator_strictBackslashGreaterThan) koper(operator_strictLessThan) koper(operator_strictBackslashLessThan) koper(operator_strictGreaterOrEqual) koper(operator_strictLessOrEqual) koper(operator_lessThanGreaterThan) koper(operator_greaterThanLessThan) koper(operator_and) koper(operator_or) koper(operator_xor) koper(operator_not) RexxVariableDictionary *objectVariables
 
- Public Member Functions inherited from RexxInternalObject
void * operator new (size_t, RexxClass *)
 
void * operator new (size_t, RexxClass *, RexxObject **, size_t, size_t)
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *)
 
void operator delete (void *p, void *ptr)
 
 RexxInternalObject ()
 
 RexxInternalObject (RESTORETYPE restoreType)
 
virtual ~RexxInternalObject ()
 
 operator RexxObject * ()
 
size_t getObjectSize ()
 
void setObjectSize (size_t s)
 
size_t getObjectDataSize ()
 
void * getObjectDataSpace ()
 
void clearObject ()
 
void clearObject (size_t l)
 
void setVirtualFunctions (void *t)
 
void setInitHeader (size_t s, size_t markword)
 
void setInitHeader (size_t markword)
 
void setObjectLive (size_t markword)
 
void setHasReferences ()
 
void setHasNoReferences ()
 
bool hasReferences ()
 
bool hasNoReferences ()
 
void setPrimitive ()
 
void setNonPrimitive ()
 
bool isPrimitive ()
 
bool isNonPrimitive ()
 
void setInRexxPackage ()
 
bool isInRexxPackage ()
 
bool isObjectMarked (size_t markword)
 
void setObjectMark (size_t markword)
 
void clearObjectMark ()
 
bool isObjectLive (size_t mark)
 
bool isObjectDead (size_t mark)
 
bool isOldSpace ()
 
bool isNewSpace ()
 
void setNewSpace ()
 
void setOldSpace ()
 
void makeProxiedObject ()
 
bool isProxyObject ()
 
bool isSubClassOrEnhanced ()
 
bool isBaseClass ()
 
size_t getObjectTypeNumber ()
 
RexxBehaviourgetObjectType ()
 
bool isObjectType (RexxBehaviour *b)
 
bool isObjectType (size_t t)
 
bool isSameType (RexxInternalObject *o)
 
void setBehaviour (RexxBehaviour *b)
 
virtual RexxObjectmakeProxy (RexxEnvelope *)
 
virtual RexxObjectevaluate (RexxActivation *, RexxExpressionStack *)
 
virtual RexxObjectgetValue (RexxActivation *)
 
virtual RexxObjectgetValue (RexxVariableDictionary *)
 
virtual RexxObjectgetRealValue (RexxActivation *)
 
virtual RexxObjectgetRealValue (RexxVariableDictionary *)
 
virtual HashCode getHashValue ()
 
HashCode identityHash ()
 
virtual RexxTextprimitiveMakeText ()
 
virtual RexxObjectdynamicTarget (RexxObject **arguments, size_t count, size_t named_count)
 
void hasUninit ()
 
void removedUninit ()
 
void printObject ()
 
RexxObjectclone ()
 
- Public Member Functions inherited from RexxVirtualBase
virtual RexxObjectunflatten (RexxEnvelope *)
 

Static Public Member Functions

static void createInstance ()
 
- Static Public Member Functions inherited from RexxObject
static void decodeMessageName (RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope)
 
static void createInstance ()
 
- Static Public Member Functions inherited from RexxInternalObject
static size_t getObjectHeaderSize ()
 

Static Public Attributes

static RexxClassclassInstance = OREF_NULL
 
- Static Public Attributes inherited from RexxObject
static PCPPM operatorMethods []
 
static RexxClassclassInstance = OREF_NULL
 

Protected Attributes

size_t bufferLength
 
size_t defaultSize
 
size_t dataLength
 
size_t Attributes
 
RexxObjectencoding
 
RexxBufferdata
 

Friends

class RexxMutableBufferClass
 

Additional Inherited Members

- Public Attributes inherited from RexxInternalObject
ObjectHeader header
 
RexxBehaviourbehaviour
 
- Protected Member Functions inherited from RexxVirtualBase
virtual ~RexxVirtualBase ()
 
virtual void baseVirtual ()
 

Detailed Description

Definition at line 61 of file MutableBufferClass.hpp.

Constructor & Destructor Documentation

◆ RexxMutableBuffer() [1/3]

RexxMutableBuffer::RexxMutableBuffer ( )

◆ RexxMutableBuffer() [2/3]

RexxMutableBuffer::RexxMutableBuffer ( size_t  l,
size_t  d 
)

Constructor with explicitly set size and default.

Parameters
lInitial length.
dThe explicit default size.

Definition at line 167 of file MutableBufferClass.cpp.

References bufferLength, data, defaultSize, new_buffer(), OREF_NULL, and setLength().

◆ RexxMutableBuffer() [3/3]

RexxMutableBuffer::RexxMutableBuffer ( RESTORETYPE  restoreType)
inline

Definition at line 69 of file MutableBufferClass.hpp.

Member Function Documentation

◆ adjustGap()

void RexxMutableBuffer::adjustGap ( size_t  offset,
size_t  _size,
size_t  _newSize 
)
inline

Definition at line 133 of file MutableBufferClass.hpp.

References RexxBufferBase::adjustGap(), and data.

Referenced by replaceAt().

◆ append()

◆ appendCstring()

RexxMutableBuffer * RexxMutableBuffer::appendCstring ( const char *  _data,
size_t  blength 
)

◆ caselessChangeStr()

RexxMutableBuffer * RexxMutableBuffer::caselessChangeStr ( RexxString needle,
RexxString newNeedle,
RexxInteger countArg 
)

Do an inplace caseless changeStr operation on a mutablebuffer.

Parameters
needleThe search needle.
newNeedleThe replacement string.
countArgThe number of occurrences to replace.
Returns
The target MutableBuffer

Definition at line 1107 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, StringUtil::caselessCountStr(), StringUtil::caselessPos(), RexxString::checkIsASCII(), copyData(), ensureCapacity(), getLength(), RexxString::getLength(), getStringData(), RexxString::getStringData(), isASCII(), Numerics::MAX_WHOLENUMBER, openGap(), optionalPositive(), setIsASCII(), setIsASCIIChecked(), setLength(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ caselessCountStrRexx()

RexxInteger * RexxMutableBuffer::caselessCountStrRexx ( RexxString needle)

◆ caselessLastPos()

RexxInteger * RexxMutableBuffer::caselessLastPos ( RexxString needle,
RexxInteger pstart,
RexxInteger range 
)

Perform a caseless search for the last position of a string within the buffer.

Parameters
needleThe search needle.
pstartthe starting position.
Returns
The index of the located string. Returns 0 if no matches are found.

Definition at line 874 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, StringUtil::caselessLastPos(), getLength(), getStringData(), new_integer(), optionalLengthArgument(), optionalPositionArgument(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ caselessMatch()

RexxInteger * RexxMutableBuffer::caselessMatch ( RexxInteger start_,
RexxString other,
RexxInteger offset_,
RexxInteger len_ 
)

Test if regions within two strings match.

Parameters
start_The starting compare position within the target string. This must be within the bounds of the string.
otherThe other compare string.
offset_The starting offset of the compare string. This must be within the string bounds. The default start postion is 1.
len_The length of the compare substring. The length and the offset must specify a valid substring of other. If not specified, this defaults to the substring from the offset to the end of the string.
Returns
True if the two regions match, false for any mismatch.

Definition at line 1479 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, Error_Incorrect_method_length, Error_Incorrect_method_position, getLength(), RexxString::getLength(), optionalLengthArgument(), optionalPositionArgument(), positionArgument(), primitiveCaselessMatch(), reportException(), stringArgument(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ caselessMatchChar()

RexxInteger * RexxMutableBuffer::caselessMatchChar ( RexxInteger position_,
RexxString matchSet 
)

Compare a single character at a give position against a set of characters to see if any of the characters is a match.

Parameters
position_The character position
matchSetThe set to compare against.
Returns
true if the character at the give position is any of the characters, false if none of them match.

Definition at line 1609 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, Error_Incorrect_method_position, RexxString::getChar(), getCharB(), getLength(), RexxString::getLength(), positionArgument(), reportException(), stringArgument(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ caselessPos()

RexxInteger * RexxMutableBuffer::caselessPos ( RexxString needle,
RexxInteger pstart,
RexxInteger range 
)

Perform a caseless search for a string within the buffer.

Parameters
needleThe search needle.
pstartthe starting position.
Returns
The index of the located string. Returns 0 if no matches are found.

Definition at line 848 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, StringUtil::caselessPos(), getLength(), getStringData(), new_integer(), optionalLengthArgument(), optionalPositionArgument(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ caselessWordPos()

RexxInteger * RexxMutableBuffer::caselessWordPos ( RexxString phrase,
RexxInteger pstart 
)

Perform a caseless wordpos search on a string object.

Parameters
phraseThe search phrase
pstartThe starting search position.
Returns
The index of the match location.

Definition at line 1769 of file MutableBufferClass.cpp.

References StringUtil::caselessWordPos(), getLength(), and getStringData().

Referenced by RexxMemory::createImage().

◆ changeStr()

RexxMutableBuffer * RexxMutableBuffer::changeStr ( RexxString needle,
RexxString newNeedle,
RexxInteger countArg 
)

Do an inplace changeStr operation on a mutablebuffer.

Parameters
needleThe search needle.
newNeedleThe replacement string.
countArgThe number of occurrences to replace.
Returns
The target MutableBuffer

Definition at line 955 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, RexxString::checkIsASCII(), copyData(), StringUtil::countStr(), ensureCapacity(), getLength(), RexxString::getLength(), getStringData(), RexxString::getStringData(), isASCII(), Numerics::MAX_WHOLENUMBER, openGap(), optionalPositive(), StringUtil::pos(), setIsASCII(), setIsASCIIChecked(), setLength(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ checkIsASCII()

bool RexxMutableBuffer::checkIsASCII ( )

◆ closeGap()

void RexxMutableBuffer::closeGap ( size_t  offset,
size_t  _size,
size_t  tailSize 
)
inline

Definition at line 132 of file MutableBufferClass.hpp.

References RexxBufferBase::closeGap(), and data.

Referenced by delWord(), and mydelete().

◆ copy()

RexxObject * RexxMutableBuffer::copy ( void  )
virtual

◆ copyData()

void RexxMutableBuffer::copyData ( size_t  offset,
const char *  string,
size_t  l 
)
inline

◆ countStrRexx()

RexxInteger * RexxMutableBuffer::countStrRexx ( RexxString needle)

◆ createInstance()

void RexxMutableBuffer::createInstance ( )
static

Create initial class object at bootstrap time.

Definition at line 63 of file MutableBufferClass.cpp.

References CLASS_CREATE.

Referenced by RexxMemory::createImage().

◆ delWord()

RexxMutableBuffer * RexxMutableBuffer::delWord ( RexxInteger position,
RexxInteger plength 
)

Perform a delword operation on a mutable buffer

Parameters
positionThe position to delete.
plengthThe number of words to delete
Returns
Always returns the target mutable buffer.

Definition at line 1784 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, closeGap(), dataLength, getLength(), getStringData(), isASCII(), Numerics::MAX_WHOLENUMBER, StringUtil::nextWord(), optionalLengthArgument(), positionArgument(), setIsASCIIChecked(), setLength(), and StringUtil::skipBlanks().

Referenced by RexxMemory::createImage().

◆ ensureCapacity()

◆ flatten()

void RexxMutableBuffer::flatten ( RexxEnvelope envelope)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 229 of file MutableBufferClass.cpp.

References cleanUpFlatten, flatten_reference, and setUpFlatten.

◆ getBufferLength()

size_t RexxMutableBuffer::getBufferLength ( )
inline

Definition at line 127 of file MutableBufferClass.hpp.

References bufferLength.

◆ getBufferSize()

RexxInteger* RexxMutableBuffer::getBufferSize ( )
inline

Definition at line 93 of file MutableBufferClass.hpp.

References bufferLength, and new_integer().

Referenced by RexxMemory::createImage().

◆ getCapacity()

size_t RexxMutableBuffer::getCapacity ( )
inline

Definition at line 137 of file MutableBufferClass.hpp.

References bufferLength.

Referenced by setDataLength().

◆ getCharB()

char RexxMutableBuffer::getCharB ( size_t  offset)
inline

Definition at line 135 of file MutableBufferClass.hpp.

References getData().

Referenced by caselessMatchChar(), and matchChar().

◆ getData()

char* RexxMutableBuffer::getData ( )
inline

Definition at line 129 of file MutableBufferClass.hpp.

References data, and RexxBuffer::getData().

Referenced by getCharB(), lower(), setCapacity(), translate(), and upper().

◆ getEncoding()

RexxObject* RexxMutableBuffer::getEncoding ( )
inline

Definition at line 161 of file MutableBufferClass.hpp.

References encoding.

Referenced by setEncodingRexx().

◆ getLength()

◆ getStringData()

◆ insert()

◆ isASCII()

◆ isASCIIChecked()

bool RexxMutableBuffer::isASCIIChecked ( )
inline

Definition at line 142 of file MutableBufferClass.hpp.

References Attributes, and STRING_ISASCII_CHECKED.

Referenced by checkIsASCII().

◆ isASCIIRexx()

RexxInteger * RexxMutableBuffer::isASCIIRexx ( )

Definition at line 368 of file MutableBufferClass.cpp.

References checkIsASCII(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ lastPos()

RexxInteger * RexxMutableBuffer::lastPos ( RexxString needle,
RexxInteger _start,
RexxInteger _range 
)

Perform a search for the last position of a string within the buffer.

Parameters
needleThe search needle.
pstartthe starting position.
Returns
The index of the located string. Returns 0 if no matches are found.

Definition at line 832 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::lastPosRexx().

Referenced by RexxMemory::createImage().

◆ lengthRexx()

RexxObject * RexxMutableBuffer::lengthRexx ( )

Return the length of the data in the buffer currently.

Returns
The current length, as an Integer object.

Definition at line 352 of file MutableBufferClass.cpp.

References getLength(), and new_integer().

Referenced by RexxMemory::createImage().

◆ live()

void RexxMutableBuffer::live ( size_t  liveMark)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 210 of file MutableBufferClass.cpp.

References data, and memory_mark.

◆ liveGeneral()

void RexxMutableBuffer::liveGeneral ( int  reason)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 219 of file MutableBufferClass.cpp.

References data, and memory_mark_general.

◆ lower()

RexxMutableBuffer * RexxMutableBuffer::lower ( RexxInteger _start,
RexxInteger _length 
)

Rexx exported method stub for the lower() method.

Parameters
startThe optional starting location. Defaults to the first character if not specified.
lengthThe length to convert. Defaults to the segment from the start position to the end of the string.
Returns
A new string object with the case conversion applied.

Definition at line 1260 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, getData(), getLength(), Numerics::minVal(), optionalLengthArgument(), and optionalPositionArgument().

Referenced by RexxMemory::createImage().

◆ makeArray()

RexxArray * RexxMutableBuffer::makeArray ( void  )
virtual

Baseclass optimization for handling request array calls.

Returns
The string object converted to an array using default arguments.

Reimplemented from RexxInternalObject.

Definition at line 769 of file MutableBufferClass.cpp.

References RexxObject::makeArrayRexx(), and OREF_NULL.

◆ makeArrayRexx()

RexxArray * RexxMutableBuffer::makeArrayRexx ( RexxString div)

Definition at line 910 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::makearray().

◆ makeString()

RexxString * RexxMutableBuffer::makeString ( )
virtual

Reimplemented from RexxInternalObject.

Definition at line 756 of file MutableBufferClass.cpp.

References data, RexxBuffer::getData(), and new_string().

Referenced by primitiveMakeString(), and RexxArray::toString().

◆ match()

RexxInteger * RexxMutableBuffer::match ( RexxInteger start_,
RexxString other,
RexxInteger offset_,
RexxInteger len_ 
)

Test if regions within two strings match.

Parameters
start_The starting compare position within the target string. This must be within the bounds of the string.
otherThe other compare string.
offset_The starting offset of the compare string. This must be within the string bounds. The default start postion is 1.
len_The length of the compare substring. The length and the offset must specify a valid substring of other. If not specified, this defaults to the substring from the offset to the end of the string.
Returns
True if the two regions match, false for any mismatch.

Definition at line 1435 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, Error_Incorrect_method_length, Error_Incorrect_method_position, getLength(), RexxString::getLength(), optionalLengthArgument(), optionalPositionArgument(), positionArgument(), primitiveMatch(), reportException(), stringArgument(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ matchChar()

RexxInteger * RexxMutableBuffer::matchChar ( RexxInteger position_,
RexxString matchSet 
)

Compare a single character at a give position against a set of characters to see if any of the characters is a match.

Parameters
position_The character position
matchSetThe set to compare against.
Returns
true if the character at the give position is any of the characters, false if none of them match.

Definition at line 1572 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, Error_Incorrect_method_position, RexxString::getChar(), getCharB(), getLength(), RexxString::getLength(), positionArgument(), reportException(), stringArgument(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ mydelete()

RexxMutableBuffer * RexxMutableBuffer::mydelete ( RexxObject _start,
RexxObject len 
)

◆ openGap()

void RexxMutableBuffer::openGap ( size_t  offset,
size_t  _size,
size_t  tailSize 
)
inline

Definition at line 131 of file MutableBufferClass.hpp.

References data, and RexxBufferBase::openGap().

Referenced by caselessChangeStr(), changeStr(), insert(), and space().

◆ operator new() [1/3]

void * RexxMutableBuffer::operator new ( size_t  size)

Create a new mutable buffer object from a potential subclass.

Parameters
sizeThe size of the buffer object.
Returns
A new instance of a mutable buffer, with the default class behaviour.

Definition at line 187 of file MutableBufferClass.cpp.

References new_object(), and T_MutableBuffer.

◆ operator new() [2/3]

void * RexxMutableBuffer::operator new ( size_t  size,
RexxClass bufferClass 
)

Create a new mutable buffer object from a potential subclass.

Parameters
sizeThe size of the buffer object.
bufferClassThe class of the buffer object.
Returns
A new instance of a mutable buffer, with the target class behaviour.

Definition at line 202 of file MutableBufferClass.cpp.

References new_object(), RexxInternalObject::setBehaviour(), and T_MutableBuffer.

◆ operator new() [3/3]

void* RexxMutableBuffer::operator new ( size_t  size,
void *  ptr 
)
inline

Definition at line 64 of file MutableBufferClass.hpp.

◆ overlay()

◆ posRexx()

RexxInteger * RexxMutableBuffer::posRexx ( RexxString needle,
RexxInteger pstart,
RexxInteger range 
)

Perform a search for a string within the buffer.

Parameters
needleThe search needle.
pstartthe starting position.
Returns
The index of the located string. Returns 0 if no matches are found.

Definition at line 815 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::posRexx().

Referenced by RexxMemory::createImage().

◆ primitiveCaselessMatch()

bool RexxMutableBuffer::primitiveCaselessMatch ( stringsize_t  _start,
RexxString other,
stringsize_t  offset,
stringsize_t  len 
)

Perform a caselesee compare of regions of two string objects. Returns true if the two regions match, returns false for mismatches.

Parameters
startThe starting offset within the target string.
otherThe source string for the compare.
offsetThe offset of the substring of the other string to use.
lenThe length of the substring to compare.
Returns
True if the regions match, false otherwise.

Definition at line 1545 of file MutableBufferClass.cpp.

References StringUtil::caselessCompare(), getLength(), getStringData(), and RexxString::getStringData().

Referenced by caselessMatch().

◆ primitiveMakeString()

RexxString * RexxMutableBuffer::primitiveMakeString ( )
virtual

Handle the primitive class makeString optimization. This is required because MutableBuffer implements a STRING method.

Returns
The string value of the buffer

Reimplemented from RexxInternalObject.

Definition at line 782 of file MutableBufferClass.cpp.

References makeString().

◆ primitiveMatch()

bool RexxMutableBuffer::primitiveMatch ( stringsize_t  _start,
RexxString other,
stringsize_t  offset,
stringsize_t  len 
)

Perform a compare of regions of two string objects. Returns true if the two regions match, returns false for mismatches.

Parameters
startThe starting offset within the target string.
otherThe source string for the compare.
offsetThe offset of the substring of the other string to use.
lenThe length of the substring to compare.
Returns
True if the regions match, false otherwise.

Definition at line 1518 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and RexxString::getStringData().

Referenced by match().

◆ replaceAt()

RexxMutableBuffer * RexxMutableBuffer::replaceAt ( RexxObject str,
RexxObject pos,
RexxObject len,
RexxObject pad 
)

Replace a target substring within a string with a new string value. This is similar overlay, but replacing might cause the characters following the replacement position to be shifted to the left or right.

Parameters
strThe replacement string.
posThe target position (required).
lenThe target length (optional). If not specified, the length of the replacement string is used, and this is essentially an overlay operation.
padA padding character if padding is required. The default pad is a ' '. Padding only occurs if the replacement position is beyond the current data length.
Returns
The target mutablebuffer object.

Definition at line 582 of file MutableBufferClass.cpp.

References adjustGap(), ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, copyData(), dataLength, ensureCapacity(), RexxString::getStringData(), isASCII(), optionalLengthArgument(), optionalPadArgument(), positionArgument(), setData(), setIsASCII(), setLength(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ setBufferLength()

RexxObject * RexxMutableBuffer::setBufferLength ( size_t  newsize)

◆ setBufferSize()

RexxObject * RexxMutableBuffer::setBufferSize ( RexxInteger size)

Definition at line 746 of file MutableBufferClass.cpp.

References ARG_ONE, lengthArgument(), and setBufferLength().

Referenced by RexxMemory::createImage().

◆ setCapacity()

char * RexxMutableBuffer::setCapacity ( size_t  newLength)

Set the capacity of the buffer.

Parameters
newLengthThe new buffer length
Returns
The pointer to the data area in the buffer.

Definition at line 333 of file MutableBufferClass.cpp.

References bufferLength, ensureCapacity(), and getData().

◆ setData()

void RexxMutableBuffer::setData ( size_t  offset,
codepoint_t  character,
size_t  l 
)
inline

Definition at line 134 of file MutableBufferClass.hpp.

References data, and RexxBufferBase::setData().

Referenced by insert(), overlay(), replaceAt(), setDataLength(), and space().

◆ setDataLength()

size_t RexxMutableBuffer::setDataLength ( size_t  newLength)

Set the length of the data in the buffer. The limit is the current capacity of the buffer. If the length is extended beyond the current length, the extra characters of the buffer will be filled with nulls.

Parameters
newLengthThe new datalength. This is capped to the capacity of the buffer.
Returns
The actual length the data has been set to. If the target length is greater than the capacity, the capacity value is returned.

Definition at line 299 of file MutableBufferClass.cpp.

References dataLength, getCapacity(), getLength(), isASCII(), setData(), and setIsASCIIChecked().

◆ setEncoding()

void RexxMutableBuffer::setEncoding ( RexxObject e)
inline

Definition at line 162 of file MutableBufferClass.hpp.

References encoding, OREF_NULL, OrefSet, and RexxInternalObject::setHasReferences().

Referenced by setEncodingRexx().

◆ setEncodingRexx()

RexxObject* RexxMutableBuffer::setEncodingRexx ( RexxObject e)
inline

Definition at line 167 of file MutableBufferClass.hpp.

References getEncoding(), and setEncoding().

Referenced by RexxMemory::createImage().

◆ setIsASCII()

void RexxMutableBuffer::setIsASCII ( bool  value = true)
inline

◆ setIsASCIIChecked()

void RexxMutableBuffer::setIsASCIIChecked ( bool  value = true)
inline

◆ setLength()

◆ space()

RexxMutableBuffer * RexxMutableBuffer::space ( RexxInteger space_count,
RexxString pad 
)

Do an inplace space() operation on a mutable buffer.

Parameters
space_countThe number of pad characters between each word
padThe pad character
Returns
The target MutableBuffer

Definition at line 1851 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, copyData(), dataLength, ensureCapacity(), getLength(), getStringData(), StringUtil::nextWord(), openGap(), optionalLengthArgument(), optionalPadArgument(), setData(), and setIsASCII().

Referenced by RexxMemory::createImage().

◆ subchar()

RexxString * RexxMutableBuffer::subchar ( RexxInteger positionArg)

Extract a single character from a string object. Returns a null string if the specified position is beyond the bounds of the string.

Parameters
positionArgThe position of the target character. Must be a positive whole number.
Returns
Returns the single character at the target position. Returns a null string if the position is beyond the end of the string.

Definition at line 903 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::subchar().

Referenced by RexxMemory::createImage().

◆ substr()

RexxString * RexxMutableBuffer::substr ( RexxInteger startPosition,
RexxInteger len,
RexxString pad 
)

Definition at line 797 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::substr().

Referenced by RexxMemory::createImage().

◆ subWord()

RexxString * RexxMutableBuffer::subWord ( RexxInteger position,
RexxInteger plength 
)

Perform a subword extraction from a mutable buffer.

Parameters
positionThe first word to be extracted.
plengthThe number of words to extract.
Returns
The substring containing the extacted words.

Definition at line 1662 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::subWord().

Referenced by RexxMemory::createImage().

◆ subWords()

RexxArray * RexxMutableBuffer::subWords ( RexxInteger position,
RexxInteger plength 
)

Returns an array of all words contained in the given range of the string, using the same extraction rules used for subWord() and word().

Parameters
positionThe optional starting position. If not provided, extraction starts with the first word.
plengthThe number of words to extract. If omitted, will extract from the starting postion to the end of the string.
Returns
An array containing the extracted words. If no words are available within the given range, this returns an empty array.

Definition at line 1682 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::subWords().

Referenced by RexxMemory::createImage().

◆ translate()

RexxMutableBuffer * RexxMutableBuffer::translate ( RexxString tableo,
RexxString tablei,
RexxString pad,
RexxInteger _start,
RexxInteger _range 
)

translate characters in the buffer using a translation table.

Parameters
tableoThe output table specification
tableiThe input table specification
padAn optional padding character (default is a space).
_startThe starting position to translate.
_rangeThe length to translate
Returns
The target mutable buffer.

Definition at line 1343 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, getData(), getLength(), RexxString::getLength(), RexxString::getStringData(), isASCII(), StringUtil::memPos(), Numerics::minVal(), optionalLengthArgument(), optionalPadArgument(), optionalPositionArgument(), optionalStringArgument(), OREF_NULL, setIsASCII(), setIsASCIIChecked(), and upper().

Referenced by RexxMemory::createImage().

◆ upper()

RexxMutableBuffer * RexxMutableBuffer::upper ( RexxInteger _start,
RexxInteger _length 
)

Rexx exported method stub for the upper() method.

Parameters
startThe optional starting location. Defaults to the first character if not specified.
lengthThe length to convert. Defaults to the segment from the start position to the end of the string.
Returns
A new string object with the case conversion applied.

Definition at line 1301 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, getData(), getLength(), Numerics::minVal(), optionalLengthArgument(), and optionalPositionArgument().

Referenced by RexxMemory::createImage(), and translate().

◆ verify()

RexxInteger * RexxMutableBuffer::verify ( RexxString ref,
RexxString option,
RexxInteger _start,
RexxInteger range 
)

Perform a character verify operation on a mutable buffer.

Parameters
refThe reference string.
optionThe match/nomatch option.
_startThe start position for the verify.
rangeThe range to search
Returns
The offset of the first match/mismatch within the buffer.

Definition at line 1647 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::verify().

Referenced by RexxMemory::createImage().

◆ word()

RexxString * RexxMutableBuffer::word ( RexxInteger position)

Extract a given word from a mutable buffer.

Parameters
positionThe target word position.
Returns
The extracted word, as a string.

Definition at line 1696 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::word().

Referenced by RexxMemory::createImage().

◆ wordIndex()

RexxInteger * RexxMutableBuffer::wordIndex ( RexxInteger position)

return the index of a given word position in a mutable buffer

Parameters
positionThe target word position.
Returns
The position of the target word.

Definition at line 1711 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::wordIndex().

Referenced by RexxMemory::createImage().

◆ wordLength()

RexxInteger * RexxMutableBuffer::wordLength ( RexxInteger position)

return the length of a given word position in a mutable buffer

Parameters
positionThe target word position.
Returns
The length of the target word.

Definition at line 1727 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::wordLength().

Referenced by RexxMemory::createImage().

◆ wordPos()

RexxInteger * RexxMutableBuffer::wordPos ( RexxString phrase,
RexxInteger pstart 
)

Perform a wordpos search on a mutablebuffer object.

Parameters
phraseThe search phrase
pstartThe starting search position.
Returns
The index of the match location.

Definition at line 1754 of file MutableBufferClass.cpp.

References getLength(), getStringData(), and StringUtil::wordPos().

Referenced by RexxMemory::createImage().

◆ words()

RexxInteger * RexxMutableBuffer::words ( )

Return the count of words in the buffer.

Returns
The buffer word count.

Definition at line 1738 of file MutableBufferClass.cpp.

References getLength(), getStringData(), new_integer(), and StringUtil::wordCount().

Referenced by RexxMemory::createImage().

Friends And Related Function Documentation

◆ RexxMutableBufferClass

friend class RexxMutableBufferClass
friend

Definition at line 62 of file MutableBufferClass.hpp.

Member Data Documentation

◆ Attributes

size_t RexxMutableBuffer::Attributes
protected

Definition at line 181 of file MutableBufferClass.hpp.

Referenced by isASCII(), isASCIIChecked(), setIsASCII(), and setIsASCIIChecked().

◆ bufferLength

size_t RexxMutableBuffer::bufferLength
protected

◆ classInstance

RexxClass * RexxMutableBuffer::classInstance = OREF_NULL
static

Definition at line 175 of file MutableBufferClass.hpp.

◆ data

◆ dataLength

◆ defaultSize

size_t RexxMutableBuffer::defaultSize
protected

Definition at line 179 of file MutableBufferClass.hpp.

Referenced by copy(), RexxMutableBuffer(), and setBufferLength().

◆ encoding

RexxObject* RexxMutableBuffer::encoding
protected

Definition at line 182 of file MutableBufferClass.hpp.

Referenced by getEncoding(), and setEncoding().


The documentation for this class was generated from the following files: