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 (sizeB_t, sizeB_t)
 
 RexxMutableBuffer (RESTORETYPE restoreType)
 
void live (size_t)
 
void liveGeneral (int reason)
 
void flatten (RexxEnvelope *envelope)
 
RexxObjectcopy ()
 
void ensureCapacity (sizeB_t addedLength)
 
RexxObjectlengthRexx ()
 
RexxMutableBufferappend (RexxObject *)
 
RexxMutableBufferappendCstring (const char *, sizeB_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 (stringsizeB_t start, RexxString *other, stringsizeB_t offset, stringsizeB_t len)
 
bool primitiveCaselessMatch (stringsizeB_t start, RexxString *other, stringsizeB_t offset, stringsizeB_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 ()
 
sizeB_t getBLength ()
 
void setBLength (sizeB_t l)
 
sizeB_t getBufferLength ()
 
RexxObjectsetBufferLength (sizeB_t)
 
char * getData ()
 
void copyData (sizeB_t offset, const char *string, sizeB_t l)
 
void openGap (sizeB_t offset, sizeB_t _size, sizeB_t tailSize)
 
void closeGap (sizeB_t offset, sizeB_t _size, sizeB_t tailSize)
 
void adjustGap (sizeB_t offset, sizeB_t _size, sizeB_t _newSize)
 
void setData (sizeB_t offset, char character, sizeB_t l)
 
char getCharB (sizeB_t offset)
 
sizeB_t setDataLength (sizeB_t l)
 
sizeB_t getCapacity ()
 
char * setCapacity (sizeB_t newLength)
 
- 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 ()
 
RexxStringprimitiveMakeString ()
 
void copyIntoTail (RexxCompoundTail *buffer)
 
RexxArraymakeArray ()
 
RexxStringstringValue ()
 
RexxStringrequestString ()
 
RexxStringrequestStringNoNOSTRING ()
 
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 *)
 
RexxMethodinstanceMethod (RexxString *)
 
RexxSupplierinstanceMethods (RexxClass *)
 
RexxMethodinstanceMethodRexx (RexxString *)
 
RexxSupplierinstanceMethodsRexx (RexxClass *)
 
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 messageSend (RexxString *, RexxObject **, size_t, size_t, RexxObject *, ProtectedObject &, bool processUnknown=true)
 
RexxMethodcheckPrivate (RexxMethod *)
 
void processUnknown (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 ()
 
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 ()
 
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

sizeB_t bufferLength
 
sizeB_t defaultSize
 
sizeB_t dataBLength
 
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 ( sizeB_t  l,
sizeB_t  d 
)

Constructor with explicitly set size and default.

Parameters
lInitial length.
dThe explicit default size.

Definition at line 147 of file MutableBufferClass.cpp.

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

◆ RexxMutableBuffer() [3/3]

RexxMutableBuffer::RexxMutableBuffer ( RESTORETYPE  restoreType)
inline

Definition at line 69 of file MutableBufferClass.hpp.

Member Function Documentation

◆ adjustGap()

void RexxMutableBuffer::adjustGap ( sizeB_t  offset,
sizeB_t  _size,
sizeB_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,
sizeB_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 977 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, StringUtil::caselessCountStr(), StringUtil::caselessPos(), copyData(), ensureCapacity(), getBLength(), RexxString::getBLength(), getStringData(), RexxString::getStringData(), Numerics::MAX_WHOLENUMBER, openGap(), optionalPositive(), setBLength(), 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 755 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, StringUtil::caselessLastPos(), getBLength(), 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 1326 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, Error_Incorrect_method_length, Error_Incorrect_method_position, getBLength(), RexxString::getBLength(), optionalLengthArgument(), optionalPositionArgument(), positionArgument(), primitiveCaselessMatch(), reportException(), size_v, 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 1456 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, Error_Incorrect_method_position, getBLength(), RexxString::getBLength(), getCharB(), RexxString::getCharB(), positionArgument(), reportException(), size_v, 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 729 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, StringUtil::caselessPos(), getBLength(), 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 1616 of file MutableBufferClass.cpp.

References StringUtil::caselessWordPos(), getBLength(), 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 836 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_THREE, ARG_TWO, copyData(), StringUtil::countStr(), ensureCapacity(), getBLength(), RexxString::getBLength(), getStringData(), RexxString::getStringData(), Numerics::MAX_WHOLENUMBER, openGap(), optionalPositive(), StringUtil::pos(), setBLength(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ closeGap()

void RexxMutableBuffer::closeGap ( sizeB_t  offset,
sizeB_t  _size,
sizeB_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 ( sizeB_t  offset,
const char *  string,
sizeB_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 1631 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, closeGap(), dataBLength, getBLength(), getStringData(), Numerics::MAX_WHOLENUMBER, StringUtil::nextWord(), optionalLengthArgument(), positionArgument(), setBLength(), sizeB_v, and StringUtil::skipBlanks().

Referenced by RexxMemory::createImage().

◆ ensureCapacity()

◆ flatten()

void RexxMutableBuffer::flatten ( RexxEnvelope envelope)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 209 of file MutableBufferClass.cpp.

References cleanUpFlatten, flatten_reference, and setUpFlatten.

◆ getBLength()

◆ getBufferLength()

sizeB_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()

sizeB_t RexxMutableBuffer::getCapacity ( )
inline

Definition at line 137 of file MutableBufferClass.hpp.

References bufferLength.

Referenced by setDataLength().

◆ getCharB()

char RexxMutableBuffer::getCharB ( sizeB_t  offset)
inline

Definition at line 135 of file MutableBufferClass.hpp.

References getData(), and size_v.

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().

◆ getStringData()

◆ insert()

◆ 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 713 of file MutableBufferClass.cpp.

References getBLength(), 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 326 of file MutableBufferClass.cpp.

References getBLength(), and new_integer().

Referenced by RexxMemory::createImage().

◆ live()

void RexxMutableBuffer::live ( size_t  liveMark)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 190 of file MutableBufferClass.cpp.

References data, and memory_mark.

◆ liveGeneral()

void RexxMutableBuffer::liveGeneral ( int  reason)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 199 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 1119 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, getBLength(), getData(), 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 650 of file MutableBufferClass.cpp.

References RexxObject::makeArrayRexx(), and OREF_NULL.

◆ makeArrayRexx()

RexxArray * RexxMutableBuffer::makeArrayRexx ( RexxString div)

Definition at line 791 of file MutableBufferClass.cpp.

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

◆ makeString()

RexxString * RexxMutableBuffer::makeString ( )
virtual

Reimplemented from RexxInternalObject.

Definition at line 637 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 1282 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, Error_Incorrect_method_length, Error_Incorrect_method_position, getBLength(), RexxString::getBLength(), optionalLengthArgument(), optionalPositionArgument(), positionArgument(), primitiveMatch(), reportException(), size_v, 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 1419 of file MutableBufferClass.cpp.

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

Referenced by RexxMemory::createImage().

◆ mydelete()

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

◆ openGap()

void RexxMutableBuffer::openGap ( sizeB_t  offset,
sizeB_t  _size,
sizeB_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 167 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 182 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 696 of file MutableBufferClass.cpp.

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

Referenced by RexxMemory::createImage().

◆ primitiveCaselessMatch()

bool RexxMutableBuffer::primitiveCaselessMatch ( stringsizeB_t  _start,
RexxString other,
stringsizeB_t  offset,
stringsizeB_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 1392 of file MutableBufferClass.cpp.

References StringUtil::caselessCompare(), getBLength(), 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 663 of file MutableBufferClass.cpp.

References makeString().

◆ primitiveMatch()

bool RexxMutableBuffer::primitiveMatch ( stringsizeB_t  _start,
RexxString other,
stringsizeB_t  offset,
stringsizeB_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 1365 of file MutableBufferClass.cpp.

References getBLength(), 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 492 of file MutableBufferClass.cpp.

References adjustGap(), ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, copyData(), dataBLength, ensureCapacity(), RexxString::getStringData(), optionalLengthArgument(), optionalPadArgument(), positionArgument(), setBLength(), setData(), and stringArgument().

Referenced by RexxMemory::createImage().

◆ setBLength()

◆ setBufferLength()

RexxObject * RexxMutableBuffer::setBufferLength ( sizeB_t  newsize)

◆ setBufferSize()

RexxObject * RexxMutableBuffer::setBufferSize ( RexxInteger size)

Definition at line 627 of file MutableBufferClass.cpp.

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

Referenced by RexxMemory::createImage().

◆ setCapacity()

char * RexxMutableBuffer::setCapacity ( sizeB_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 307 of file MutableBufferClass.cpp.

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

◆ setData()

void RexxMutableBuffer::setData ( sizeB_t  offset,
char  character,
sizeB_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()

sizeB_t RexxMutableBuffer::setDataLength ( sizeB_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 279 of file MutableBufferClass.cpp.

References dataBLength, getBLength(), getCapacity(), and setData().

◆ 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 1693 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, copyData(), dataBLength, ensureCapacity(), getBLength(), getStringData(), StringUtil::nextWord(), openGap(), optionalLengthArgument(), optionalPadArgument(), and setData().

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 784 of file MutableBufferClass.cpp.

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

Referenced by RexxMemory::createImage().

◆ substr()

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

Definition at line 678 of file MutableBufferClass.cpp.

References getBLength(), 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 1509 of file MutableBufferClass.cpp.

References getBLength(), 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 1529 of file MutableBufferClass.cpp.

References getBLength(), 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 1202 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, getBLength(), RexxString::getBLength(), getData(), RexxString::getStringData(), StringUtil::memPos(), Numerics::minVal(), optionalLengthArgument(), optionalPadArgument(), optionalPositionArgument(), optionalStringArgument(), OREF_NULL, 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 1160 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, getBLength(), getData(), 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 1494 of file MutableBufferClass.cpp.

References getBLength(), 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 1543 of file MutableBufferClass.cpp.

References getBLength(), 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 1558 of file MutableBufferClass.cpp.

References getBLength(), 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 1574 of file MutableBufferClass.cpp.

References getBLength(), 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 1601 of file MutableBufferClass.cpp.

References getBLength(), 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 1585 of file MutableBufferClass.cpp.

References getBLength(), 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

◆ bufferLength

sizeB_t RexxMutableBuffer::bufferLength
protected

◆ classInstance

RexxClass * RexxMutableBuffer::classInstance = OREF_NULL
static

Definition at line 143 of file MutableBufferClass.hpp.

◆ data

◆ dataBLength

◆ defaultSize

sizeB_t RexxMutableBuffer::defaultSize
protected

Definition at line 147 of file MutableBufferClass.hpp.

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


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