move EdnVectorBin in Edn::VectorType
This commit is contained in:
parent
45aad6b2e2
commit
0fe575e432
@ -1047,7 +1047,7 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
if (1==size) {
|
if (1==size) {
|
||||||
if (UTF8data[0] == 0x09) {
|
if (UTF8data[0] == 0x09) {
|
||||||
if (false == haveSelectionActive) {
|
if (false == haveSelectionActive) {
|
||||||
EdnVectorBin<int8_t> tmpVect;
|
Edn::VectorType<int8_t> tmpVect;
|
||||||
tmpVect.PushBack(0x09);
|
tmpVect.PushBack(0x09);
|
||||||
m_EdnBuf.Insert(m_cursorPos, tmpVect);
|
m_EdnBuf.Insert(m_cursorPos, tmpVect);
|
||||||
SetInsertPosition(m_cursorPos+1, true);
|
SetInsertPosition(m_cursorPos+1, true);
|
||||||
@ -1060,7 +1060,7 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
}
|
}
|
||||||
actionDone = true;
|
actionDone = true;
|
||||||
} else if (UTF8data[0] == '\n') {
|
} else if (UTF8data[0] == '\n') {
|
||||||
EdnVectorBin<int8_t> tmpVect;
|
Edn::VectorType<int8_t> tmpVect;
|
||||||
tmpVect.PushBack('\n');
|
tmpVect.PushBack('\n');
|
||||||
// if Auto indent Enable ==> we get the start of the previous line and add it to tne new one
|
// if Auto indent Enable ==> we get the start of the previous line and add it to tne new one
|
||||||
if (true == globals::IsSetAutoIndent() ) {
|
if (true == globals::IsSetAutoIndent() ) {
|
||||||
@ -1115,7 +1115,7 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
|
|
||||||
if (false == actionDone) {
|
if (false == actionDone) {
|
||||||
if (true == m_EdnBuf.GetUTF8Mode()) {
|
if (true == m_EdnBuf.GetUTF8Mode()) {
|
||||||
EdnVectorBin<int8_t> tmpVect;
|
Edn::VectorType<int8_t> tmpVect;
|
||||||
int32_t localOfset = strlen(UTF8data);
|
int32_t localOfset = strlen(UTF8data);
|
||||||
tmpVect.PushBack((int8_t*)UTF8data, localOfset);
|
tmpVect.PushBack((int8_t*)UTF8data, localOfset);
|
||||||
if (false == haveSelectionActive) {
|
if (false == haveSelectionActive) {
|
||||||
@ -1130,7 +1130,7 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
char output_ISO;
|
char output_ISO;
|
||||||
convertUtf8ToIso(m_EdnBuf.GetCharsetType(), UTF8data, output_ISO);
|
convertUtf8ToIso(m_EdnBuf.GetCharsetType(), UTF8data, output_ISO);
|
||||||
//printf(" insert : \"%s\"==> 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO);
|
//printf(" insert : \"%s\"==> 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO);
|
||||||
EdnVectorBin<int8_t> tmpVect;
|
Edn::VectorType<int8_t> tmpVect;
|
||||||
tmpVect.PushBack(output_ISO);
|
tmpVect.PushBack(output_ISO);
|
||||||
if (false == haveSelectionActive) {
|
if (false == haveSelectionActive) {
|
||||||
m_EdnBuf.Insert(m_cursorPos, tmpVect);
|
m_EdnBuf.Insert(m_cursorPos, tmpVect);
|
||||||
@ -1154,7 +1154,7 @@ int32_t BufferText::FindLine(Edn::String &data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EDN_INFO("Search data line : \"" << data.c_str() << "\"");
|
EDN_INFO("Search data line : \"" << data.c_str() << "\"");
|
||||||
EdnVectorBin<int8_t> mVectSearch;
|
Edn::VectorType<int8_t> mVectSearch;
|
||||||
mVectSearch = data.GetVector();
|
mVectSearch = data.GetVector();
|
||||||
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
||||||
int32_t foundPos;
|
int32_t foundPos;
|
||||||
@ -1197,7 +1197,7 @@ void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool w
|
|||||||
EDN_WARNING("no search data");
|
EDN_WARNING("no search data");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EdnVectorBin<int8_t> mVectSearch;
|
Edn::VectorType<int8_t> mVectSearch;
|
||||||
mVectSearch = data.GetVector();
|
mVectSearch = data.GetVector();
|
||||||
if (false == back) {
|
if (false == back) {
|
||||||
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
||||||
@ -1289,7 +1289,7 @@ void BufferText::Replace(Edn::String &data)
|
|||||||
*/
|
*/
|
||||||
void BufferText::Copy(int8_t clipboardID)
|
void BufferText::Copy(int8_t clipboardID)
|
||||||
{
|
{
|
||||||
EdnVectorBin<int8_t> mVect;
|
Edn::VectorType<int8_t> mVect;
|
||||||
// get the curent selected data
|
// get the curent selected data
|
||||||
if (true == m_EdnBuf.SelectHasSelection(SELECTION_PRIMARY) ) {
|
if (true == m_EdnBuf.SelectHasSelection(SELECTION_PRIMARY) ) {
|
||||||
m_EdnBuf.GetSelectionText(SELECTION_PRIMARY, mVect);
|
m_EdnBuf.GetSelectionText(SELECTION_PRIMARY, mVect);
|
||||||
@ -1338,7 +1338,7 @@ void BufferText::Cut(int8_t clipboardID)
|
|||||||
*/
|
*/
|
||||||
void BufferText::Paste(int8_t clipboardID)
|
void BufferText::Paste(int8_t clipboardID)
|
||||||
{
|
{
|
||||||
EdnVectorBin<int8_t> mVect;
|
Edn::VectorType<int8_t> mVect;
|
||||||
// copy data from the click board :
|
// copy data from the click board :
|
||||||
ClipBoard::Get(clipboardID, mVect);
|
ClipBoard::Get(clipboardID, mVect);
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class MenuBarMain
|
|||||||
GtkWidget * m_parent;
|
GtkWidget * m_parent;
|
||||||
GtkWidget * m_menu;
|
GtkWidget * m_menu;
|
||||||
GtkWidget * m_menuListe;
|
GtkWidget * m_menuListe;
|
||||||
EdnVectorBin<messageData_ts*> m_message;
|
Edn::VectorType<messageData_ts*> m_message;
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "tools_debug.h"
|
#include "tools_debug.h"
|
||||||
#include "tools_globals.h"
|
#include "tools_globals.h"
|
||||||
#include "MsgBroadcast.h"
|
#include "MsgBroadcast.h"
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
#include "AccelKey.h"
|
#include "AccelKey.h"
|
||||||
|
|
||||||
#ifndef __MENU_BAR_H__
|
#ifndef __MENU_BAR_H__
|
||||||
@ -46,7 +46,7 @@ class MenuBar: public MsgBroadcast
|
|||||||
private:
|
private:
|
||||||
GtkWidget * m_mainWidget;
|
GtkWidget * m_mainWidget;
|
||||||
GtkAccelGroup * m_accelGroup;
|
GtkAccelGroup * m_accelGroup;
|
||||||
EdnVectorBin<MenuBarMain*> m_listMenu;
|
Edn::VectorType<MenuBarMain*> m_listMenu;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class ToolBar: public MsgBroadcast
|
|||||||
void AddSeparator(void);
|
void AddSeparator(void);
|
||||||
void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
|
void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
|
||||||
GtkWidget * m_mainWidget;
|
GtkWidget * m_mainWidget;
|
||||||
EdnVectorBin<messageData_ts*> m_message;
|
Edn::VectorType<messageData_ts*> m_message;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ gboolean MenuContext::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event,
|
|||||||
uint32_t fontHeight = Display::GetFontHeight();
|
uint32_t fontHeight = Display::GetFontHeight();
|
||||||
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||||
basicColor_te selectBG = COLOR_LIST_BG_1;
|
basicColor_te selectBG = COLOR_LIST_BG_1;
|
||||||
EdnVectorBin<Edn::String *> myData;
|
Edn::VectorType<Edn::String *> myData;
|
||||||
Edn::String * plop = new Edn::String("Save");
|
Edn::String * plop = new Edn::String("Save");
|
||||||
myData.PushBack(plop);
|
myData.PushBack(plop);
|
||||||
plop = new Edn::String("Show");
|
plop = new Edn::String("Show");
|
||||||
|
@ -33,7 +33,7 @@ class HighlightPattern;
|
|||||||
#include "Edn.h"
|
#include "Edn.h"
|
||||||
#include "RegExp.h"
|
#include "RegExp.h"
|
||||||
#include "Colorize.h"
|
#include "Colorize.h"
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
#include "tinyxml.h"
|
#include "tinyxml.h"
|
||||||
#include "EdnVectorBuf.h"
|
#include "EdnVectorBuf.h"
|
||||||
|
|
||||||
@ -79,8 +79,8 @@ class HighlightPattern {
|
|||||||
bool m_haveStopPatern; //!< Stop patern presence
|
bool m_haveStopPatern; //!< Stop patern presence
|
||||||
bool m_multiline; //!< The patern is multiline
|
bool m_multiline; //!< The patern is multiline
|
||||||
char m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
char m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
||||||
EdnVectorBin<HighlightPattern *> m_subPatern; //!< Under patern of this one
|
Edn::VectorType<HighlightPattern *> m_subPatern; //!< Under patern of this one
|
||||||
// EdnVectorBin<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
|
// Edn::VectorType<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -171,7 +171,7 @@ void CTagsManager::AddToHistory(int32_t bufferID)
|
|||||||
void CTagsManager::JumpTo(void)
|
void CTagsManager::JumpTo(void)
|
||||||
{
|
{
|
||||||
if (NULL != m_ctagFile) {
|
if (NULL != m_ctagFile) {
|
||||||
EdnVectorBin<int8_t> data;
|
Edn::VectorType<int8_t> data;
|
||||||
// get the middle button of the clipboard ==> represent the current selection ...
|
// get the middle button of the clipboard ==> represent the current selection ...
|
||||||
ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
|
ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
|
||||||
if (data.Size() == 0) {
|
if (data.Size() == 0) {
|
||||||
|
@ -56,7 +56,7 @@ class CTagsManager: public Singleton<CTagsManager>, public MsgBroadcast
|
|||||||
// history system
|
// history system
|
||||||
void AddToHistory(int32_t bufferID);
|
void AddToHistory(int32_t bufferID);
|
||||||
int32_t m_historyPos;
|
int32_t m_historyPos;
|
||||||
EdnVectorBin<Edn::File*> m_historyList;
|
Edn::VectorType<Edn::File*> m_historyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,7 +35,7 @@ note: la copy dans le :
|
|||||||
[1..9] : copy interne
|
[1..9] : copy interne
|
||||||
10 : bouton du milieux
|
10 : bouton du milieux
|
||||||
*/
|
*/
|
||||||
static EdnVectorBin<int8_t> mesCopy[TOTAL_OF_CLICKBOARD];
|
static Edn::VectorType<int8_t> mesCopy[TOTAL_OF_CLICKBOARD];
|
||||||
|
|
||||||
|
|
||||||
void ClipBoard::Init(void)
|
void ClipBoard::Init(void)
|
||||||
@ -47,7 +47,7 @@ void ClipBoard::Init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClipBoard::Set(uint8_t clipboardID, EdnVectorBin<int8_t> &data)
|
void ClipBoard::Set(uint8_t clipboardID, Edn::VectorType<int8_t> &data)
|
||||||
{
|
{
|
||||||
// check if ID is correct
|
// check if ID is correct
|
||||||
if(clipboardID >= TOTAL_OF_CLICKBOARD) {
|
if(clipboardID >= TOTAL_OF_CLICKBOARD) {
|
||||||
@ -66,7 +66,7 @@ void ClipBoard::Set(uint8_t clipboardID, EdnVectorBin<int8_t> &data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClipBoard::Get(uint8_t clipboardID, EdnVectorBin<int8_t> &data)
|
void ClipBoard::Get(uint8_t clipboardID, Edn::VectorType<int8_t> &data)
|
||||||
{
|
{
|
||||||
if(clipboardID >= TOTAL_OF_CLICKBOARD) {
|
if(clipboardID >= TOTAL_OF_CLICKBOARD) {
|
||||||
EDN_WARNING("request ClickBoard id error");
|
EDN_WARNING("request ClickBoard id error");
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define __CLIP_BOARD_H__
|
#define __CLIP_BOARD_H__
|
||||||
|
|
||||||
#include "tools_debug.h"
|
#include "tools_debug.h"
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
|
|
||||||
#define TOTAL_OF_CLICKBOARD (11)
|
#define TOTAL_OF_CLICKBOARD (11)
|
||||||
#define COPY_MIDDLE_BUTTON (10)
|
#define COPY_MIDDLE_BUTTON (10)
|
||||||
@ -36,8 +36,8 @@
|
|||||||
namespace ClipBoard
|
namespace ClipBoard
|
||||||
{
|
{
|
||||||
void Init(void);
|
void Init(void);
|
||||||
void Set(uint8_t clipboardID, EdnVectorBin<int8_t> &data);
|
void Set(uint8_t clipboardID, Edn::VectorType<int8_t> &data);
|
||||||
void Get(uint8_t clipboardID, EdnVectorBin<int8_t> &data);
|
void Get(uint8_t clipboardID, Edn::VectorType<int8_t> &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -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
|
// Clean output vector
|
||||||
text.Clear();
|
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 :
|
// extract all data of the buffer :
|
||||||
GetAll(deletedText);
|
GetAll(deletedText);
|
||||||
@ -155,7 +155,7 @@ void EdnBuf::SetAll(EdnVectorBin<int8_t> &text)
|
|||||||
eventModification(0, m_data.Size(), deletedText);
|
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 ...
|
// Remove all data ...
|
||||||
output.Clear();
|
output.Clear();
|
||||||
@ -189,7 +189,7 @@ int8_t EdnBuf::operator[] (int32_t pos)
|
|||||||
* @return ---
|
* @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
|
// if pos is not contiguous to existing text, make it
|
||||||
pos = edn_average(0, pos, m_data.Size() );
|
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);
|
insert(pos, insertText);
|
||||||
|
|
||||||
// Call the redisplay ...
|
// Call the redisplay ...
|
||||||
EdnVectorBin<int8_t> deletedText;
|
Edn::VectorType<int8_t> deletedText;
|
||||||
eventModification(pos, insertText.Size(), deletedText);
|
eventModification(pos, insertText.Size(), deletedText);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,9 +212,9 @@ void EdnBuf::Insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
|||||||
* @return ---
|
* @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);
|
GetRange(start, end, deletedText);
|
||||||
m_data.Replace(start, end-start, insertText);
|
m_data.Replace(start, end-start, insertText);
|
||||||
// update internal elements
|
// 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)
|
void EdnBuf::Remove(int32_t start, int32_t end)
|
||||||
{
|
{
|
||||||
|
|
||||||
EdnVectorBin<int8_t> deletedText;
|
Edn::VectorType<int8_t> deletedText;
|
||||||
// Make sure the arguments make sense
|
// Make sure the arguments make sense
|
||||||
if (start > end) {
|
if (start > end) {
|
||||||
int32_t temp = start;
|
int32_t temp = start;
|
||||||
@ -265,7 +265,7 @@ int32_t EdnBuf::Indent(selectionType_te select)
|
|||||||
// Get Range :
|
// Get Range :
|
||||||
int32_t l_start = StartOfLine(SelectionStart);
|
int32_t l_start = StartOfLine(SelectionStart);
|
||||||
int32_t l_end = EndOfLine(SelectionEnd);
|
int32_t l_end = EndOfLine(SelectionEnd);
|
||||||
EdnVectorBin<int8_t> l_tmpData;
|
Edn::VectorType<int8_t> l_tmpData;
|
||||||
GetRange(l_start, l_end, l_tmpData);
|
GetRange(l_start, l_end, l_tmpData);
|
||||||
|
|
||||||
l_tmpData.Insert(0, '\n');
|
l_tmpData.Insert(0, '\n');
|
||||||
@ -304,7 +304,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
|
|||||||
// Get Range :
|
// Get Range :
|
||||||
int32_t l_start = StartOfLine(SelectionStart);
|
int32_t l_start = StartOfLine(SelectionStart);
|
||||||
int32_t l_end = EndOfLine(SelectionEnd);
|
int32_t l_end = EndOfLine(SelectionEnd);
|
||||||
EdnVectorBin<int8_t> l_tmpData;
|
Edn::VectorType<int8_t> l_tmpData;
|
||||||
GetRange(l_start, l_end, l_tmpData);
|
GetRange(l_start, l_end, l_tmpData);
|
||||||
|
|
||||||
l_tmpData.Insert(0, '\n');
|
l_tmpData.Insert(0, '\n');
|
||||||
@ -346,7 +346,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
|
|||||||
* @return ---
|
* @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);
|
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
|
* @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;
|
int32_t lineCount = 0;
|
||||||
|
|
||||||
while(myPosIt) {
|
while(myPosIt) {
|
||||||
@ -810,7 +810,7 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
|
|||||||
* @return false ==> not found data
|
* @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 position;
|
||||||
int32_t searchLen = searchVect.Size();
|
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
|
* @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 position;
|
||||||
int32_t searchLen = searchVect.Size();
|
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.
|
* @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
|
// Insert data in buffer
|
||||||
m_data.Insert(pos, insertText);
|
m_data.Insert(pos, insertText);
|
||||||
@ -998,7 +998,7 @@ int32_t EdnBuf::insert(int32_t pos, EdnVectorBin<int8_t> &insertText)
|
|||||||
* @return ---
|
* @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()
|
if( 0 == deletedText.Size()
|
||||||
&& 0 == nInserted)
|
&& 0 == nInserted)
|
||||||
|
@ -82,21 +82,21 @@ class EdnBuf {
|
|||||||
// destructer
|
// destructer
|
||||||
~EdnBuf(void);
|
~EdnBuf(void);
|
||||||
// public function :
|
// public function :
|
||||||
void GetAll( EdnVectorBin<int8_t> &text);
|
void GetAll( Edn::VectorType<int8_t> &text);
|
||||||
void SetAll( EdnVectorBin<int8_t> &text);
|
void SetAll( Edn::VectorType<int8_t> &text);
|
||||||
void GetRange( int32_t start, int32_t end, EdnVectorBin<int8_t> &output);
|
void GetRange( int32_t start, int32_t end, Edn::VectorType<int8_t> &output);
|
||||||
bool DumpIn( FILE *myFile);
|
bool DumpIn( FILE *myFile);
|
||||||
bool DumpFrom( FILE *myFile);
|
bool DumpFrom( FILE *myFile);
|
||||||
// replace with operator [] ...
|
// replace with operator [] ...
|
||||||
int8_t operator[] (int32_t);
|
int8_t operator[] (int32_t);
|
||||||
void Insert( int32_t pos, EdnVectorBin<int8_t> &insertText);
|
void Insert( int32_t pos, Edn::VectorType<int8_t> &insertText);
|
||||||
void Replace( int32_t start, int32_t end, EdnVectorBin<int8_t> &insertText);
|
void Replace( int32_t start, int32_t end, Edn::VectorType<int8_t> &insertText);
|
||||||
void Remove( int32_t start, int32_t end);
|
void Remove( int32_t start, int32_t end);
|
||||||
int32_t Indent( selectionType_te select);
|
int32_t Indent( selectionType_te select);
|
||||||
int32_t UnIndent( 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 StartOfLine( int32_t pos);
|
||||||
int32_t EndOfLine( 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 CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
|
||||||
int32_t CountLines( int32_t startPos, int32_t endPos);
|
int32_t CountLines( int32_t startPos, int32_t endPos);
|
||||||
int32_t CountLines( void);
|
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 CountForwardNLines( int32_t startPos, int32_t nLines);
|
||||||
int32_t CountBackwardNLines( 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 SearchForward( int32_t startPos, Edn::VectorType<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 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 SearchForward( int32_t startPos, char searchChar, int32_t *foundPos);
|
||||||
bool SearchBackward( 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);
|
bool SelectAround( int32_t startPos, int32_t &beginPos, int32_t &endPos);
|
||||||
@ -130,9 +130,9 @@ class EdnBuf {
|
|||||||
void Unselect( selectionType_te select);
|
void Unselect( selectionType_te select);
|
||||||
void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd);
|
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);
|
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 RemoveSelected( selectionType_te select);
|
||||||
void ReplaceSelected( selectionType_te select, EdnVectorBin<int8_t> &text);
|
void ReplaceSelected( selectionType_te select, Edn::VectorType<int8_t> &text);
|
||||||
private:
|
private:
|
||||||
// current selection of the buffer
|
// current selection of the buffer
|
||||||
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer
|
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer
|
||||||
@ -148,8 +148,8 @@ class EdnBuf {
|
|||||||
private:
|
private:
|
||||||
bool m_isUndoProcessing;
|
bool m_isUndoProcessing;
|
||||||
bool m_isRedoProcessing;
|
bool m_isRedoProcessing;
|
||||||
EdnVectorBin<EdnBufHistory*> m_historyUndo;
|
Edn::VectorType<EdnBufHistory*> m_historyUndo;
|
||||||
EdnVectorBin<EdnBufHistory*> m_historyRedo;
|
Edn::VectorType<EdnBufHistory*> m_historyRedo;
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// hightlight section :
|
// hightlight section :
|
||||||
@ -201,10 +201,10 @@ class EdnBuf {
|
|||||||
void removeSelected( selection &sel);
|
void removeSelected( selection &sel);
|
||||||
void replaceSelected( selection &sel, const char *text);
|
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);
|
bool charMatch( char first, char second, bool caseSensitive = true);
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,7 @@ EdnBufHistory::EdnBufHistory(void)
|
|||||||
m_nInserted = 0;
|
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");
|
//EDN_INFO("EdnBufHistory new + data");
|
||||||
m_pos = pos;
|
m_pos = pos;
|
||||||
@ -47,7 +47,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, EdnVectorBin<int8_t
|
|||||||
m_deletedText = deletedText;
|
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");
|
//EDN_INFO("EdnBufHistory new + data");
|
||||||
m_pos = pos;
|
m_pos = pos;
|
||||||
@ -75,7 +75,7 @@ int32_t EdnBufHistory::getnbInserted(void)
|
|||||||
return m_nInserted;
|
return m_nInserted;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EdnBufHistory::getData(EdnVectorBin<int8_t> &deletedText)
|
void EdnBufHistory::getData(Edn::VectorType<int8_t> &deletedText)
|
||||||
{
|
{
|
||||||
deletedText = m_deletedText;
|
deletedText = m_deletedText;
|
||||||
}
|
}
|
||||||
|
@ -27,22 +27,22 @@
|
|||||||
#define __EDN_BUFFER_HISTORY_H__
|
#define __EDN_BUFFER_HISTORY_H__
|
||||||
|
|
||||||
|
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
|
|
||||||
class EdnBufHistory{
|
class EdnBufHistory{
|
||||||
public:
|
public:
|
||||||
EdnBufHistory(void);
|
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);
|
~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 getPos(void);
|
||||||
int32_t getnbDeleted(void);
|
int32_t getnbDeleted(void);
|
||||||
int32_t getnbInserted(void);
|
int32_t getnbInserted(void);
|
||||||
void getData(EdnVectorBin<int8_t> &deletedText);
|
void getData(Edn::VectorType<int8_t> &deletedText);
|
||||||
private:
|
private:
|
||||||
int32_t m_pos;
|
int32_t m_pos;
|
||||||
int32_t m_nInserted;
|
int32_t m_nInserted;
|
||||||
EdnVectorBin<int8_t> m_deletedText;
|
Edn::VectorType<int8_t> m_deletedText;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,7 +53,7 @@ int32_t EdnBuf::Undo(void)
|
|||||||
int32_t pos = m_historyUndo[nbElement]->getPos();
|
int32_t pos = m_historyUndo[nbElement]->getPos();
|
||||||
int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted();
|
int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted();
|
||||||
int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted();
|
int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted();
|
||||||
EdnVectorBin<int8_t> deletedText;
|
Edn::VectorType<int8_t> deletedText;
|
||||||
m_historyUndo[nbElement]->getData(deletedText);
|
m_historyUndo[nbElement]->getData(deletedText);
|
||||||
m_isUndoProcessing = true;
|
m_isUndoProcessing = true;
|
||||||
if (0 == nbInserted) {
|
if (0 == nbInserted) {
|
||||||
@ -101,7 +101,7 @@ int32_t EdnBuf::Redo(void)
|
|||||||
int32_t pos = m_historyRedo[nbElement]->getPos();
|
int32_t pos = m_historyRedo[nbElement]->getPos();
|
||||||
int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted();
|
int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted();
|
||||||
int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted();
|
int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted();
|
||||||
EdnVectorBin<int8_t> deletedText;
|
Edn::VectorType<int8_t> deletedText;
|
||||||
m_historyRedo[nbElement]->getData(deletedText);
|
m_historyRedo[nbElement]->getData(deletedText);
|
||||||
m_isRedoProcessing = true;
|
m_isRedoProcessing = true;
|
||||||
if (0 == nbInserted) {
|
if (0 == nbInserted) {
|
||||||
|
@ -136,7 +136,7 @@ bool EdnBuf::GetSelectionPos(selectionType_te select, int32_t &start, int32_t &e
|
|||||||
* @return ---
|
* @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;
|
int32_t start, end, rectStart, rectEnd;
|
||||||
bool isRect;
|
bool isRect;
|
||||||
@ -198,7 +198,7 @@ void EdnBuf::RemoveSelected(selectionType_te select)
|
|||||||
* @return ---
|
* @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;
|
int32_t start, end, rectStart, rectEnd;
|
||||||
bool isRect;
|
bool isRect;
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#include "tools_debug.h"
|
#include "tools_debug.h"
|
||||||
#include "tools_globals.h"
|
#include "tools_globals.h"
|
||||||
|
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
|
|
||||||
void TestTemplate(void)
|
void TestTemplate(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
EDN_WARNING("Start Template Test ...");
|
EDN_WARNING("Start Template Test ...");
|
||||||
EdnVectorBin<int32_t> plop;
|
Edn::VectorType<int32_t> plop;
|
||||||
EdnVectorBin<int8_t> plop2;
|
Edn::VectorType<int8_t> plop2;
|
||||||
|
|
||||||
plop.PushBack(15365);
|
plop.PushBack(15365);
|
||||||
plop.PushBack(1);
|
plop.PushBack(1);
|
||||||
|
@ -227,7 +227,7 @@ int8_t& EdnVectorBuf::Get(int32_t pos)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, EdnVectorBin<int8_t> &tmpBuffer)
|
void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, Edn::VectorType<int8_t> &tmpBuffer)
|
||||||
{
|
{
|
||||||
tmpBuffer.Clear();
|
tmpBuffer.Clear();
|
||||||
if (pos < m_gapStart) {
|
if (pos < m_gapStart) {
|
||||||
@ -399,7 +399,7 @@ void EdnVectorBuf::Insert(int32_t pos, const int8_t& item)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void EdnVectorBuf::Insert(int32_t pos, EdnVectorBin<int8_t>& items)
|
void EdnVectorBuf::Insert(int32_t pos, Edn::VectorType<int8_t>& items)
|
||||||
{
|
{
|
||||||
if( pos > Size()
|
if( pos > Size()
|
||||||
|| pos < 0 ) {
|
|| pos < 0 ) {
|
||||||
@ -455,7 +455,7 @@ void EdnVectorBuf::Replace(int32_t pos, const int8_t& item)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, EdnVectorBin<int8_t>& items)
|
void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, Edn::VectorType<int8_t>& items)
|
||||||
{
|
{
|
||||||
if( pos > Size()
|
if( pos > Size()
|
||||||
|| pos < 0 ) {
|
|| pos < 0 ) {
|
||||||
@ -652,7 +652,7 @@ void TestEdnVectorBuf(void)
|
|||||||
myBufferTmp.Display();
|
myBufferTmp.Display();
|
||||||
plop='m';
|
plop='m';
|
||||||
|
|
||||||
EdnVectorBin<int8_t> items;
|
Edn::VectorType<int8_t> items;
|
||||||
items.PushBack('i');
|
items.PushBack('i');
|
||||||
items.PushBack('j');
|
items.PushBack('j');
|
||||||
items.PushBack('k');
|
items.PushBack('k');
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define __EDN_VECTOR_BUF_H__
|
#define __EDN_VECTOR_BUF_H__
|
||||||
|
|
||||||
#include "toolsMemory.h"
|
#include "toolsMemory.h"
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "EdnVectorBuf"
|
#define __class__ "EdnVectorBuf"
|
||||||
@ -272,14 +272,14 @@ class EdnVectorBuf
|
|||||||
EdnVectorBuf & operator=( const EdnVectorBuf & Evb);
|
EdnVectorBuf & operator=( const EdnVectorBuf & Evb);
|
||||||
int8_t operator[] (int32_t pos);
|
int8_t operator[] (int32_t pos);
|
||||||
int8_t & Get( int32_t pos);
|
int8_t & Get( int32_t pos);
|
||||||
void Get( int32_t pos, int32_t nbElement, EdnVectorBin<int8_t> &tmpBuffer);
|
void Get( int32_t pos, int32_t nbElement, Edn::VectorType<int8_t> &tmpBuffer);
|
||||||
// insert functions
|
// insert functions
|
||||||
void PushBack( const int8_t& item);
|
void PushBack( const int8_t& item);
|
||||||
void Insert( int32_t pos, const int8_t& item);
|
void Insert( int32_t pos, const int8_t& item);
|
||||||
void Insert( int32_t pos, EdnVectorBin<int8_t>& items);
|
void Insert( int32_t pos, Edn::VectorType<int8_t>& items);
|
||||||
// Remove and insert functions
|
// Remove and insert functions
|
||||||
void Replace( int32_t pos, const int8_t& item);
|
void Replace( int32_t pos, const int8_t& item);
|
||||||
void Replace( int32_t pos, int32_t nbRemoveElement, EdnVectorBin<int8_t>& items);
|
void Replace( int32_t pos, int32_t nbRemoveElement, Edn::VectorType<int8_t>& items);
|
||||||
// Revove fonctions
|
// Revove fonctions
|
||||||
void Remove( int32_t pos, int32_t nbRemoveElement = 1);
|
void Remove( int32_t pos, int32_t nbRemoveElement = 1);
|
||||||
void PopBack( void);
|
void PopBack( void);
|
||||||
|
@ -188,9 +188,9 @@ class MsgBroadcastCore: public Singleton<MsgBroadcastCore>
|
|||||||
void RmReceiver(MsgBroadcast * pointerOnReceiver);
|
void RmReceiver(MsgBroadcast * pointerOnReceiver);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EdnVectorBin<MsgBroadcast*> m_listMessage;
|
Edn::VectorType<MsgBroadcast*> m_listMessage;
|
||||||
uint32_t m_messageID;
|
uint32_t m_messageID;
|
||||||
EdnVectorBin<messageElement_ts> m_listOfMessage;
|
Edn::VectorType<messageElement_ts> m_listOfMessage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "tools_debug.h"
|
#include "tools_debug.h"
|
||||||
#include "toolsMemory.h"
|
#include "toolsMemory.h"
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
|
|
||||||
|
|
||||||
#include "String.h"
|
#include "String.h"
|
||||||
|
@ -92,7 +92,7 @@ const int32_t constConvertionTableSize = sizeof(constConvertionTable) / sizeof(c
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void DisplayData(EdnVectorBin<char> &data)
|
void DisplayData(Edn::VectorType<char> &data)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<(int32_t)data.Size() ; i++) {
|
for (i=0; i<(int32_t)data.Size() ; i++) {
|
||||||
@ -110,7 +110,7 @@ void DisplayData(EdnVectorBin<char> &data)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void DisplayElem(EdnVectorBin<int16_t> &data, int32_t start, int32_t stop)
|
void DisplayElem(Edn::VectorType<int16_t> &data, int32_t start, int32_t stop)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
std::cout<< COLOR_NORMAL;
|
std::cout<< COLOR_NORMAL;
|
||||||
@ -180,7 +180,7 @@ char * levelSpace(int32_t level)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t GetLenOfPTheseElem(EdnVectorBin<int16_t> &data, int32_t startPos)
|
int32_t GetLenOfPTheseElem(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||||
{
|
{
|
||||||
int32_t pos = startPos;
|
int32_t pos = startPos;
|
||||||
int32_t nbOpen = 0;
|
int32_t nbOpen = 0;
|
||||||
@ -229,7 +229,7 @@ int32_t GetLenOfPTheseElem(EdnVectorBin<int16_t> &data, int32_t startPos)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t GetLenOfPThese(EdnVectorBin<int16_t> &data, int32_t startPos)
|
int32_t GetLenOfPThese(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||||
{
|
{
|
||||||
int32_t pos = startPos;
|
int32_t pos = startPos;
|
||||||
int32_t nbOpen = 0;
|
int32_t nbOpen = 0;
|
||||||
@ -282,7 +282,7 @@ int32_t GetLenOfPThese(EdnVectorBin<int16_t> &data, int32_t startPos)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t GetLenOfBracket(EdnVectorBin<int16_t> &data, int32_t startPos)
|
int32_t GetLenOfBracket(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||||
{
|
{
|
||||||
int32_t pos = startPos;
|
int32_t pos = startPos;
|
||||||
// special case of the (...) or | ==> we search '|' or ')'
|
// special case of the (...) or | ==> we search '|' or ')'
|
||||||
@ -326,7 +326,7 @@ int32_t GetLenOfBracket(EdnVectorBin<int16_t> &data, int32_t startPos)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t GetLenOfBrace(EdnVectorBin<int16_t> &data, int32_t startPos)
|
int32_t GetLenOfBrace(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||||
{
|
{
|
||||||
int32_t pos = startPos;
|
int32_t pos = startPos;
|
||||||
// special case of the (...) or | ==> we search '|' or ')'
|
// special case of the (...) or | ==> we search '|' or ')'
|
||||||
@ -370,7 +370,7 @@ int32_t GetLenOfBrace(EdnVectorBin<int16_t> &data, int32_t startPos)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t GetLenOfNormal(EdnVectorBin<int16_t> &data, int32_t startPos)
|
int32_t GetLenOfNormal(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||||
{
|
{
|
||||||
int32_t pos = startPos;
|
int32_t pos = startPos;
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ int32_t GetLenOfNormal(EdnVectorBin<int16_t> &data, int32_t startPos)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool ParseBrace(EdnVectorBin<int16_t> &data, int32_t &min, int32_t &max)
|
bool ParseBrace(Edn::VectorType<int16_t> &data, int32_t &min, int32_t &max)
|
||||||
{
|
{
|
||||||
//EDN_INFO("parse {...} in "; DisplayElem(data); );
|
//EDN_INFO("parse {...} in "; DisplayElem(data); );
|
||||||
int32_t k=0;
|
int32_t k=0;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __EDN_REG_EXP_H__
|
#ifndef __EDN_REG_EXP_H__
|
||||||
#define __EDN_REG_EXP_H__
|
#define __EDN_REG_EXP_H__
|
||||||
|
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
#include "Edn.h"
|
#include "Edn.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -89,15 +89,15 @@ typedef struct {
|
|||||||
extern const convertionTable_ts constConvertionTable[];
|
extern const convertionTable_ts constConvertionTable[];
|
||||||
extern const int32_t constConvertionTableSize;
|
extern const int32_t constConvertionTableSize;
|
||||||
|
|
||||||
void DisplayData(EdnVectorBin<char> &data);
|
void DisplayData(Edn::VectorType<char> &data);
|
||||||
void DisplayElem(EdnVectorBin<int16_t> &data, int32_t start=0, int32_t stop=0x7FFFFFFF);
|
void DisplayElem(Edn::VectorType<int16_t> &data, int32_t start=0, int32_t stop=0x7FFFFFFF);
|
||||||
char * levelSpace(int32_t level);
|
char * levelSpace(int32_t level);
|
||||||
int32_t GetLenOfPTheseElem(EdnVectorBin<int16_t> &data, int32_t startPos);
|
int32_t GetLenOfPTheseElem(Edn::VectorType<int16_t> &data, int32_t startPos);
|
||||||
int32_t GetLenOfPThese(EdnVectorBin<int16_t> &data, int32_t startPos);
|
int32_t GetLenOfPThese(Edn::VectorType<int16_t> &data, int32_t startPos);
|
||||||
int32_t GetLenOfBracket(EdnVectorBin<int16_t> &data, int32_t startPos);
|
int32_t GetLenOfBracket(Edn::VectorType<int16_t> &data, int32_t startPos);
|
||||||
int32_t GetLenOfBrace(EdnVectorBin<int16_t> &data, int32_t startPos);
|
int32_t GetLenOfBrace(Edn::VectorType<int16_t> &data, int32_t startPos);
|
||||||
int32_t GetLenOfNormal(EdnVectorBin<int16_t> &data, int32_t startPos);
|
int32_t GetLenOfNormal(Edn::VectorType<int16_t> &data, int32_t startPos);
|
||||||
bool ParseBrace(EdnVectorBin<int16_t> &data, int32_t &min, int32_t &max);
|
bool ParseBrace(Edn::VectorType<int16_t> &data, int32_t &min, int32_t &max);
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -134,7 +134,7 @@ template<class CLASS_TYPE> class RegExpNode{
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual int32_t Generate(EdnVectorBin<int16_t> &data, int32_t startPos, int32_t nbElement)
|
virtual int32_t Generate(Edn::VectorType<int16_t> &data, int32_t startPos, int32_t nbElement)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -194,7 +194,7 @@ template<class CLASS_TYPE> class RegExpNode{
|
|||||||
int32_t m_multipleMin; //!< minimum repetition (included)
|
int32_t m_multipleMin; //!< minimum repetition (included)
|
||||||
int32_t m_multipleMax; //!< maximum repetition (included)
|
int32_t m_multipleMax; //!< maximum repetition (included)
|
||||||
// Data Section ... (can have no data...)
|
// Data Section ... (can have no data...)
|
||||||
EdnVectorBin<int16_t> m_RegExpData; //!< data to parse and compare in some case ...
|
Edn::VectorType<int16_t> m_RegExpData; //!< data to parse and compare in some case ...
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -228,7 +228,7 @@ template<class CLASS_TYPE> class RegExpNodeValue : public RegExpNode<CLASS_TYPE>
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int32_t Generate(EdnVectorBin<int16_t> &data)
|
int32_t Generate(Edn::VectorType<int16_t> &data)
|
||||||
{
|
{
|
||||||
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
||||||
//EDN_DEBUG("Request Parse \"Value\" data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
//EDN_DEBUG("Request Parse \"Value\" data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
||||||
@ -298,7 +298,7 @@ template<class CLASS_TYPE> class RegExpNodeValue : public RegExpNode<CLASS_TYPE>
|
|||||||
};
|
};
|
||||||
protected :
|
protected :
|
||||||
// SubNodes :
|
// SubNodes :
|
||||||
EdnVectorBin<char> m_data;
|
Edn::VectorType<char> m_data;
|
||||||
};
|
};
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "RegExpNodeBracket"
|
#define __class__ "RegExpNodeBracket"
|
||||||
@ -331,7 +331,7 @@ template<class CLASS_TYPE> class RegExpNodeBracket : public RegExpNode<CLASS_TYP
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int32_t Generate(EdnVectorBin<int16_t> &data)
|
int32_t Generate(Edn::VectorType<int16_t> &data)
|
||||||
{
|
{
|
||||||
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
||||||
//EDN_DEBUG("Request Parse [...] data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
//EDN_DEBUG("Request Parse [...] data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
||||||
@ -416,7 +416,7 @@ template<class CLASS_TYPE> class RegExpNodeBracket : public RegExpNode<CLASS_TYP
|
|||||||
};
|
};
|
||||||
protected :
|
protected :
|
||||||
// SubNodes :
|
// SubNodes :
|
||||||
EdnVectorBin<char> m_data;
|
Edn::VectorType<char> m_data;
|
||||||
};
|
};
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "RegExpNodeDigit"
|
#define __class__ "RegExpNodeDigit"
|
||||||
@ -1206,14 +1206,14 @@ template<class CLASS_TYPE> class RegExpNodePTheseElem : public RegExpNode<CLASS_
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int32_t Generate(EdnVectorBin<int16_t> &data)
|
int32_t Generate(Edn::VectorType<int16_t> &data)
|
||||||
{
|
{
|
||||||
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
||||||
//EDN_DEBUG("Request Parse (elem) data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
//EDN_DEBUG("Request Parse (elem) data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
||||||
|
|
||||||
int32_t pos = 0;
|
int32_t pos = 0;
|
||||||
int32_t elementSize = 0;
|
int32_t elementSize = 0;
|
||||||
EdnVectorBin<int16_t> tmpData;
|
Edn::VectorType<int16_t> tmpData;
|
||||||
while (pos < RegExpNode<CLASS_TYPE>::m_RegExpData.Size()) {
|
while (pos < RegExpNode<CLASS_TYPE>::m_RegExpData.Size()) {
|
||||||
tmpData.Clear();
|
tmpData.Clear();
|
||||||
switch (RegExpNode<CLASS_TYPE>::m_RegExpData[pos])
|
switch (RegExpNode<CLASS_TYPE>::m_RegExpData[pos])
|
||||||
@ -1399,7 +1399,7 @@ template<class CLASS_TYPE> class RegExpNodePTheseElem : public RegExpNode<CLASS_
|
|||||||
};
|
};
|
||||||
protected :
|
protected :
|
||||||
// SubNodes :
|
// SubNodes :
|
||||||
EdnVectorBin<RegExpNode<CLASS_TYPE>*> m_subNode;
|
Edn::VectorType<RegExpNode<CLASS_TYPE>*> m_subNode;
|
||||||
private :
|
private :
|
||||||
/**
|
/**
|
||||||
* @brief Set the number of repeate time on a the last node in the list ...
|
* @brief Set the number of repeate time on a the last node in the list ...
|
||||||
@ -1456,7 +1456,7 @@ template<class CLASS_TYPE> class RegExpNodePThese : public RegExpNode<CLASS_TYPE
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int32_t Generate(EdnVectorBin<int16_t> &data)
|
int32_t Generate(Edn::VectorType<int16_t> &data)
|
||||||
{
|
{
|
||||||
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
RegExpNode<CLASS_TYPE>::m_RegExpData = data;
|
||||||
//EDN_DEBUG("Request Parse (...) data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
//EDN_DEBUG("Request Parse (...) data="; DisplayElem(RegExpNode<CLASS_TYPE>::m_RegExpData););
|
||||||
@ -1466,7 +1466,7 @@ template<class CLASS_TYPE> class RegExpNodePThese : public RegExpNode<CLASS_TYPE
|
|||||||
// generate all the "elemTypePTheseElem" of the Node
|
// generate all the "elemTypePTheseElem" of the Node
|
||||||
while (elementSize>0) {
|
while (elementSize>0) {
|
||||||
// geerate output deta ...
|
// geerate output deta ...
|
||||||
EdnVectorBin<int16_t> tmpData;
|
Edn::VectorType<int16_t> tmpData;
|
||||||
for (int32_t k=pos; k<pos+elementSize; k++) {
|
for (int32_t k=pos; k<pos+elementSize; k++) {
|
||||||
tmpData.PushBack(RegExpNode<CLASS_TYPE>::m_RegExpData[k]);
|
tmpData.PushBack(RegExpNode<CLASS_TYPE>::m_RegExpData[k]);
|
||||||
}
|
}
|
||||||
@ -1542,7 +1542,7 @@ template<class CLASS_TYPE> class RegExpNodePThese : public RegExpNode<CLASS_TYPE
|
|||||||
|
|
||||||
protected :
|
protected :
|
||||||
// SubNodes :
|
// SubNodes :
|
||||||
EdnVectorBin<RegExpNode<CLASS_TYPE>*> m_subNode;
|
Edn::VectorType<RegExpNode<CLASS_TYPE>*> m_subNode;
|
||||||
//int32_t m_posPthese; //!< position of the element is detected in the output element
|
//int32_t m_posPthese; //!< position of the element is detected in the output element
|
||||||
};
|
};
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -1629,7 +1629,7 @@ template<class CLASS_TYPE> class EdnRegExp {
|
|||||||
void SetRegExp(Edn::String &expressionRequested)
|
void SetRegExp(Edn::String &expressionRequested)
|
||||||
{
|
{
|
||||||
m_expressionRequested = expressionRequested; // TODO : Must be deprecated ...
|
m_expressionRequested = expressionRequested; // TODO : Must be deprecated ...
|
||||||
EdnVectorBin<int16_t> tmpExp;
|
Edn::VectorType<int16_t> tmpExp;
|
||||||
|
|
||||||
//EDN_DEBUG("Parse RegExp : " << expressionRequested.c_str() );
|
//EDN_DEBUG("Parse RegExp : " << expressionRequested.c_str() );
|
||||||
m_isOk = false;
|
m_isOk = false;
|
||||||
@ -1905,7 +1905,7 @@ template<class CLASS_TYPE> class EdnRegExp {
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool CheckGoodPosition(EdnVectorBin<int16_t> tmpExp, int32_t &pos)
|
bool CheckGoodPosition(Edn::VectorType<int16_t> tmpExp, int32_t &pos)
|
||||||
{
|
{
|
||||||
int16_t curentCode = tmpExp[pos];
|
int16_t curentCode = tmpExp[pos];
|
||||||
int16_t endCode = OPCODE_PTHESE_OUT;
|
int16_t endCode = OPCODE_PTHESE_OUT;
|
||||||
@ -2010,7 +2010,7 @@ template<class CLASS_TYPE> class EdnRegExp {
|
|||||||
* @param[in,out]
|
* @param[in,out]
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool CheckGoodPosition(EdnVectorBin<int16_t> tmpExp)
|
bool CheckGoodPosition(Edn::VectorType<int16_t> tmpExp)
|
||||||
{
|
{
|
||||||
int32_t pos = 0;
|
int32_t pos = 0;
|
||||||
while (pos < (int32_t)tmpExp.Size()) {
|
while (pos < (int32_t)tmpExp.Size()) {
|
||||||
|
@ -205,7 +205,7 @@ const Edn::String& Edn::String::operator= (const char * inputData)
|
|||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const Edn::String& Edn::String::operator= (EdnVectorBin<int8_t> inputData)
|
const Edn::String& Edn::String::operator= (Edn::VectorType<int8_t> inputData)
|
||||||
{
|
{
|
||||||
m_data = inputData;
|
m_data = inputData;
|
||||||
if (m_data.Size()>0) {
|
if (m_data.Size()>0) {
|
||||||
@ -569,9 +569,9 @@ Edn::String Edn::String::Extract(int32_t posStart, int32_t posEnd)
|
|||||||
* @return The desired vector with data
|
* @return The desired vector with data
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EdnVectorBin<int8_t> Edn::String::GetVector(void)
|
Edn::VectorType<int8_t> Edn::String::GetVector(void)
|
||||||
{
|
{
|
||||||
EdnVectorBin<int8_t> out = m_data;
|
Edn::VectorType<int8_t> out = m_data;
|
||||||
out.PopBack();
|
out.PopBack();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -630,7 +630,7 @@ void Edn::TestUntaire_String(void)
|
|||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
||||||
s1 = "test direct 44";
|
s1 = "test direct 44";
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
||||||
EdnVectorBin<int8_t> vb1;
|
Edn::VectorType<int8_t> vb1;
|
||||||
vb1.PushBack('v');
|
vb1.PushBack('v');
|
||||||
vb1.PushBack('b');
|
vb1.PushBack('b');
|
||||||
vb1.PushBack('1');
|
vb1.PushBack('1');
|
||||||
|
@ -45,18 +45,17 @@ namespace Edn
|
|||||||
|
|
||||||
const Edn::String& operator= (const Edn::String &ednS ); // assigment
|
const Edn::String& operator= (const Edn::String &ednS ); // assigment
|
||||||
const Edn::String& operator= (const char * inputData);
|
const Edn::String& operator= (const char * inputData);
|
||||||
const Edn::String& operator= (EdnVectorBin<int8_t> inputData);
|
const Edn::String& operator= (Edn::VectorType<int8_t> inputData);
|
||||||
bool operator== (const Edn::String& ednS) const; // == operator
|
bool operator== (const Edn::String& ednS) const; // == operator
|
||||||
bool operator== (const char * inputData) const;
|
bool operator== (const char * inputData) const;
|
||||||
bool operator!= (const Edn::String& ednS) const; // != operator
|
bool operator!= (const Edn::String& ednS) const; // != operator
|
||||||
bool operator!= (const char * inputData) const;
|
bool operator!= (const char * inputData) const;
|
||||||
const Edn::String& operator+= (const Edn::String &ednS); // += operator
|
const Edn::String& operator+= (const Edn::String &ednS); // += operator
|
||||||
const Edn::String& operator+= (const char * inputData);
|
const Edn::String& operator+= (const char * inputData);
|
||||||
Edn::String operator+ (const Edn::String &ednS); // + operator
|
Edn::String operator+ (const Edn::String &ednS); // + operator
|
||||||
Edn::String operator+ (const char * inputData);
|
Edn::String operator+ (const char * inputData);
|
||||||
//operator const char *()
|
//operator const char *()
|
||||||
|
|
||||||
|
|
||||||
bool IsEmpty(void) const;
|
bool IsEmpty(void) const;
|
||||||
int32_t Size(void) const;
|
int32_t Size(void) const;
|
||||||
|
|
||||||
@ -64,7 +63,7 @@ namespace Edn
|
|||||||
void Remove(int32_t currentID, int32_t len);
|
void Remove(int32_t currentID, int32_t len);
|
||||||
void Clear(void);
|
void Clear(void);
|
||||||
|
|
||||||
EdnVectorBin<int8_t> GetVector(void);
|
Edn::VectorType<int8_t> GetVector(void);
|
||||||
char * c_str(void) { return (char*)&m_data[0]; };
|
char * c_str(void) { return (char*)&m_data[0]; };
|
||||||
|
|
||||||
// Sting operation :
|
// Sting operation :
|
||||||
@ -73,7 +72,7 @@ namespace Edn
|
|||||||
Edn::String Extract(int32_t posStart=0, int32_t posEnd=0x7FFFFFFF);
|
Edn::String Extract(int32_t posStart=0, int32_t posEnd=0x7FFFFFFF);
|
||||||
|
|
||||||
private :
|
private :
|
||||||
EdnVectorBin<int8_t> m_data;
|
Edn::VectorType<int8_t> m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
void TestUntaire_String(void);
|
void TestUntaire_String(void);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file EdnEdnVectorBin.h
|
* @file VectorType.h
|
||||||
* @brief Editeur De N'ours : Basic EdnVectorBin for direct data insertion (template)
|
* @brief Editeur De N'ours : Basic VectorType for direct data insertion (template)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 07/04/2011
|
* @date 07/04/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
@ -29,10 +29,10 @@
|
|||||||
#include "toolsMemory.h"
|
#include "toolsMemory.h"
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "EdnEdnVectorBin"
|
#define __class__ "Edn::VectorType"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief EdnVectorBin classes ...
|
* @brief VectorType classes ...
|
||||||
*
|
*
|
||||||
* @tparam[in] SIZE Size of the current element.
|
* @tparam[in] SIZE Size of the current element.
|
||||||
*
|
*
|
||||||
@ -65,22 +65,26 @@
|
|||||||
* ----------------------------------------
|
* ----------------------------------------
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|
||||||
|
namespace Edn
|
||||||
|
{
|
||||||
|
|
||||||
|
template<typename MY_TYPE=int32_t> class VectorType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class Iterator
|
class Iterator
|
||||||
{
|
{
|
||||||
// Private data :
|
// Private data :
|
||||||
private:
|
private:
|
||||||
int32_t m_current; // curent Id on the vector
|
int32_t m_current; //!< curent Id on the vector
|
||||||
EdnVectorBin<MY_TYPE> * m_EdnVectorBin; // Pointer on the curent element of the vectorBin
|
VectorType<MY_TYPE> * m_VectorType; //!< Pointer on the curent element of the vectorBin
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Basic itarator constructor with no link with an EdnVector
|
* @brief Basic itarator constructor with no link with an EdnVector
|
||||||
*/
|
*/
|
||||||
Iterator():
|
Iterator():
|
||||||
m_current(-1),
|
m_current(-1),
|
||||||
m_EdnVectorBin(NULL)
|
m_VectorType(NULL)
|
||||||
{
|
{
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
}
|
}
|
||||||
@ -90,7 +94,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
*/
|
*/
|
||||||
Iterator(const Iterator & otherIterator):
|
Iterator(const Iterator & otherIterator):
|
||||||
m_current(otherIterator.m_current),
|
m_current(otherIterator.m_current),
|
||||||
m_EdnVectorBin(otherIterator.m_EdnVectorBin)
|
m_VectorType(otherIterator.m_VectorType)
|
||||||
{
|
{
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
}
|
}
|
||||||
@ -102,7 +106,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
Iterator& operator=(const Iterator & otherIterator)
|
Iterator& operator=(const Iterator & otherIterator)
|
||||||
{
|
{
|
||||||
m_current = otherIterator.m_current;
|
m_current = otherIterator.m_current;
|
||||||
m_EdnVectorBin = otherIterator.m_EdnVectorBin;
|
m_VectorType = otherIterator.m_VectorType;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -111,7 +115,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
~Iterator()
|
~Iterator()
|
||||||
{
|
{
|
||||||
m_current = -1;
|
m_current = -1;
|
||||||
m_EdnVectorBin = NULL;
|
m_VectorType = NULL;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief basic boolean cast
|
* @brief basic boolean cast
|
||||||
@ -120,7 +124,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
operator bool ()
|
operator bool ()
|
||||||
{
|
{
|
||||||
if( 0 <= m_current
|
if( 0 <= m_current
|
||||||
&& m_current < m_EdnVectorBin->Size() )
|
&& m_current < m_VectorType->Size() )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -133,8 +137,8 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
*/
|
*/
|
||||||
Iterator& operator++ ()
|
Iterator& operator++ ()
|
||||||
{
|
{
|
||||||
if( NULL != m_EdnVectorBin
|
if( NULL != m_VectorType
|
||||||
&& m_current < m_EdnVectorBin->Size() )
|
&& m_current < m_VectorType->Size() )
|
||||||
{
|
{
|
||||||
m_current++;
|
m_current++;
|
||||||
}
|
}
|
||||||
@ -177,8 +181,8 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
*/
|
*/
|
||||||
MY_TYPE & operator-> () const
|
MY_TYPE & operator-> () const
|
||||||
{
|
{
|
||||||
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBin->Size());
|
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_VectorType->Size());
|
||||||
return &m_EdnVectorBin->Get(m_current);
|
return &m_VectorType->Get(m_current);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Get reference on the current Element
|
* @brief Get reference on the current Element
|
||||||
@ -186,8 +190,8 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
*/
|
*/
|
||||||
MY_TYPE & operator* () const
|
MY_TYPE & operator* () const
|
||||||
{
|
{
|
||||||
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBin->Size());
|
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_VectorType->Size());
|
||||||
return m_EdnVectorBin->Get(m_current);
|
return m_VectorType->Get(m_current);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
@ -198,26 +202,26 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Iterator(EdnVectorBin<MY_TYPE> * Evb, int32_t pos):
|
Iterator(VectorType<MY_TYPE> * Evb, int32_t pos):
|
||||||
m_current(pos),
|
m_current(pos),
|
||||||
m_EdnVectorBin(Evb)
|
m_VectorType(Evb)
|
||||||
{
|
{
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
}
|
}
|
||||||
friend class EdnVectorBin;
|
friend class VectorType;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MY_TYPE * m_data; //!< pointer on the curetn table of Data
|
MY_TYPE * m_data; //!< pointer on the curetn table of Data
|
||||||
int32_t m_size; //!< nb Element in the buffer
|
int32_t m_size; //!< nb Element in the buffer
|
||||||
int32_t m_allocated; //!< Current allocated size
|
int32_t m_allocated; //!< Current allocated size
|
||||||
int32_t m_increment; //!< methode of increment
|
int32_t m_increment; //!< methode of increment
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create an empty vector
|
* @brief Create an empty vector
|
||||||
* @param[in] count Minimum request size of the Buffer
|
* @param[in] count Minimum request size of the Buffer
|
||||||
*/
|
*/
|
||||||
EdnVectorBin(int32_t count = 0):
|
VectorType(int32_t count = 0):
|
||||||
m_data(NULL),
|
m_data(NULL),
|
||||||
m_size(0),
|
m_size(0),
|
||||||
m_allocated(0),
|
m_allocated(0),
|
||||||
@ -230,12 +234,12 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
* @brief Re-copy constructor (copy all needed data)
|
* @brief Re-copy constructor (copy all needed data)
|
||||||
* @param[in] Evb Vector that might be copy
|
* @param[in] Evb Vector that might be copy
|
||||||
*/
|
*/
|
||||||
EdnVectorBin(const EdnVectorBin<MY_TYPE> & Evb)
|
VectorType(const Edn::VectorType<MY_TYPE> & Evb)
|
||||||
{
|
{
|
||||||
m_allocated = Evb.m_allocated;
|
m_allocated = Evb.m_allocated;
|
||||||
m_size = Evb.m_size;
|
m_size = Evb.m_size;
|
||||||
m_increment = Evb.m_increment;
|
m_increment = Evb.m_increment;
|
||||||
m_data = NULL;
|
m_data = NULL;
|
||||||
//EDN_DEBUG("USE Specific vector allocator ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
|
//EDN_DEBUG("USE Specific vector allocator ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
|
||||||
// allocate all same data
|
// allocate all same data
|
||||||
EDN_MALLOC(m_data, m_allocated, MY_TYPE);
|
EDN_MALLOC(m_data, m_allocated, MY_TYPE);
|
||||||
@ -247,7 +251,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
/**
|
/**
|
||||||
* @brief Destructor of the current Class
|
* @brief Destructor of the current Class
|
||||||
*/
|
*/
|
||||||
~EdnVectorBin()
|
~VectorType()
|
||||||
{
|
{
|
||||||
if (NULL!=m_data) {
|
if (NULL!=m_data) {
|
||||||
EDN_FREE(m_data);
|
EDN_FREE(m_data);
|
||||||
@ -263,7 +267,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
* @param[in] Evb Vector that might be copy
|
* @param[in] Evb Vector that might be copy
|
||||||
* @return reference on the curent re-copy vector
|
* @return reference on the curent re-copy vector
|
||||||
*/
|
*/
|
||||||
EdnVectorBin& operator=(const EdnVectorBin<MY_TYPE> & Evb)
|
VectorType& operator=(const Edn::VectorType<MY_TYPE> & Evb)
|
||||||
{
|
{
|
||||||
//EDN_DEBUG("USE RECOPY vector ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
|
//EDN_DEBUG("USE RECOPY vector ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
|
||||||
if( this != &Evb ) // avoid copy to itself
|
if( this != &Evb ) // avoid copy to itself
|
||||||
@ -290,7 +294,7 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
* @brief Add at the Last position of the Vector
|
* @brief Add at the Last position of the Vector
|
||||||
* @param[in] item Element to add at the end of vector
|
* @param[in] item Element to add at the end of vector
|
||||||
*/
|
*/
|
||||||
EdnVectorBin& operator+= (const EdnVectorBin<MY_TYPE> & Evb) // += operator
|
VectorType& operator+= (const Edn::VectorType<MY_TYPE> & Evb) // += operator
|
||||||
{
|
{
|
||||||
int32_t nbElememt = Evb.Size();
|
int32_t nbElememt = Evb.Size();
|
||||||
int32_t idx = m_size;
|
int32_t idx = m_size;
|
||||||
@ -502,9 +506,9 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
* @param[in] posEnd End position to extract data
|
* @param[in] posEnd End position to extract data
|
||||||
* @return the extracted vector
|
* @return the extracted vector
|
||||||
*/
|
*/
|
||||||
EdnVectorBin Extract(int32_t posStart = 0, int32_t posEnd=0x7FFFFFFF)
|
VectorType Extract(int32_t posStart = 0, int32_t posEnd=0x7FFFFFFF)
|
||||||
{
|
{
|
||||||
EdnVectorBin<MY_TYPE> out;
|
VectorType<MY_TYPE> out;
|
||||||
if (posStart < 0) {
|
if (posStart < 0) {
|
||||||
posStart = 0;
|
posStart = 0;
|
||||||
} else if (posStart >= Size() ) {
|
} else if (posStart >= Size() ) {
|
||||||
@ -633,8 +637,8 @@ template<typename MY_TYPE=int32_t> class EdnVectorBin
|
|||||||
// set the new allocation size
|
// set the new allocation size
|
||||||
m_allocated = requestSize;
|
m_allocated = requestSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ NULL
|
#define __class__ NULL
|
@ -101,14 +101,14 @@ void convertUnicodeToIso(charset_te inputCharset, int32_t input_Unicode, char &
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t convertIsoToUnicode(charset_te inputCharset, EdnVectorBin<char>& input_ISO, EdnVectorBin<int32_t>& output_Unicode)
|
int32_t convertIsoToUnicode(charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<int32_t>& output_Unicode)
|
||||||
{
|
{
|
||||||
EDN_WARNING("TODO : not coded...");
|
EDN_WARNING("TODO : not coded...");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t convertUnicodeToIso(charset_te inputCharset, EdnVectorBin<int32_t>& input_Unicode, EdnVectorBin<char>& output_ISO)
|
int32_t convertUnicodeToIso(charset_te inputCharset, Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_ISO)
|
||||||
{
|
{
|
||||||
EDN_WARNING("TODO : not coded...");
|
EDN_WARNING("TODO : not coded...");
|
||||||
return 0;
|
return 0;
|
||||||
@ -204,14 +204,14 @@ void convertUtf8ToUnicode(char * input_UTF8, int32_t &output_Unicode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t convertUnicodeToUtf8(EdnVectorBin<int32_t>& input_Unicode, EdnVectorBin<char>& output_UTF8)
|
int32_t convertUnicodeToUtf8(Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_UTF8)
|
||||||
{
|
{
|
||||||
EDN_WARNING("TODO : not coded...");
|
EDN_WARNING("TODO : not coded...");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t convertUtf8ToUnicode(EdnVectorBin<char>& input_UTF8, EdnVectorBin<int32_t>& output_Unicode)
|
int32_t convertUtf8ToUnicode(Edn::VectorType<char>& input_UTF8, Edn::VectorType<int32_t>& output_Unicode)
|
||||||
{
|
{
|
||||||
EDN_WARNING("TODO : not coded...");
|
EDN_WARNING("TODO : not coded...");
|
||||||
return 0;
|
return 0;
|
||||||
@ -239,14 +239,14 @@ void convertUtf8ToIso(charset_te inputCharset, char * input_UTF8, char & output
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t convertIsoToUtf8(charset_te inputCharset, EdnVectorBin<char>& input_ISO, EdnVectorBin<char>& output_UTF8)
|
int32_t convertIsoToUtf8(charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<char>& output_UTF8)
|
||||||
{
|
{
|
||||||
EDN_WARNING("TODO : not coded...");
|
EDN_WARNING("TODO : not coded...");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t convertUtf8ToIso(charset_te inputCharset, EdnVectorBin<char>& input_UTF8, EdnVectorBin<char>& output_ISO)
|
int32_t convertUtf8ToIso(charset_te inputCharset, Edn::VectorType<char>& input_UTF8, Edn::VectorType<char>& output_ISO)
|
||||||
{
|
{
|
||||||
EDN_WARNING("TODO : not coded...");
|
EDN_WARNING("TODO : not coded...");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#ifndef __CHARSET_H__
|
#ifndef __CHARSET_H__
|
||||||
#define __CHARSET_H__
|
#define __CHARSET_H__
|
||||||
|
|
||||||
#include "EdnVectorBin.h"
|
#include "VectorType.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EDN_CHARSET_UTF8,
|
EDN_CHARSET_UTF8,
|
||||||
@ -49,18 +49,18 @@ typedef enum {
|
|||||||
// transform ISO <==> Unicode
|
// transform ISO <==> Unicode
|
||||||
void convertIsoToUnicode(charset_te inputCharset, char input_ISO, int32_t & output_Unicode);
|
void convertIsoToUnicode(charset_te inputCharset, char input_ISO, int32_t & output_Unicode);
|
||||||
void convertUnicodeToIso(charset_te inputCharset, int32_t input_Unicode, char & output_ISO);
|
void convertUnicodeToIso(charset_te inputCharset, int32_t input_Unicode, char & output_ISO);
|
||||||
int32_t convertIsoToUnicode(charset_te inputCharset, EdnVectorBin<char>& input_ISO, EdnVectorBin<int32_t>& output_Unicode);
|
int32_t convertIsoToUnicode(charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<int32_t>& output_Unicode);
|
||||||
int32_t convertUnicodeToIso(charset_te inputCharset, EdnVectorBin<int32_t>& input_Unicode, EdnVectorBin<char>& output_ISO);
|
int32_t convertUnicodeToIso(charset_te inputCharset, Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_ISO);
|
||||||
// Transform UTF-8 <==> Unicode
|
// Transform UTF-8 <==> Unicode
|
||||||
void convertUnicodeToUtf8( int32_t input_Unicode, char * output_UTF8);
|
void convertUnicodeToUtf8( int32_t input_Unicode, char * output_UTF8);
|
||||||
void convertUtf8ToUnicode( char * input_UTF8, int32_t& output_Unicode);
|
void convertUtf8ToUnicode( char * input_UTF8, int32_t& output_Unicode);
|
||||||
int32_t convertUnicodeToUtf8( EdnVectorBin<int32_t>& input_Unicode, EdnVectorBin<char>& output_UTF8);
|
int32_t convertUnicodeToUtf8( Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_UTF8);
|
||||||
int32_t convertUtf8ToUnicode( EdnVectorBin<char>& input_UTF8, EdnVectorBin<int32_t>& output_Unicode);
|
int32_t convertUtf8ToUnicode( Edn::VectorType<char>& input_UTF8, Edn::VectorType<int32_t>& output_Unicode);
|
||||||
// Transform ISO <==> UTF-8
|
// Transform ISO <==> UTF-8
|
||||||
void convertIsoToUtf8( charset_te inputCharset, char input_ISO, char * output_UTF8);
|
void convertIsoToUtf8( charset_te inputCharset, char input_ISO, char * output_UTF8);
|
||||||
void convertUtf8ToIso( charset_te inputCharset, char * input_UTF8, char & output_ISO);
|
void convertUtf8ToIso( charset_te inputCharset, char * input_UTF8, char & output_ISO);
|
||||||
int32_t convertIsoToUtf8( charset_te inputCharset, EdnVectorBin<char>& input_ISO, EdnVectorBin<char>& output_UTF8);
|
int32_t convertIsoToUtf8( charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<char>& output_UTF8);
|
||||||
int32_t convertUtf8ToIso( charset_te inputCharset, EdnVectorBin<char>& input_UTF8, EdnVectorBin<char>& output_ISO);
|
int32_t convertUtf8ToIso( charset_te inputCharset, Edn::VectorType<char>& input_UTF8, Edn::VectorType<char>& output_ISO);
|
||||||
|
|
||||||
void Utf8_SizeElement(const char * data, int32_t lenMax , uint8_t &size, bool &baseValid);
|
void Utf8_SizeElement(const char * data, int32_t lenMax , uint8_t &size, bool &baseValid);
|
||||||
int32_t strUtf8Len(const char *input_UTF8);
|
int32_t strUtf8Len(const char *input_UTF8);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user