edbee - Qt Editor Library
Public Member Functions | List of all members
edbee::QCharGapVector Class Reference

The character vecor to use. More...

#include <gapvector.h>

+ Inheritance diagram for edbee::QCharGapVector:
+ Collaboration diagram for edbee::QCharGapVector:

Public Member Functions

 QCharGapVector (int size=16)
 
 QCharGapVector (const QString &data, int gapSize)
 initializes the vector with a given string More...
 
void init (const QString &data, int gapSize)
 Initializes the gapvector. More...
 
void replaceString (int offset, int length, const QString &data)
 a convenient string replace function More...
 
QString mid (int offset, int length) const
 a convenient method to retrieve a QString part More...
 
- Public Member Functions inherited from edbee::GapVector< QChar >
 GapVector (int capacity=16)
 
 ~GapVector ()
 
int length () const
 returns the used length of the data More...
 
int gapSize () const
 
int gapBegin () const
 
int gapEnd () const
 
int capacity () const
 
void clear ()
 clears the data More...
 
void replace (int offset, int length, const QChar *data, int newLength)
 this method replaces the given items More...
 
void fill (int offset, int length, const QChar &data, int newLength)
 this method replaces the given items with a single data item More...
 
void append (QChar t)
 convenient append method More...
 
void append (const QChar *t, int length)
 another append method More...
 
QChar at (int offset) const
 This method returns the item at the given index. More...
 
void set (int offset, const QChar &value)
 This method sets an item at the given index. More...
 
QChar & operator[] (int offset)
 This method return an index. More...
 
QChar & rawAt (int index)
 This method returns the 'raw' element at the given location This method does NOT take in account the gap. More...
 
void copyRange (QChar *data, int offset, int length) const
 This method copies the given range to the data pointer. More...
 
QChar * data ()
 This method returns a direct pointer to the 0-terminated buffer This pointer is only valid as long as the buffer doesn't change WARNING, this method MOVES the gap! Which means this method should NOT be used for a lot of operations. More...
 
void moveGapTo (int offset)
 
void ensureGapSize (int requiredSize)
 this method makes sure there's enough room for the insertation More...
 
void resize (int newSize)
 resizes the array of data More...
 
void setGrowSize (int size)
 sets the growsize. The growsize if the amount to reserve extra More...
 
int growSize ()
 returns the growsize More...
 
QString getUnitTestString (QChar gapChar='_') const
 Converts the 'gap-buffer' to a unit-test debugging string. More...
 
QString getUnitTestString2 () const
 Converts the 'gap-buffer' to a unit-test debugging string. More...
 

Additional Inherited Members

- Protected Member Functions inherited from edbee::GapVector< QChar >
void replace (int offset, int length, const QChar *data)
 this method replaces the given text with the given data. because the length of the source and target is the same in this method no gap-moving is required More...
 
void fill (int offset, int length, const QChar &data)
 this method replaces the given text with the given data. because the length of the source and target is the same in this method no gap-moving is required More...
 
- Protected Attributes inherited from edbee::GapVector< QChar >
QChar * items_
 The item data. More...
 
int capacity_
 The number of reserved bytes. More...
 
int gapBegin_
 The start of the gap. More...
 
int gapEnd_
 The end of the gap. More...
 
int growSize_
 The size to grow extra. More...
 

Detailed Description

The character vecor to use.

Constructor & Destructor Documentation

◆ QCharGapVector() [1/2]

edbee::QCharGapVector::QCharGapVector ( int  size = 16)
inline

◆ QCharGapVector() [2/2]

edbee::QCharGapVector::QCharGapVector ( const QString &  data,
int  gapSize 
)
inline

initializes the vector with a given string

Member Function Documentation

◆ init()

void edbee::QCharGapVector::init ( const QString &  data,
int  gapSize 
)
inline

Initializes the gapvector.

◆ mid()

QString edbee::QCharGapVector::mid ( int  offset,
int  length 
) const
inline

a convenient method to retrieve a QString part

◆ replaceString()

void edbee::QCharGapVector::replaceString ( int  offset,
int  length,
const QString &  data 
)
inline

a convenient string replace function


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