Class: etk::Buffer
Synopsis:
+ Buffer (int32_t _count);
+ Buffer (const etk::Buffer & _obj);
+ ~Buffer (void);
+ bool dumpIn (etk::FSNode & _file);
+ bool dumpFrom (etk::FSNode & _file);
+ etk::Buffer & operator= (const etk::Buffer & _obj);
+ int8_t operator[] (int32_t _pos);
+ int8_t & get (int32_t _pos);
+ int32_t get (int32_t _pos,
UChar & _value,
charset_te _charset);
+ std::vector<int8_t> get (int32_t _pos,
int32_t _nbElement);
+ void push_back (const int8_t & _item);
+ void insert (int32_t _pos,
const int8_t & _item);
+ void insert (int32_t _pos,
std::vector<int8_t> & _items);
+ void insert (int32_t _pos,
int8_t * _items,
int32_t _nbElement);
+ void replace (int32_t _pos,
const int8_t & _item);
+ void replace (int32_t _pos,
int32_t _nbRemoveElement,
std::vector<int8_t> & _items);
+ void replace (int32_t _pos,
int32_t _nbRemoveElement,
int8_t * _items,
int32_t _nbElement);
+ void remove (int32_t _pos,
int32_t _nbRemoveElement);
+ void pop_back (void);
+ void clear (void);
+ int8_t & getDirect (int32_t _realElementPosition);
+ int32_t size (void);
- void changeAllocation (int32_t _newSize);
- bool gapMove (int32_t _pos);
- bool gapResize (int32_t _pos,
int32_t _newGapLen);
- int32_t gapSize (void);
- void gapCheckMaxSize (void);
Description:
/** * @brief Buffer classes. Designed for access o */Detail:
etk::Buffer ()
Buffer(int32_t _count);
Create an empty vector
Parameter [input]: _count Minimum request size of the Buffer
etk::Buffer ()
Buffer(const etk::Buffer & _obj);
Re-copy constructor (copy all needed data)
Parameter [input]: _obj Buffer that might be copy
etk::~Buffer ()
~Buffer(void);
Destructor of the current Class
dumpIn ()
bool dumpIn(etk::FSNode & _file);
Save in the current file open
Parameter [input] [output]: _file Pointer on the file where data might be writed
Return: true if OK / false if an error occured
dumpFrom ()
bool dumpFrom(etk::FSNode & _file);
Load in the current file open
Parameter [input] [output]: _myFile Pointer on the file where data might be read
Return: true if OK / false if an error occured
operator= ()
etk::Buffer & operator=(const etk::Buffer & _obj);
Re-copy operator
Parameter [input]: _obj Buffer that might be copy
Return: reference on the curent re-copy vector
operator[] ()
int8_t operator[](int32_t _pos);
Operator [] : Get the data at the requested position (gap abstraction done).
Parameter [input]: _pos Position in the buffer.
Return: Element at the request pos.
get ()
int8_t & get(int32_t _pos);
Get a current element in the vector
Parameter [input]: _pos Desired position read
Return: Reference on the Element
get ()
int32_t get(int32_t _pos,
UChar & _value,
charset_te _charset);
Get a current element in the vector
Parameter [input]: _pos Desired position read
Return: Reference on the Element
get ()
std::vector<int8_t> get(int32_t _pos,
int32_t _nbElement);
Get elements from a specific position.
Parameter [input]: _pos Position of the first element.
Parameter [input]: _nbElement Number of element needed.
Return: The data requested
push_back ()
void push_back(const int8_t & _item);
Add at the Last position of the Vector
Parameter [input]: _item Element to add at the end of vector
insert ()
void insert(int32_t _pos,
const int8_t & _item);
Insert One item at the specify position.
Parameter [input]: _pos Position where data might be inserted
Parameter [input]: _items Data that might be inserted.
insert ()
void insert(int32_t _pos,
std::vector<int8_t> & _items);
Insert data in the buffer
Parameter [input]: _pos Position where data might be inserted
Parameter [input]: _items Data that might be inserted.
insert ()
void insert(int32_t _pos,
int8_t * _items,
int32_t _nbElement);
Insert data in the buffer
Parameter [input]: _pos Position where data might be inserted
Parameter [input]: _items Data that might be inserted. (no need of '\0')
Parameter [input]: _nbElement number of element to insert
replace ()
void replace(int32_t _pos,
const int8_t & _item);
Replace one element in the buffer
Parameter [input]: _pos The first element to remove.
Parameter [input]: _items Data that might be inserted.
replace ()
void replace(int32_t _pos,
int32_t _nbRemoveElement,
std::vector<int8_t> & _items);
Replace specified data.
Parameter [input]: _pos The first element to remove.
Parameter [input]: _nbRemoveElement number of element to remove.
Parameter [input]: _items Data that might be inserted.
replace ()
void replace(int32_t _pos,
int32_t _nbRemoveElement,
int8_t * _items,
int32_t _nbElement);
Replace specified data.
Parameter [input]: _pos The first element to remove.
Parameter [input]: _nbRemoveElement number of element to remove.
Parameter [input]: _items Data that might be inserted.
Parameter [input]: _nbElement Number of element that might be added.
remove ()
void remove(int32_t _pos,
int32_t _nbRemoveElement);
Remove specific data in the buffer.
Parameter [input]: _pos The first element to remove
Parameter [input]: _nbRemoveElement number of element to remove
pop_back ()
void pop_back(void);
Remove the last element of the Buffer.
clear ()
void clear(void);
Clean all the data in the buffer.
getDirect ()
int8_t & getDirect(int32_t _realElementPosition);
Get a current element in the vector (iterator system)
Parameter [input]: _realElementPosition Real position in the buffer (only use in the ITERATOR)
Return: Reference on the Element
size ()
int32_t size(void);
Get the number of element in the vector
Return: The number requested
changeAllocation ()
void changeAllocation(int32_t _newSize);
Change the current allocation to the corect one (depend on the current size)
Parameter [input]: _newSize Minimum number of element needed
gapMove ()
bool gapMove(int32_t _pos);
Move the current gap at an other position
Parameter [input]: _pos Position of the new Gap.
Return: false The operation can not be proccesed.
Return: true The operation done correctly.
gapResize ()
bool gapResize(int32_t _pos,
int32_t _newGapLen);
Change The gap position and size
Parameter [input]: _pos Position of the new Gap.
Parameter [input]: _newGapLen Size of the new gap (can be bigger than GAP_SIZE_MAX).
Return: false The operation can not be proccesed.
Return: true The operation done correctly.
gapSize ()
int32_t gapSize(void);
Get the current gap size.
Return: The number of element in the gap
gapCheckMaxSize ()
void gapCheckMaxSize(void);
Control if the writing gap is not too big (automatic resize the buffer).
etk::Buffer ()
Buffer(int32_t _count);
Create an empty vector
-
Parameter [input]: _count Minimum request size of the Buffer
etk::Buffer ()
Buffer(const etk::Buffer & _obj);
Re-copy constructor (copy all needed data)
-
Parameter [input]: _obj Buffer that might be copy
etk::~Buffer ()
~Buffer(void);
Destructor of the current Class
dumpIn ()
bool dumpIn(etk::FSNode & _file);
Save in the current file open
-
Parameter [input] [output]: _file Pointer on the file where data might be writed
Return: true if OK / false if an error occured
dumpFrom ()
bool dumpFrom(etk::FSNode & _file);
Load in the current file open
-
Parameter [input] [output]: _myFile Pointer on the file where data might be read
Return: true if OK / false if an error occured
operator= ()
etk::Buffer & operator=(const etk::Buffer & _obj);
Re-copy operator
-
Parameter [input]: _obj Buffer that might be copy
Return: reference on the curent re-copy vector
operator[] ()
int8_t operator[](int32_t _pos);
Operator [] : Get the data at the requested position (gap abstraction done).
-
Parameter [input]: _pos Position in the buffer.
Return: Element at the request pos.
get ()
int8_t & get(int32_t _pos);
Get a current element in the vector
-
Parameter [input]: _pos Desired position read
Return: Reference on the Element
get ()
int32_t get(int32_t _pos, UChar & _value, charset_te _charset);
Get a current element in the vector
-
Parameter [input]: _pos Desired position read
Return: Reference on the Element
get ()
std::vector<int8_t> get(int32_t _pos, int32_t _nbElement);
Get elements from a specific position.
-
Parameter [input]: _pos Position of the first element.
Parameter [input]: _nbElement Number of element needed.
Return: The data requested
push_back ()
void push_back(const int8_t & _item);
Add at the Last position of the Vector
-
Parameter [input]: _item Element to add at the end of vector
insert ()
void insert(int32_t _pos, const int8_t & _item);
Insert One item at the specify position.
-
Parameter [input]: _pos Position where data might be inserted
Parameter [input]: _items Data that might be inserted.
insert ()
void insert(int32_t _pos, std::vector<int8_t> & _items);
Insert data in the buffer
-
Parameter [input]: _pos Position where data might be inserted
Parameter [input]: _items Data that might be inserted.
insert ()
void insert(int32_t _pos, int8_t * _items, int32_t _nbElement);
Insert data in the buffer
-
Parameter [input]: _pos Position where data might be inserted
Parameter [input]: _items Data that might be inserted. (no need of '\0')
Parameter [input]: _nbElement number of element to insert
replace ()
void replace(int32_t _pos, const int8_t & _item);
Replace one element in the buffer
-
Parameter [input]: _pos The first element to remove.
Parameter [input]: _items Data that might be inserted.
replace ()
void replace(int32_t _pos, int32_t _nbRemoveElement, std::vector<int8_t> & _items);
Replace specified data.
-
Parameter [input]: _pos The first element to remove.
Parameter [input]: _nbRemoveElement number of element to remove.
Parameter [input]: _items Data that might be inserted.
replace ()
void replace(int32_t _pos, int32_t _nbRemoveElement, int8_t * _items, int32_t _nbElement);
Replace specified data.
-
Parameter [input]: _pos The first element to remove.
Parameter [input]: _nbRemoveElement number of element to remove.
Parameter [input]: _items Data that might be inserted.
Parameter [input]: _nbElement Number of element that might be added.
remove ()
void remove(int32_t _pos, int32_t _nbRemoveElement);
Remove specific data in the buffer.
-
Parameter [input]: _pos The first element to remove
Parameter [input]: _nbRemoveElement number of element to remove
pop_back ()
void pop_back(void);
Remove the last element of the Buffer.
clear ()
void clear(void);
Clean all the data in the buffer.
getDirect ()
int8_t & getDirect(int32_t _realElementPosition);
Get a current element in the vector (iterator system)
-
Parameter [input]: _realElementPosition Real position in the buffer (only use in the ITERATOR)
Return: Reference on the Element
size ()
int32_t size(void);
Get the number of element in the vector
-
Return: The number requested
changeAllocation ()
void changeAllocation(int32_t _newSize);
Change the current allocation to the corect one (depend on the current size)
-
Parameter [input]: _newSize Minimum number of element needed
gapMove ()
bool gapMove(int32_t _pos);
Move the current gap at an other position
-
Parameter [input]: _pos Position of the new Gap.
Return: false The operation can not be proccesed.
Return: true The operation done correctly.
gapResize ()
bool gapResize(int32_t _pos, int32_t _newGapLen);
Change The gap position and size
-
Parameter [input]: _pos Position of the new Gap.
Parameter [input]: _newGapLen Size of the new gap (can be bigger than GAP_SIZE_MAX).
Return: false The operation can not be proccesed.
Return: true The operation done correctly.
gapSize ()
int32_t gapSize(void);
Get the current gap size.
-
Return: The number of element in the gap
gapCheckMaxSize ()
void gapCheckMaxSize(void);
Control if the writing gap is not too big (automatic resize the buffer).