Class DTStrings (unit SDL) |
Inherits from
DVector
constructor Create(strings : TStrings);
function at(pos : Integer) : DObject; override;
Return the item at the given position.
function backRef : PDObject; override;
Return a reference to the last item in the sequence.
function capacity : Integer; override;
Returns the number of elements that can fit into this vector without
any expansion.
function clone : DContainer; override;
Return a complete copy of this container.
destructor Destroy; override;
procedure ensureCapacity(amount : Integer); override;
Inform the container that "amount" items are going to be inserted.
function finish : DIterator; override;
Return an iterator positioned after the last element in the container.
function frontRef : PDObject; override;
Return a reference to the first object in the sequence.
procedure insertRangeAt(index : Integer; _start, _finish : DIterator); override;
Inserts copies of the objects in a given range before the object at position
index.
procedure insertRangeAtIter(iterator : DIterator; _start, _finish : DIterator); override;
Inserts copies of the objects in a given range before the object the
iterator is over.
function maxSize : Integer; override;
Return the absolute maximum number of objects that can be stored in
this container.
function popBack : DObject; override;
Remove the last element in the sequence, returning its value.
function popFront : DObject; override;
Remove the first element in the sequence, returning its value.
procedure removeAt(index : Integer); override;
Remove the object at the given index.
function removeAtIter(iter : DIterator; count : Integer) : DIterator; override;
Remove count items an iterator is positioned at.
procedure removeBetween(_begin, _end : Integer); override;
Remove all objects between two indicies.
procedure setCapacity(amount : Integer); override;
Ensure that this vector can accomodate at least amount objects without
expanding.
procedure setSize(newSize : Integer); virtual;
function size : Integer; override;
Determines the number of objects currently in this container.
function start : DIterator; override;
Return an iterator positioned on the first object in the container.
procedure trimToSize; override;
Request that the container use the minimum amount of memory possible
for its current contents.
procedure _add(const obj : DObject); override;
Add a DObject to this container.
procedure _insertAt(index : Integer; const obj : DObject); override;
Inserts an object before the object at position index.
procedure _insertAtIter(iterator : DIterator; const obj : DObject); override;
Inserts an object before the object the iterator is positioned over.
procedure _insertMultipleAt(index : Integer; count : Integer; const obj : DObject); override;
Inserts count copies of obj before the object at position index.
procedure _insertMultipleAtIter(iterator : DIterator; count : Integer; const obj : DObject); override;
Inserts count copies of obj before the object iterator is positioned at.
procedure _pushBack(const obj : DObject); override;
Push an object to the back of the sequence.
procedure _pushFront(const obj : DObject); override;
Push an object to the front of the container.
procedure _putAt(index : Integer; const obj : DObject); override;
Set the item at a given position.
procedure _remove(const obj : DObject); override;
Removes an object, by value, from this sequence.
procedure _removeWithin(_begin, _end : Integer; const obj : DObject); override;
Remove every occurrence of object between two indicies.
constructor Create(strings : TStrings);
function at(pos : Integer) : DObject; override;
Return the item at the given position. Note that returning this item
may or may not be an efficient implementation. DVector-based structures
will be more efficient. The returned object can be converted with a toXXX
function.
function backRef : PDObject; override;
Return a reference to the last item in the sequence.
function capacity : Integer; override;
Returns the number of elements that can fit into this vector without
any expansion.
function clone : DContainer; override;
Return a complete copy of this container. This is a copy by value, as
all objects are stored in DContainers by value.
destructor Destroy; override;
procedure ensureCapacity(amount : Integer); override;
Inform the container that "amount" items are going to be inserted.
Most containers don't have any concept of setting the capacity, but
for those that do, algorithms can call this to provide a hint to the
container about how many items are going to be inserted.
function finish : DIterator; override;
Return an iterator positioned after the last element in the container.
Note that the finish position is a valid insertion point for those containers
that can have the add operation performed.
function frontRef : PDObject; override;
Return a reference to the first object in the sequence.
procedure insertRangeAt(index : Integer; _start, _finish : DIterator); override;
Inserts copies of the objects in a given range before the object at position
index.
procedure insertRangeAtIter(iterator : DIterator; _start, _finish : DIterator); override;
Inserts copies of the objects in a given range before the object the
iterator is over.
function maxSize : Integer; override;
Return the absolute maximum number of objects that can be stored in
this container. The container does not necessarily have this space allocated;
it is just the maximum that could be allocated.
function popBack : DObject; override;
Remove the last element in the sequence, returning its value. That value
must be cleaned up or converted with a toXXX function.
function popFront : DObject; override;
Remove the first element in the sequence, returning its value. That value
must be cleaned up or converted with a toXXX function.
procedure removeAt(index : Integer); override;
Remove the object at the given index.
function removeAtIter(iter : DIterator; count : Integer) : DIterator; override;
Remove count items an iterator is positioned at. All following items
move up by count.
procedure removeBetween(_begin, _end : Integer); override;
Remove all objects between two indicies.
procedure setCapacity(amount : Integer); override;
Ensure that this vector can accomodate at least amount objects without
expanding.
procedure setSize(newSize : Integer); virtual;
function size : Integer; override;
Determines the number of objects currently in this container.
function start : DIterator; override;
Return an iterator positioned on the first object in the container.
procedure trimToSize; override;
Request that the container use the minimum amount of memory possible
for its current contents. Note that this is only a hint to the container;
it may or may not have any effect.
procedure _add(const obj : DObject); override;
Parameter | Description |
---|
obj | The object to add.
|
Add a DObject to this container. The object is copied and added to
the container.
procedure _insertAt(index : Integer; const obj : DObject); override;
Inserts an object before the object at position index.
If the iterator is atEnd, the object will be added at the end.
procedure _insertAtIter(iterator : DIterator; const obj : DObject); override;
Inserts an object before the object the iterator is positioned over.
If the iterator is atEnd, the object will be added at the end.
procedure _insertMultipleAt(index : Integer; count : Integer; const obj : DObject); override;
Inserts count copies of obj before the object at position index.
procedure _insertMultipleAtIter(iterator : DIterator; count : Integer; const obj : DObject); override;
Inserts count copies of obj before the object iterator is positioned at.
procedure _pushBack(const obj : DObject); override;
Push an object to the back of the sequence. The object will be copied.
procedure _pushFront(const obj : DObject); override;
Push an object to the front of the container.
procedure _putAt(index : Integer; const obj : DObject); override;
Set the item at a given position.
procedure _remove(const obj : DObject); override;
Removes an object, by value, from this sequence.
procedure _removeWithin(_begin, _end : Integer; const obj : DObject); override;
Remove every occurrence of object between two indicies.