move EdnVectorBin in Edn::VectorType
This commit is contained in:
@@ -126,7 +126,7 @@ bool EdnBuf::DumpFrom(FILE *myFile)
|
||||
}
|
||||
|
||||
|
||||
void EdnBuf::GetAll(EdnVectorBin<int8_t> &text)
|
||||
void EdnBuf::GetAll(Edn::VectorType<int8_t> &text)
|
||||
{
|
||||
// Clean output vector
|
||||
text.Clear();
|
||||
@@ -135,9 +135,9 @@ void EdnBuf::GetAll(EdnVectorBin<int8_t> &text)
|
||||
}
|
||||
|
||||
|
||||
void EdnBuf::SetAll(EdnVectorBin<int8_t> &text)
|
||||
void EdnBuf::SetAll(Edn::VectorType<int8_t> &text)
|
||||
{
|
||||
EdnVectorBin<int8_t> deletedText;
|
||||
Edn::VectorType<int8_t> deletedText;
|
||||
|
||||
// extract all data of the buffer :
|
||||
GetAll(deletedText);
|
||||
@@ -155,7 +155,7 @@ void EdnBuf::SetAll(EdnVectorBin<int8_t> &text)
|
||||
eventModification(0, m_data.Size(), deletedText);
|
||||
}
|
||||
|
||||
void EdnBuf::GetRange(int32_t start, int32_t end, EdnVectorBin<int8_t> &output)
|
||||
void EdnBuf::GetRange(int32_t start, int32_t end, Edn::VectorType<int8_t> &output)
|
||||
{
|
||||
// Remove all data ...
|
||||
output.Clear();
|
||||
@@ -189,7 +189,7 @@ int8_t EdnBuf::operator[] (int32_t pos)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EdnBuf::Insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
||||
void EdnBuf::Insert(int32_t pos, Edn::VectorType<int8_t> &insertText)
|
||||
{
|
||||
// if pos is not contiguous to existing text, make it
|
||||
pos = edn_average(0, pos, m_data.Size() );
|
||||
@@ -197,7 +197,7 @@ void EdnBuf::Insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
||||
insert(pos, insertText);
|
||||
|
||||
// Call the redisplay ...
|
||||
EdnVectorBin<int8_t> deletedText;
|
||||
Edn::VectorType<int8_t> deletedText;
|
||||
eventModification(pos, insertText.Size(), deletedText);
|
||||
}
|
||||
|
||||
@@ -212,9 +212,9 @@ void EdnBuf::Insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EdnBuf::Replace(int32_t start, int32_t end, EdnVectorBin<int8_t> &insertText)
|
||||
void EdnBuf::Replace(int32_t start, int32_t end, Edn::VectorType<int8_t> &insertText)
|
||||
{
|
||||
EdnVectorBin<int8_t> deletedText;
|
||||
Edn::VectorType<int8_t> deletedText;
|
||||
GetRange(start, end, deletedText);
|
||||
m_data.Replace(start, end-start, insertText);
|
||||
// update internal elements
|
||||
@@ -234,7 +234,7 @@ void EdnBuf::Replace(int32_t start, int32_t end, EdnVectorBin<int8_t> &insertTex
|
||||
void EdnBuf::Remove(int32_t start, int32_t end)
|
||||
{
|
||||
|
||||
EdnVectorBin<int8_t> deletedText;
|
||||
Edn::VectorType<int8_t> deletedText;
|
||||
// Make sure the arguments make sense
|
||||
if (start > end) {
|
||||
int32_t temp = start;
|
||||
@@ -265,7 +265,7 @@ int32_t EdnBuf::Indent(selectionType_te select)
|
||||
// Get Range :
|
||||
int32_t l_start = StartOfLine(SelectionStart);
|
||||
int32_t l_end = EndOfLine(SelectionEnd);
|
||||
EdnVectorBin<int8_t> l_tmpData;
|
||||
Edn::VectorType<int8_t> l_tmpData;
|
||||
GetRange(l_start, l_end, l_tmpData);
|
||||
|
||||
l_tmpData.Insert(0, '\n');
|
||||
@@ -304,7 +304,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
|
||||
// Get Range :
|
||||
int32_t l_start = StartOfLine(SelectionStart);
|
||||
int32_t l_end = EndOfLine(SelectionEnd);
|
||||
EdnVectorBin<int8_t> l_tmpData;
|
||||
Edn::VectorType<int8_t> l_tmpData;
|
||||
GetRange(l_start, l_end, l_tmpData);
|
||||
|
||||
l_tmpData.Insert(0, '\n');
|
||||
@@ -346,7 +346,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EdnBuf::GetLineText(int32_t pos, EdnVectorBin<int8_t> &text)
|
||||
void EdnBuf::GetLineText(int32_t pos, Edn::VectorType<int8_t> &text)
|
||||
{
|
||||
GetRange( StartOfLine(pos), EndOfLine(pos), text);
|
||||
}
|
||||
@@ -666,9 +666,9 @@ int32_t EdnBuf::CountLines(int32_t startPos, int32_t endPos)
|
||||
* @return number of line found
|
||||
*
|
||||
*/
|
||||
int32_t EdnBuf::CountLines(EdnVectorBin<int8_t> &data)
|
||||
int32_t EdnBuf::CountLines(Edn::VectorType<int8_t> &data)
|
||||
{
|
||||
EdnVectorBin<int8_t>::Iterator myPosIt = data.Begin();
|
||||
Edn::VectorType<int8_t>::Iterator myPosIt = data.Begin();
|
||||
int32_t lineCount = 0;
|
||||
|
||||
while(myPosIt) {
|
||||
@@ -810,7 +810,7 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
|
||||
* @return false ==> not found data
|
||||
*
|
||||
*/
|
||||
bool EdnBuf::SearchForward(int32_t startPos, EdnVectorBin<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive)
|
||||
bool EdnBuf::SearchForward(int32_t startPos, Edn::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive)
|
||||
{
|
||||
int32_t position;
|
||||
int32_t searchLen = searchVect.Size();
|
||||
@@ -851,7 +851,7 @@ bool EdnBuf::SearchForward(int32_t startPos, EdnVectorBin<int8_t> &searchVect, i
|
||||
* @return false ==> not found data
|
||||
*
|
||||
*/
|
||||
bool EdnBuf::SearchBackward(int32_t startPos, EdnVectorBin<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive)
|
||||
bool EdnBuf::SearchBackward(int32_t startPos, Edn::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive)
|
||||
{
|
||||
int32_t position;
|
||||
int32_t searchLen = searchVect.Size();
|
||||
@@ -977,7 +977,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
|
||||
* @return number of element inserted.
|
||||
*
|
||||
*/
|
||||
int32_t EdnBuf::insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
||||
int32_t EdnBuf::insert(int32_t pos, Edn::VectorType<int8_t> &insertText)
|
||||
{
|
||||
// Insert data in buffer
|
||||
m_data.Insert(pos, insertText);
|
||||
@@ -998,7 +998,7 @@ int32_t EdnBuf::insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EdnBuf::eventModification(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t> &deletedText)
|
||||
void EdnBuf::eventModification(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText)
|
||||
{
|
||||
if( 0 == deletedText.Size()
|
||||
&& 0 == nInserted)
|
||||
|
@@ -82,21 +82,21 @@ class EdnBuf {
|
||||
// destructer
|
||||
~EdnBuf(void);
|
||||
// public function :
|
||||
void GetAll( EdnVectorBin<int8_t> &text);
|
||||
void SetAll( EdnVectorBin<int8_t> &text);
|
||||
void GetRange( int32_t start, int32_t end, EdnVectorBin<int8_t> &output);
|
||||
void GetAll( Edn::VectorType<int8_t> &text);
|
||||
void SetAll( Edn::VectorType<int8_t> &text);
|
||||
void GetRange( int32_t start, int32_t end, Edn::VectorType<int8_t> &output);
|
||||
bool DumpIn( FILE *myFile);
|
||||
bool DumpFrom( FILE *myFile);
|
||||
// replace with operator [] ...
|
||||
int8_t operator[] (int32_t);
|
||||
void Insert( int32_t pos, EdnVectorBin<int8_t> &insertText);
|
||||
void Replace( int32_t start, int32_t end, EdnVectorBin<int8_t> &insertText);
|
||||
void Insert( int32_t pos, Edn::VectorType<int8_t> &insertText);
|
||||
void Replace( int32_t start, int32_t end, Edn::VectorType<int8_t> &insertText);
|
||||
void Remove( int32_t start, int32_t end);
|
||||
int32_t Indent( selectionType_te select);
|
||||
int32_t UnIndent( selectionType_te select);
|
||||
|
||||
|
||||
void GetLineText( int32_t pos, EdnVectorBin<int8_t> &text);
|
||||
void GetLineText( int32_t pos, Edn::VectorType<int8_t> &text);
|
||||
int32_t StartOfLine( int32_t pos);
|
||||
int32_t EndOfLine( int32_t pos);
|
||||
|
||||
@@ -107,12 +107,12 @@ class EdnBuf {
|
||||
int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
|
||||
int32_t CountLines( int32_t startPos, int32_t endPos);
|
||||
int32_t CountLines( void);
|
||||
int32_t CountLines( EdnVectorBin<int8_t> &data);
|
||||
int32_t CountLines( Edn::VectorType<int8_t> &data);
|
||||
int32_t CountForwardNLines( int32_t startPos, int32_t nLines);
|
||||
int32_t CountBackwardNLines( int32_t startPos, int32_t nLines);
|
||||
|
||||
bool SearchForward( int32_t startPos, EdnVectorBin<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
|
||||
bool SearchBackward( int32_t startPos, EdnVectorBin<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
|
||||
bool SearchForward( int32_t startPos, Edn::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
|
||||
bool SearchBackward( int32_t startPos, Edn::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
|
||||
bool SearchForward( int32_t startPos, char searchChar, int32_t *foundPos);
|
||||
bool SearchBackward( int32_t startPos, char searchChar, int32_t *foundPos);
|
||||
bool SelectAround( int32_t startPos, int32_t &beginPos, int32_t &endPos);
|
||||
@@ -130,9 +130,9 @@ class EdnBuf {
|
||||
void Unselect( selectionType_te select);
|
||||
void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd);
|
||||
bool GetSelectionPos( selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd);
|
||||
void GetSelectionText( selectionType_te select, EdnVectorBin<int8_t> &text);
|
||||
void GetSelectionText( selectionType_te select, Edn::VectorType<int8_t> &text);
|
||||
void RemoveSelected( selectionType_te select);
|
||||
void ReplaceSelected( selectionType_te select, EdnVectorBin<int8_t> &text);
|
||||
void ReplaceSelected( selectionType_te select, Edn::VectorType<int8_t> &text);
|
||||
private:
|
||||
// current selection of the buffer
|
||||
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer
|
||||
@@ -148,8 +148,8 @@ class EdnBuf {
|
||||
private:
|
||||
bool m_isUndoProcessing;
|
||||
bool m_isRedoProcessing;
|
||||
EdnVectorBin<EdnBufHistory*> m_historyUndo;
|
||||
EdnVectorBin<EdnBufHistory*> m_historyRedo;
|
||||
Edn::VectorType<EdnBufHistory*> m_historyUndo;
|
||||
Edn::VectorType<EdnBufHistory*> m_historyRedo;
|
||||
|
||||
// -----------------------------------------
|
||||
// hightlight section :
|
||||
@@ -201,10 +201,10 @@ class EdnBuf {
|
||||
void removeSelected( selection &sel);
|
||||
void replaceSelected( selection &sel, const char *text);
|
||||
|
||||
void eventModification( int32_t pos, int32_t nInserted, EdnVectorBin<int8_t> &deletedText);
|
||||
void eventModification( int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText);
|
||||
|
||||
|
||||
int32_t insert( int32_t pos, EdnVectorBin<int8_t> &insertText);
|
||||
int32_t insert( int32_t pos, Edn::VectorType<int8_t> &insertText);
|
||||
|
||||
bool charMatch( char first, char second, bool caseSensitive = true);
|
||||
};
|
||||
|
@@ -39,7 +39,7 @@ EdnBufHistory::EdnBufHistory(void)
|
||||
m_nInserted = 0;
|
||||
}
|
||||
|
||||
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t> &deletedText)
|
||||
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText)
|
||||
{
|
||||
//EDN_INFO("EdnBufHistory new + data");
|
||||
m_pos = pos;
|
||||
@@ -47,7 +47,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t
|
||||
m_deletedText = deletedText;
|
||||
}
|
||||
|
||||
void EdnBufHistory::Set(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t> &deletedText)
|
||||
void EdnBufHistory::Set(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText)
|
||||
{
|
||||
//EDN_INFO("EdnBufHistory new + data");
|
||||
m_pos = pos;
|
||||
@@ -75,7 +75,7 @@ int32_t EdnBufHistory::getnbInserted(void)
|
||||
return m_nInserted;
|
||||
}
|
||||
|
||||
void EdnBufHistory::getData(EdnVectorBin<int8_t> &deletedText)
|
||||
void EdnBufHistory::getData(Edn::VectorType<int8_t> &deletedText)
|
||||
{
|
||||
deletedText = m_deletedText;
|
||||
}
|
||||
|
@@ -27,22 +27,22 @@
|
||||
#define __EDN_BUFFER_HISTORY_H__
|
||||
|
||||
|
||||
#include "EdnVectorBin.h"
|
||||
#include "VectorType.h"
|
||||
|
||||
class EdnBufHistory{
|
||||
public:
|
||||
EdnBufHistory(void);
|
||||
EdnBufHistory(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t> &deletedText);
|
||||
EdnBufHistory(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText);
|
||||
~EdnBufHistory(void);
|
||||
void Set(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t> &deletedText);
|
||||
void Set(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText);
|
||||
int32_t getPos(void);
|
||||
int32_t getnbDeleted(void);
|
||||
int32_t getnbInserted(void);
|
||||
void getData(EdnVectorBin<int8_t> &deletedText);
|
||||
void getData(Edn::VectorType<int8_t> &deletedText);
|
||||
private:
|
||||
int32_t m_pos;
|
||||
int32_t m_nInserted;
|
||||
EdnVectorBin<int8_t> m_deletedText;
|
||||
Edn::VectorType<int8_t> m_deletedText;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -53,7 +53,7 @@ int32_t EdnBuf::Undo(void)
|
||||
int32_t pos = m_historyUndo[nbElement]->getPos();
|
||||
int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted();
|
||||
int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted();
|
||||
EdnVectorBin<int8_t> deletedText;
|
||||
Edn::VectorType<int8_t> deletedText;
|
||||
m_historyUndo[nbElement]->getData(deletedText);
|
||||
m_isUndoProcessing = true;
|
||||
if (0 == nbInserted) {
|
||||
@@ -101,7 +101,7 @@ int32_t EdnBuf::Redo(void)
|
||||
int32_t pos = m_historyRedo[nbElement]->getPos();
|
||||
int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted();
|
||||
int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted();
|
||||
EdnVectorBin<int8_t> deletedText;
|
||||
Edn::VectorType<int8_t> deletedText;
|
||||
m_historyRedo[nbElement]->getData(deletedText);
|
||||
m_isRedoProcessing = true;
|
||||
if (0 == nbInserted) {
|
||||
|
@@ -136,7 +136,7 @@ bool EdnBuf::GetSelectionPos(selectionType_te select, int32_t &start, int32_t &e
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EdnBuf::GetSelectionText(selectionType_te select, EdnVectorBin<int8_t> &text)
|
||||
void EdnBuf::GetSelectionText(selectionType_te select, Edn::VectorType<int8_t> &text)
|
||||
{
|
||||
int32_t start, end, rectStart, rectEnd;
|
||||
bool isRect;
|
||||
@@ -198,7 +198,7 @@ void EdnBuf::RemoveSelected(selectionType_te select)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EdnBuf::ReplaceSelected(selectionType_te select, EdnVectorBin<int8_t> &text)
|
||||
void EdnBuf::ReplaceSelected(selectionType_te select, Edn::VectorType<int8_t> &text)
|
||||
{
|
||||
int32_t start, end, rectStart, rectEnd;
|
||||
bool isRect;
|
||||
|
Reference in New Issue
Block a user