edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
 
void init (const QString &data, int gapSize)
 Initializes the gapvector.
 
void replaceString (int offset, int length, const QString &data)
 a convenient string replace function
 
QString mid (int offset, int length) const
 a convenient method to retrieve a QString part
 
- Public Member Functions inherited from edbee::GapVector< QChar >
 GapVector (int capacity=16)
 
 ~GapVector ()
 
int length () const
 returns the used length of the data
 
int gapSize () const
 
int gapBegin () const
 
int gapEnd () const
 
int capacity () const
 
void clear ()
 clears the data
 
void replace (int offset, int length, const QChar *data, int newLength)
 this method replaces the given items
 
void fill (int offset, int length, const QChar &data, int newLength)
 this method replaces the given items with a single data item
 
void append (QChar t)
 convenient append method
 
void append (const QChar *t, int length)
 another append method
 
QChar at (int offset) const
 This method returns the item at the given index.
 
void set (int offset, const QChar &value)
 This method sets an item at the given index.
 
QChar & operator[] (int offset)
 This method return an index.
 
QChar & rawAt (int index)
 This method returns the 'raw' element at the given location This method does NOT take in account the gap.
 
void copyRange (QChar *data, int offset, int length) const
 This method copies the given range to the data pointer.
 
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.
 
void moveGapTo (int offset)
 
void ensureGapSize (int requiredSize)
 this method makes sure there's enough room for the insertation
 
void resize (int newSize)
 resizes the array of data
 
void setGrowSize (int size)
 sets the growsize. The growsize if the amount to reserve extra
 
int growSize ()
 returns the growsize
 
QString getUnitTestString (QChar gapChar='_') const
 Converts the 'gap-buffer' to a unit-test debugging string.
 
QString getUnitTestString2 () const
 Converts the 'gap-buffer' to a unit-test debugging string.
 

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
 
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
 
- Protected Attributes inherited from edbee::GapVector< QChar >
QChar * items_
 The item data.
 
int capacity_
 The number of reserved bytes.
 
int gapBegin_
 The start of the gap.
 
int gapEnd_
 The end of the gap.
 
int growSize_
 The size to grow extra.
 

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: