ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

RexxMutableBuffer Class Reference

#include <MutableBufferClass.hpp>

Inheritance diagram for RexxMutableBuffer:
[legend]
Collaboration 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 *)
 
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 ()
 
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, char character, size_t l)
 
size_t setDataLength (size_t l)
 
char getChar (size_t offset)
 
size_t getCapacity ()
 
char * setCapacity (size_t newLength)
 
- Public Member Functions inherited from RexxObject
void * operator new (size_t, RexxClass *)
 
void * operator new (size_t, RexxClass *, RexxObject **, 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)
 
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)
 
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 ()
 
RexxStringrequiredString (size_t)
 
RexxStringrequiredString (const char *)
 
RexxStringrequiredString ()
 
RexxIntegerrequiredInteger (size_t, size_t)
 
wholenumber_t requiredNumber (size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
stringsize_t requiredPositive (size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
stringsize_t requiredNonNegative (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)
 
RexxMessagestartWith (RexxObject *, RexxArray *)
 
RexxObjectsend (RexxObject **, size_t)
 
RexxObjectsendWith (RexxObject *, RexxArray *)
 
RexxMessagestartCommon (RexxObject *message, RexxObject **arguments, size_t argCount)
 
RexxStringoref ()
 
RexxObjectpmdict ()
 
RexxObjectrun (RexxObject **, size_t)
 
void messageSend (RexxString *, RexxObject **, size_t, ProtectedObject &)
 
void messageSend (RexxString *, RexxObject **, size_t, RexxObject *, ProtectedObject &)
 
RexxMethodcheckPrivate (RexxMethod *)
 
void processUnknown (RexxString *, RexxObject **, size_t, ProtectedObject &)
 
void processProtectedMethod (RexxString *, RexxMethod *, RexxObject **, size_t, ProtectedObject &)
 
void sendMessage (RexxString *, RexxArray *, ProtectedObject &)
 
void sendMessage (RexxString *message, ProtectedObject &result)
 
void sendMessage (RexxString *message, RexxObject **args, size_t argCount, 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 *)
 
RexxObjectsendMessage (RexxString *message)
 
RexxObjectsendMessage (RexxString *message, RexxObject **args, size_t argCount)
 
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 *)
 
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)
 
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

size_t bufferLength
 
size_t defaultSize
 
size_t dataLength
 
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 ( )

Default constructor.

Definition at line 125 of file MutableBufferClass.cpp.

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

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

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

◆ 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 129 of file MutableBufferClass.hpp.

References RexxBufferBase::adjustGap(), data, and dataLength.

Referenced by replaceAt().

◆ append()

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

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

References ARG_ONE, ARG_TWO, Error_Incorrect_method_position, getChar(), RexxString::getChar(), 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 686 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 1539 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 781 of file MutableBufferClass.cpp.

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

Referenced by RexxMemory::createImage().

◆ closeGap()

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

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

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

Referenced by RexxMemory::createImage().

◆ ensureCapacity()

void RexxMutableBuffer::ensureCapacity ( size_t  addedLength)

◆ flatten()

void RexxMutableBuffer::flatten ( RexxEnvelope envelope)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 205 of file MutableBufferClass.cpp.

References cleanUpFlatten, flatten_reference, and setUpFlatten.

◆ getBufferSize()

RexxInteger* RexxMutableBuffer::getBufferSize ( )
inline

Definition at line 92 of file MutableBufferClass.hpp.

References bufferLength, and new_integer().

Referenced by RexxMemory::createImage().

◆ getCapacity()

size_t RexxMutableBuffer::getCapacity ( )
inline

Definition at line 133 of file MutableBufferClass.hpp.

References bufferLength.

Referenced by setDataLength().

◆ getChar()

char RexxMutableBuffer::getChar ( size_t  offset)
inline

Definition at line 132 of file MutableBufferClass.hpp.

References getData().

Referenced by caselessMatchChar(), and matchChar().

◆ getData()

char* RexxMutableBuffer::getData ( )
inline

Definition at line 125 of file MutableBufferClass.hpp.

References data, and RexxBuffer::getData().

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

◆ getLength()

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

References dataLength, and new_integer().

Referenced by RexxMemory::createImage().

◆ live()

void RexxMutableBuffer::live ( size_t  liveMark)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 186 of file MutableBufferClass.cpp.

References data, and memory_mark.

◆ liveGeneral()

void RexxMutableBuffer::liveGeneral ( int  reason)
virtual

Reimplemented from RexxVirtualBase.

Definition at line 195 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 1058 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 611 of file MutableBufferClass.cpp.

References RexxObject::makeArrayRexx(), and OREF_NULL.

◆ makeArrayRexx()

RexxArray * RexxMutableBuffer::makeArrayRexx ( RexxString div)

Definition at line 741 of file MutableBufferClass.cpp.

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

◆ makeString()

RexxString * RexxMutableBuffer::makeString ( )
virtual

Reimplemented from RexxInternalObject.

Definition at line 598 of file MutableBufferClass.cpp.

References data, dataLength, 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 1216 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 1351 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, Error_Incorrect_method_position, getChar(), RexxString::getChar(), 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 127 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 163 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 178 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 655 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 1325 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 624 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 1298 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 465 of file MutableBufferClass.cpp.

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

Referenced by RexxMemory::createImage().

◆ setBufferSize()

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

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

◆ setData()

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

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

References dataLength, getCapacity(), getLength(), 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 1615 of file MutableBufferClass.cpp.

References ARG_ONE, ARG_TWO, copyData(), dataLength, ensureCapacity(), getLength(), 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 735 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 638 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 1438 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 1458 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 1139 of file MutableBufferClass.cpp.

References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, getData(), getLength(), RexxString::getLength(), 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 1098 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 1424 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 1471 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 1485 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 1500 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 1525 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 1510 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

◆ bufferLength

size_t RexxMutableBuffer::bufferLength
protected

◆ classInstance

RexxClass * RexxMutableBuffer::classInstance = OREF_NULL
static

Definition at line 138 of file MutableBufferClass.hpp.

◆ data

◆ dataLength

◆ defaultSize

size_t RexxMutableBuffer::defaultSize
protected

Definition at line 142 of file MutableBufferClass.hpp.

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


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