From a20f3e4063222442b0556738d499b2380f2f9479 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Thu, 9 Aug 2012 14:26:30 +0200 Subject: [PATCH] Revert "STANDARD ==> remove vector type and replace with std::vector (done but sone assertion)" ==> bad idea This reverts commit 4012d75279df3f5226373a9d33a1df1372db71d5. --- jni/Application.mk | 1 - jni/appl/Buffer/BufferManager.cpp | 34 ++--- jni/appl/Buffer/BufferText.cpp | 36 +++-- jni/appl/Buffer/EdnBuf/EdnBuf.cpp | 160 ++++++++++---------- jni/appl/Buffer/EdnBuf/EdnBuf.h | 42 ++--- jni/appl/Buffer/EdnBuf/EdnBufHistory.cpp | 8 +- jni/appl/Buffer/EdnBuf/EdnBufHistory.h | 10 +- jni/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp | 38 ++--- jni/appl/Buffer/EdnBuf/EdnBuf_History.cpp | 16 +- jni/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp | 6 +- jni/appl/Buffer/EdnVectorBuf.cpp | 134 +++++++++++++--- jni/appl/Buffer/EdnVectorBuf.h | 10 +- jni/appl/Colorize/ColorizeManager.cpp | 24 +-- jni/appl/Gui/CodeView.cpp | 12 +- jni/appl/Gui/CodeView.h | 24 +-- jni/appl/Highlight/Highlight.cpp | 50 +++--- jni/appl/Highlight/Highlight.h | 14 +- jni/appl/Highlight/HighlightManager.cpp | 30 ++-- jni/appl/Highlight/HighlightPattern.cpp | 2 +- jni/appl/Highlight/HighlightPattern.h | 24 +-- 20 files changed, 383 insertions(+), 292 deletions(-) delete mode 100644 jni/Application.mk diff --git a/jni/Application.mk b/jni/Application.mk deleted file mode 100644 index dff747c..0000000 --- a/jni/Application.mk +++ /dev/null @@ -1 +0,0 @@ -APP_STL := stlport_static \ No newline at end of file diff --git a/jni/appl/Buffer/BufferManager.cpp b/jni/appl/Buffer/BufferManager.cpp index 772e933..b9fd443 100644 --- a/jni/appl/Buffer/BufferManager.cpp +++ b/jni/appl/Buffer/BufferManager.cpp @@ -80,7 +80,7 @@ class classBufferManager: public ewol::EObject private: - std::vector listBuffer; //!< element List of the char Elements + etk::VectorType listBuffer; //!< element List of the char Elements void RemoveAll(void); //!< remove all buffer int32_t m_idSelected; @@ -125,7 +125,7 @@ classBufferManager::~classBufferManager(void) RemoveAll(); // clear The list of Buffer APPL_INFO("~classBufferManager::listBuffer.Clear();"); - listBuffer.clear(); + listBuffer.Clear(); APPL_INFO("~classBufferManager::delete(BufferNotExiste);"); delete(BufferNotExiste); } @@ -235,7 +235,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch } // try next buffer if (-1 == destBuffer) { - for(int32_t ii=closeID+1; ii < listBuffer.size(); ii++) { + for(int32_t ii=closeID+1; ii < listBuffer.Size(); ii++) { if (true == Exist(ii) ) { destBuffer = ii; break; @@ -305,7 +305,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch void classBufferManager::RemoveAll(void) { int32_t i; - for (i=0; i we open it ... return GetId(myFile); @@ -365,7 +365,7 @@ Buffer * classBufferManager::Get(int32_t BufferID) return BufferNotExiste; } // check if the Buffer existed - if (BufferID < listBuffer.size()) { + if (BufferID < listBuffer.Size()) { // check if the buffer already existed if (NULL != listBuffer[BufferID]) { return listBuffer[BufferID]; @@ -373,7 +373,7 @@ Buffer * classBufferManager::Get(int32_t BufferID) APPL_ERROR("non existing Buffer " << BufferID); } } else { - APPL_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.size()); + APPL_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size()); } return BufferNotExiste; } @@ -385,7 +385,7 @@ bool classBufferManager::Exist(int32_t BufferID) return false; } // check if the Buffer existed - if (BufferID < listBuffer.size()) { + if (BufferID < listBuffer.Size()) { // check if the buffer already existed if (NULL != listBuffer[BufferID]) { return true; @@ -408,7 +408,7 @@ int32_t classBufferManager::GetId(etk::File &myFile) { int32_t iii; // check if the Buffer existed - for (iii=0; iii < listBuffer.size(); iii++) { + for (iii=0; iii < listBuffer.Size(); iii++) { // check if the buffer already existed if (NULL != listBuffer[iii]) { if ( listBuffer[iii]->GetFileName() == myFile) { @@ -423,7 +423,7 @@ int32_t classBufferManager::GetId(etk::File &myFile) // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 uint32_t classBufferManager::Size(void) { - return listBuffer.size(); + return listBuffer.Size(); } // nb of opens file Now ... @@ -431,7 +431,7 @@ uint32_t classBufferManager::SizeOpen(void) { uint32_t jjj = 0; // check if the Buffer existed - for (int32_t iii=0; iii " << listBuffer.size()); + APPL_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size()); return false; } } @@ -491,7 +491,7 @@ bool classBufferManager::Remove(int32_t BufferID) int32_t classBufferManager::WitchBuffer(int32_t iEmeElement) { int32_t i; - for (i=0; i tmpVect; - tmpVect.push_back(0x09); + etk::VectorType tmpVect; + tmpVect.PushBack(0x09); m_EdnBuf.Insert(m_cursorPos, tmpVect); SetInsertPosition(m_cursorPos+1, true); } else { @@ -922,10 +922,10 @@ void BufferText::AddChar(uniChar_t unicodeData) // count the number of line : int32_t nbSelectedLines = m_EdnBuf.CountLines(SelectionStart, SelectionEnd); if (0 == nbSelectedLines) { - std::vector tmpVect; - tmpVect.push_back(0x09); + etk::VectorType tmpVect; + tmpVect.PushBack(0x09); m_EdnBuf.ReplaceSelected(tmpVect); - SetInsertPosition(SelectionStart+tmpVect.size(), true); + SetInsertPosition(SelectionStart+tmpVect.Size(), true); } else { if (true == ewol::IsSetShift() ) { m_cursorPos = m_EdnBuf.UnIndent(); @@ -935,11 +935,11 @@ void BufferText::AddChar(uniChar_t unicodeData) } } } else if (unicodeData == '\n') { - std::vector tmpVect; + etk::VectorType tmpVect; if (true == ewol::IsSetShift()) { - tmpVect.push_back('\r'); + tmpVect.PushBack('\r'); } else { - tmpVect.push_back('\n'); + tmpVect.PushBack('\n'); // if Auto indent Enable ==> we get the start of the previous line and add it to tne new one if (true == globals::IsSetAutoIndent() ) { int32_t l_lineStart; @@ -952,9 +952,9 @@ void BufferText::AddChar(uniChar_t unicodeData) // add same characters in the temporar buffer for (int32_t kk=l_lineStart; kk pos=" << m_cursorPos); @@ -991,11 +991,9 @@ void BufferText::AddChar(uniChar_t unicodeData) if (true == m_EdnBuf.GetUTF8Mode()) { char tmpUTF8[16]; unicode::convertUnicodeToUtf8(unicodeData, tmpUTF8); - std::vector tmpVect; + etk::VectorType tmpVect; int32_t localOfset = strlen(tmpUTF8); - for (int32_t iii=0; iii 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO); - std::vector tmpVect; - tmpVect.push_back(output_ISO); + etk::VectorType tmpVect; + tmpVect.PushBack(output_ISO); if (false == haveSelectionActive) { m_EdnBuf.Insert(m_cursorPos, tmpVect); SetInsertPosition(m_cursorPos+1, true); @@ -1032,7 +1030,7 @@ int32_t BufferText::FindLine(etk::UString &data) return 0; } APPL_INFO("Search data line : \"" << data << "\""); - std::vector mVectSearch; + etk::VectorType mVectSearch; mVectSearch = data.GetVector(); //APPL_INFO("search data Forward : startSearchPos=" << startSearchPos ); /* diff --git a/jni/appl/Buffer/EdnBuf/EdnBuf.cpp b/jni/appl/Buffer/EdnBuf/EdnBuf.cpp index 08122ab..8b4fb5e 100644 --- a/jni/appl/Buffer/EdnBuf/EdnBuf.cpp +++ b/jni/appl/Buffer/EdnBuf/EdnBuf.cpp @@ -119,18 +119,18 @@ bool EdnBuf::DumpFrom(FILE *myFile) } -void EdnBuf::GetAll(std::vector &text) +void EdnBuf::GetAll(etk::VectorType &text) { // Clean output vector - text.clear(); + text.Clear(); // Set data on the vector m_data.Get(0, m_data.Size(), text); } -void EdnBuf::SetAll(std::vector &text) +void EdnBuf::SetAll(etk::VectorType &text) { - std::vector deletedText; + etk::VectorType deletedText; // extract all data of the buffer : GetAll(deletedText); @@ -142,16 +142,16 @@ void EdnBuf::SetAll(std::vector &text) m_data.Insert(0, text); // Zero all of the existing selections - UpdateSelection(0, deletedText.size(), 0); + UpdateSelection(0, deletedText.Size(), 0); // Call the modification Event Manager eventModification(0, m_data.Size(), deletedText); } -void EdnBuf::GetRange(int32_t start, int32_t end, std::vector &output) +void EdnBuf::GetRange(int32_t start, int32_t end, etk::VectorType &output) { // Remove all data ... - output.clear(); + output.Clear(); // import data : m_data.Get(start, end-start, output); //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() ); @@ -162,14 +162,14 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output) // Remove all data ... output = ""; // import data : - std::vector localOutput; + etk::VectorType localOutput; m_data.Get(start, end-start, localOutput); // transcript in UNICODE ... if (true == m_isUtf8) { - localOutput.push_back('\0'); + localOutput.PushBack('\0'); output = (char*)&localOutput[0]; } else { - std::vector tmpUnicodeData; + etk::VectorType tmpUnicodeData; // transform in unicode : convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData); output = tmpUnicodeData; @@ -202,7 +202,7 @@ int8_t EdnBuf::operator[] (int32_t pos) * @return --- * */ -int32_t EdnBuf::Insert(int32_t pos, std::vector &insertText) +int32_t EdnBuf::Insert(int32_t pos, etk::VectorType &insertText) { // if pos is not contiguous to existing text, make it pos = etk_avg(0, pos, m_data.Size() ); @@ -210,8 +210,8 @@ int32_t EdnBuf::Insert(int32_t pos, std::vector &insertText) int32_t sizeInsert=LocalInsert(pos, insertText); // Call the redisplay ... - std::vector deletedText; - eventModification(pos, insertText.size(), deletedText); + etk::VectorType deletedText; + eventModification(pos, insertText.Size(), deletedText); return sizeInsert; } int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText) @@ -222,7 +222,7 @@ int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText) int32_t sizeInsert=LocalInsert(pos, insertText); // Call the redisplay ... - std::vector deletedText; + etk::VectorType deletedText; eventModification(pos, insertText.Size(), deletedText); return sizeInsert; } @@ -237,17 +237,17 @@ int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText) * @return nb Octet inserted * */ -int32_t EdnBuf::Replace(int32_t start, int32_t end, std::vector &insertText) +int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::VectorType &insertText) { if (end-start == 0) { return 0; } - std::vector deletedText; + etk::VectorType deletedText; GetRange(start, end, deletedText); m_data.Replace(start, end-start, insertText); // update internal elements - eventModification(start, insertText.size(), deletedText); - return insertText.size(); + eventModification(start, insertText.Size(), deletedText); + return insertText.Size(); } int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) @@ -255,32 +255,32 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) if (end-start == 0) { return 0; } - std::vector deletedText; + etk::VectorType deletedText; GetRange(start, end, deletedText); - std::vector tmpInsertText; + etk::VectorType tmpInsertText; if (true == m_isUtf8) { char * tmpPointer = insertText.Utf8Data(); while (*tmpPointer != '\0') { - tmpInsertText.push_back(*tmpPointer++); + tmpInsertText.PushBack(*tmpPointer++); } } else { - std::vector tmppp = insertText.GetVector(); + etk::VectorType tmppp = insertText.GetVector(); convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText); } - if (tmpInsertText.size()>0) { - if (tmpInsertText[tmpInsertText.size()-1] == '\0') { - tmpInsertText.pop_back(); + if (tmpInsertText.Size()>0) { + if (tmpInsertText[tmpInsertText.Size()-1] == '\0') { + tmpInsertText.PopBack(); } } - if (tmpInsertText.size()>0) { - if (tmpInsertText[tmpInsertText.size()-1] == '\0') { - tmpInsertText.pop_back(); + if (tmpInsertText.Size()>0) { + if (tmpInsertText[tmpInsertText.Size()-1] == '\0') { + tmpInsertText.PopBack(); } } m_data.Replace(start, end-start, tmpInsertText); // update internal elements - eventModification(start, tmpInsertText.size(), deletedText); - return tmpInsertText.size(); + eventModification(start, tmpInsertText.Size(), deletedText); + return tmpInsertText.Size(); } @@ -296,7 +296,7 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) void EdnBuf::Remove(int32_t start, int32_t end) { - std::vector deletedText; + etk::VectorType deletedText; // Make sure the arguments make sense if (start > end) { int32_t temp = start; @@ -327,26 +327,26 @@ int32_t EdnBuf::Indent(void) // Get Range : int32_t l_start = StartOfLine(SelectionStart); int32_t l_end = EndOfLine(SelectionEnd); - std::vector l_tmpData; + etk::VectorType l_tmpData; GetRange(l_start, l_end, l_tmpData); - l_tmpData.insert(l_tmpData.begin(), '\n'); - for (int32_t i=1; i l_tmpData; + etk::VectorType l_tmpData; GetRange(l_start, l_end, l_tmpData); - l_tmpData.insert(l_tmpData.begin(), '\n'); - for (int32_t i=1; i &text) +void EdnBuf::GetLineText(int32_t pos, etk::VectorType &text) { GetRange( StartOfLine(pos), EndOfLine(pos), text); } @@ -841,12 +841,12 @@ int32_t EdnBuf::CountLines(int32_t startPos, int32_t endPos) * @return number of line found * */ -int32_t EdnBuf::CountLines(std::vector &data) +int32_t EdnBuf::CountLines(etk::VectorType &data) { - std::vector::iterator myPosIt = data.begin(); + etk::VectorType::Iterator myPosIt = data.Begin(); int32_t lineCount = 0; - while(myPosIt < data.end()) { + while(myPosIt) { if ('\n' == *myPosIt) { lineCount++; } @@ -987,20 +987,20 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive) */ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive) { - std::vector searchVect; + etk::VectorType searchVect; if (true == m_isUtf8) { char * tmpPointer = search.Utf8Data(); while (*tmpPointer != '\0') { - searchVect.push_back(*tmpPointer++); + searchVect.PushBack(*tmpPointer++); } } else { - std::vector tmppp = search.GetVector(); + etk::VectorType tmppp = search.GetVector(); convertUnicodeToIso(m_charsetType, tmppp, searchVect); } // remove the '\0' at the end of the string ... - searchVect.pop_back(); + searchVect.PopBack(); int32_t position; - int32_t searchLen = searchVect.size(); + int32_t searchLen = searchVect.Size(); int32_t dataLen = m_data.Size(); char currentChar = '\0'; APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen); @@ -1018,7 +1018,7 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foun } if (true == found) { *foundPos = position; - *foundPosEnd = position + searchVect.size(); + *foundPosEnd = position + searchVect.Size(); return true; } } @@ -1042,21 +1042,21 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foun */ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive) { - std::vector searchVect; + etk::VectorType searchVect; if (true == m_isUtf8) { char * tmpPointer = search.Utf8Data(); while (*tmpPointer != '\0') { - searchVect.push_back(*tmpPointer++); + searchVect.PushBack(*tmpPointer++); } } else { - std::vector tmppp = search.GetVector(); + etk::VectorType tmppp = search.GetVector(); convertUnicodeToIso(m_charsetType, tmppp, searchVect); } // remove the '\0' at the end of the string ... - searchVect.pop_back(); + searchVect.PopBack(); int32_t position; - int32_t searchLen = searchVect.size(); + int32_t searchLen = searchVect.Size(); char currentChar = '\0'; //APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen); for (position=startPos; position>=searchLen-1; position--) { @@ -1073,7 +1073,7 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *fou } if (true == found) { *foundPos = position - (searchLen-1); - *foundPosEnd = position + searchVect.size(); + *foundPosEnd = position + searchVect.Size(); return true; } } @@ -1181,30 +1181,30 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos) * @return number of element inserted. * */ -int32_t EdnBuf::LocalInsert(int32_t pos, std::vector &insertText) +int32_t EdnBuf::LocalInsert(int32_t pos, etk::VectorType &insertText) { // Insert data in buffer m_data.Insert(pos, insertText); // update the current selected area - UpdateSelection(pos, 0, insertText.size() ); + UpdateSelection(pos, 0, insertText.Size() ); // return the number of element inserted ... - return insertText.size(); + return insertText.Size(); } int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText) { - std::vector tmpInsertText; + etk::VectorType tmpInsertText; if (true == m_isUtf8) { char * tmpPointer = insertText.Utf8Data(); while (*tmpPointer != '\0') { - tmpInsertText.push_back(*tmpPointer++); + tmpInsertText.PushBack(*tmpPointer++); } } else { - std::vector tmppp = insertText.GetVector(); + etk::VectorType tmppp = insertText.GetVector(); convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText); } - if (tmpInsertText.size()>0) { - if (tmpInsertText[tmpInsertText.size()-1] == '\0') { - tmpInsertText.pop_back(); + if (tmpInsertText.Size()>0) { + if (tmpInsertText[tmpInsertText.Size()-1] == '\0') { + tmpInsertText.PopBack(); } } return LocalInsert(pos, tmpInsertText); @@ -1221,15 +1221,15 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText) * @return --- * */ -void EdnBuf::eventModification(int32_t pos, int32_t nInserted, std::vector &deletedText) +void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::VectorType &deletedText) { - if( 0 == deletedText.size() + if( 0 == deletedText.Size() && 0 == nInserted) { // we do nothing ... //APPL_INFO("EdnBuf::eventModification(pos="< not efficent methode ... // ==> better methode : just update the number of line added and removed ... @@ -1239,24 +1239,24 @@ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, std::vector=0; i--) { + for (i=m_historyRedo.Size()-1; i>=0; i--) { if (NULL != m_historyRedo[i]) { delete(m_historyRedo[i]); } - m_historyRedo.pop_back(); + m_historyRedo.PopBack(); } } } else { // undo processing ==> add element in Redo vector ... EdnBufHistory *exempleHistory = new EdnBufHistory(pos, nInserted, deletedText); - m_historyRedo.push_back(exempleHistory); + m_historyRedo.PushBack(exempleHistory); } // Regenerate the Highlight : - RegenerateHighLightAt(pos, deletedText.size(), nInserted); + RegenerateHighLightAt(pos, deletedText.Size(), nInserted); } } diff --git a/jni/appl/Buffer/EdnBuf/EdnBuf.h b/jni/appl/Buffer/EdnBuf/EdnBuf.h index b056ea6..75f557c 100644 --- a/jni/appl/Buffer/EdnBuf/EdnBuf.h +++ b/jni/appl/Buffer/EdnBuf/EdnBuf.h @@ -59,9 +59,9 @@ typedef struct { } selection; typedef struct { - std::vector HLData; - int32_t posHLPass1; - int32_t posHLPass2; + etk::VectorType HLData; + int32_t posHLPass1; + int32_t posHLPass2; }displayHLData_ts; @@ -74,24 +74,24 @@ class EdnBuf { // destructer ~EdnBuf(void); // public function : - void GetAll( std::vector &text); - void SetAll( std::vector &text); - void GetRange( int32_t start, int32_t end, std::vector &output); + void GetAll( etk::VectorType &text); + void SetAll( etk::VectorType &text); + void GetRange( int32_t start, int32_t end, etk::VectorType &output); void GetRange( int32_t start, int32_t end, etk::UString &output); bool DumpIn( FILE *myFile); bool DumpFrom( FILE *myFile); // replace with operator [] ... int8_t operator[] (int32_t); - int32_t Insert( int32_t pos, std::vector &insertText); + int32_t Insert( int32_t pos, etk::VectorType &insertText); int32_t Insert( int32_t pos, etk::UString &insertText); - int32_t Replace( int32_t start, int32_t end, std::vector &insertText); + int32_t Replace( int32_t start, int32_t end, etk::VectorType &insertText); int32_t Replace( int32_t start, int32_t end, etk::UString &insertText); void Remove( int32_t start, int32_t end); int32_t Indent( void); int32_t UnIndent( void); - void GetLineText( int32_t pos, std::vector &text); + void GetLineText( int32_t pos, etk::VectorType &text); int32_t StartOfLine( int32_t pos); int32_t EndOfLine( int32_t pos); @@ -103,7 +103,7 @@ 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( std::vector &data); + int32_t CountLines( etk::VectorType &data); int32_t CountForwardNLines( int32_t startPos, int32_t nLines); int32_t CountBackwardNLines( int32_t startPos, int32_t nLines); @@ -126,10 +126,10 @@ class EdnBuf { void Unselect( void); void RectSelect( int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd); bool GetSelectionPos( int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd); - void GetSelectionText( std::vector &text); + void GetSelectionText( etk::VectorType &text); void GetSelectionText( etk::UString &text); void RemoveSelected( void); - int32_t ReplaceSelected( std::vector &text); + int32_t ReplaceSelected( etk::VectorType &text); int32_t ReplaceSelected( etk::UString &text); private: // current selection of the buffer @@ -140,20 +140,20 @@ class EdnBuf { // History section : // ----------------------------------------- public: - int32_t Undo(void); - int32_t Redo(void); + int32_t Undo(void); + int32_t Redo(void); private: - bool m_isUndoProcessing; - bool m_isRedoProcessing; - std::vector m_historyUndo; - std::vector m_historyRedo; + bool m_isUndoProcessing; + bool m_isRedoProcessing; + etk::VectorType m_historyUndo; + etk::VectorType m_historyRedo; // ----------------------------------------- // hightlight section : // ----------------------------------------- private: Highlight * m_Highlight; //!< internal link with the Highlight system - std::vector m_HLDataPass1; //!< colorisation position in the current buffer pass 1 + etk::VectorType m_HLDataPass1; //!< colorisation position in the current buffer pass 1 void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded); void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0); void CleanHighLight(void); @@ -197,10 +197,10 @@ class EdnBuf { void removeSelected( selection &sel); void replaceSelected( selection &sel, const char *text); - void eventModification( int32_t pos, int32_t nInserted, std::vector &deletedText); + void eventModification( int32_t pos, int32_t nInserted, etk::VectorType &deletedText); - int32_t LocalInsert( int32_t pos, std::vector &insertText); + int32_t LocalInsert( int32_t pos, etk::VectorType &insertText); int32_t LocalInsert( int32_t pos, etk::UString &insertText); bool charMatch( char first, char second, bool caseSensitive = true); diff --git a/jni/appl/Buffer/EdnBuf/EdnBufHistory.cpp b/jni/appl/Buffer/EdnBuf/EdnBufHistory.cpp index afc125e..4583ea5 100644 --- a/jni/appl/Buffer/EdnBuf/EdnBufHistory.cpp +++ b/jni/appl/Buffer/EdnBuf/EdnBufHistory.cpp @@ -39,7 +39,7 @@ EdnBufHistory::EdnBufHistory(void) m_nInserted = 0; } -EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, std::vector &deletedText) +EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType &deletedText) { //APPL_INFO("EdnBufHistory new + data"); m_pos = pos; @@ -47,7 +47,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, std::vector m_deletedText = deletedText; } -void EdnBufHistory::Set(int32_t pos, int32_t nInserted, std::vector &deletedText) +void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::VectorType &deletedText) { //APPL_INFO("EdnBufHistory new + data"); m_pos = pos; @@ -67,7 +67,7 @@ int32_t EdnBufHistory::getPos(void) int32_t EdnBufHistory::getnbDeleted(void) { - return m_deletedText.size(); + return m_deletedText.Size(); } int32_t EdnBufHistory::getnbInserted(void) @@ -75,7 +75,7 @@ int32_t EdnBufHistory::getnbInserted(void) return m_nInserted; } -void EdnBufHistory::getData(std::vector &deletedText) +void EdnBufHistory::getData(etk::VectorType &deletedText) { deletedText = m_deletedText; } diff --git a/jni/appl/Buffer/EdnBuf/EdnBufHistory.h b/jni/appl/Buffer/EdnBuf/EdnBufHistory.h index 8d642c3..3545561 100644 --- a/jni/appl/Buffer/EdnBuf/EdnBufHistory.h +++ b/jni/appl/Buffer/EdnBuf/EdnBufHistory.h @@ -27,22 +27,22 @@ #define __EDN_BUFFER_HISTORY_H__ -#include +#include class EdnBufHistory{ public: EdnBufHistory(void); - EdnBufHistory(int32_t pos, int32_t nInserted, std::vector &deletedText); + EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType &deletedText); ~EdnBufHistory(void); - void Set(int32_t pos, int32_t nInserted, std::vector &deletedText); + void Set(int32_t pos, int32_t nInserted, etk::VectorType &deletedText); int32_t getPos(void); int32_t getnbDeleted(void); int32_t getnbInserted(void); - void getData(std::vector &deletedText); + void getData(etk::VectorType &deletedText); private: int32_t m_pos; int32_t m_nInserted; - std::vector m_deletedText; + etk::VectorType m_deletedText; }; #endif diff --git a/jni/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp b/jni/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp index 32370ed..07fec66 100644 --- a/jni/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp +++ b/jni/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp @@ -35,7 +35,7 @@ void EdnBuf::SetHLSystem(Highlight * newHLSystem) { if (m_Highlight != newHLSystem) { m_Highlight = newHLSystem; - m_HLDataPass1.clear(); + m_HLDataPass1.Clear(); RegenerateHighLightAt(0, 0, m_data.Size()); } } @@ -73,7 +73,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd int32_t startId; int32_t stopId; // clean data if needed - if (0 != m_HLDataPass1.size()) { + if (0 != m_HLDataPass1.Size()) { // find element previous FindMainHighLightPosition(pos, posEnd, startId, stopId, true); @@ -81,23 +81,23 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd if( -1 == startId && -1 == stopId) { - m_HLDataPass1.clear(); + m_HLDataPass1.Clear(); } else if(-1 == startId) { if (0 == stopId){ - m_HLDataPass1.erase(m_HLDataPass1.begin()); + m_HLDataPass1.Erase(0); //APPL_DEBUG("1 * Erase 0"); } else { - m_HLDataPass1.erase(m_HLDataPass1.begin(), m_HLDataPass1.begin()+stopId); + m_HLDataPass1.EraseLen(0,stopId); //APPL_DEBUG("2 * Erase 0->" << stopId); } } else if(-1 == stopId) { //APPL_DEBUG("3 * Erase " << startId+1 << "-> end"); - m_HLDataPass1.erase(m_HLDataPass1.begin()+startId+1, m_HLDataPass1.end()); + m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId); stopId = -1; } else { - int32_t currentSize = m_HLDataPass1.size(); + int32_t currentSize = m_HLDataPass1.Size(); //APPL_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" ); - m_HLDataPass1.erase(m_HLDataPass1.begin() + startId+1, m_HLDataPass1.begin() + stopId ); + m_HLDataPass1.EraseLen(startId+1, stopId - startId); if (stopId == currentSize-1) { stopId = -1; } @@ -119,7 +119,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd } else { elemStart = startId+1; } - for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) { //APPL_DEBUG("move element=" << i); m_HLDataPass1[i].beginStart += nbAdded - nbDeleted; m_HLDataPass1[i].beginStop += nbAdded - nbDeleted; @@ -137,7 +137,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0); } else if(-1 == stopId) { //APPL_DEBUG("******* Regenerate STOP"); - GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.size() -1].endStop, m_data.Size(), m_HLDataPass1.size()); + GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size()); } else { //APPL_DEBUG("******* Regenerate RANGE"); GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1); @@ -202,7 +202,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t S=-1 *************** E */ int32_t i; - for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { if (m_HLDataPass1[i].endStop > startPos) { break; } @@ -223,7 +223,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t } else { elemStart = startId+1; } - for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) { if (m_HLDataPass1[i].beginStart > endPos) { stopId = i; @@ -261,7 +261,7 @@ void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos) void EdnBuf::CleanHighLight(void) { // Remove all element in the list... - m_HLDataPass1.clear(); + m_HLDataPass1.Clear(); } @@ -269,7 +269,7 @@ colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &sta { int32_t i; int32_t start = etk_max(0, starPos-1); - for (i=start; i<(int32_t)m_HLDataPass1.size(); i++) { + for (i=start; i<(int32_t)m_HLDataPass1.Size(); i++) { starPos = i; if( m_HLDataPass1[i].beginStart <= pos && m_HLDataPass1[i].endStop > pos) @@ -294,7 +294,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, //GTimeVal timeStart; //g_get_current_time(&timeStart); HLStart = StartOfLine(HLStart); - MData.HLData.clear(); + MData.HLData.Clear(); int32_t HLStop = CountForwardNLines(HLStart, nbLines); int32_t startId, stopId; // find element previous @@ -304,7 +304,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, //APPL_DEBUG("List of section between : "<< startId << " & " << stopId); int32_t endSearch = stopId+1; if (-1 == stopId) { - endSearch = m_HLDataPass1.size(); + endSearch = m_HLDataPass1.Size(); } for (k=etk_max(startId, 0); k (under section ) k="< (empty section 3 ) k="< remove it"); - m_historyUndo.pop_back(); + m_historyUndo.PopBack(); return -1; } int32_t pos = m_historyUndo[nbElement]->getPos(); int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted(); int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted(); - std::vector deletedText; + etk::VectorType deletedText; m_historyUndo[nbElement]->getData(deletedText); m_isUndoProcessing = true; if (0 == nbInserted) { @@ -77,14 +77,14 @@ int32_t EdnBuf::Undo(void) } // remove element in the list : delete(m_historyUndo[nbElement]); - m_historyUndo.pop_back(); + m_historyUndo.PopBack(); m_isUndoProcessing = false; return posDest; } int32_t EdnBuf::Redo(void) { - int32_t nbElement = m_historyRedo.size(); + int32_t nbElement = m_historyRedo.Size(); //APPL_DEBUG("EdnBuf::Redo Request id="< remove it"); - m_historyRedo.pop_back(); + m_historyRedo.PopBack(); return -1; } int32_t pos = m_historyRedo[nbElement]->getPos(); int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted(); int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted(); - std::vector deletedText; + etk::VectorType deletedText; m_historyRedo[nbElement]->getData(deletedText); m_isRedoProcessing = true; if (0 == nbInserted) { @@ -125,7 +125,7 @@ int32_t EdnBuf::Redo(void) } // remove element in the list : delete(m_historyRedo[nbElement]); - m_historyRedo.pop_back(); + m_historyRedo.PopBack(); m_isRedoProcessing = false; return posDest; } diff --git a/jni/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp b/jni/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp index 2192283..7b511ea 100644 --- a/jni/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp +++ b/jni/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp @@ -136,12 +136,12 @@ bool EdnBuf::GetSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t * @return --- * */ -void EdnBuf::GetSelectionText(std::vector &text) +void EdnBuf::GetSelectionText(etk::VectorType &text) { int32_t start, end, rectStart, rectEnd; bool isRect; // remove output data - text.clear(); + text.Clear(); bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd); @@ -220,7 +220,7 @@ void EdnBuf::RemoveSelected(void) * @return --- * */ -int32_t EdnBuf::ReplaceSelected(std::vector &text) +int32_t EdnBuf::ReplaceSelected(etk::VectorType &text) { int32_t start, end, rectStart, rectEnd; bool isRect; diff --git a/jni/appl/Buffer/EdnVectorBuf.cpp b/jni/appl/Buffer/EdnVectorBuf.cpp index a74709f..2331dcb 100644 --- a/jni/appl/Buffer/EdnVectorBuf.cpp +++ b/jni/appl/Buffer/EdnVectorBuf.cpp @@ -225,26 +225,18 @@ int8_t& EdnVectorBuf::Get(int32_t pos) * @return --- * */ -void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, std::vector &tmpBuffer) +void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, etk::VectorType &tmpBuffer) { - tmpBuffer.clear(); + tmpBuffer.Clear(); if (pos < m_gapStart) { if (pos + nbElement < m_gapStart) { - for (int32_t iii = 0 ; iii < nbElement; iii++) { - tmpBuffer.push_back(m_data[pos + iii]); - } + tmpBuffer.PushBack(&m_data[pos], nbElement); } else { - for (int32_t iii = 0 ; iii < m_gapStart-pos; iii++) { - tmpBuffer.push_back(m_data[pos + iii]); - } - for (int32_t iii = 0 ; iii < nbElement - (m_gapStart - pos); iii++) { - tmpBuffer.push_back(m_data[m_gapEnd + iii]); - } + tmpBuffer.PushBack(&m_data[pos], m_gapStart - pos); + tmpBuffer.PushBack(&m_data[m_gapEnd], nbElement - (m_gapStart - pos) ); } } else { - for (int32_t iii = 0 ; iii < nbElement; iii++) { - tmpBuffer.push_back(m_data[pos+(m_gapEnd-m_gapStart)+iii]); - } + tmpBuffer.PushBack(&m_data[pos+(m_gapEnd-m_gapStart)], nbElement); } } @@ -405,15 +397,15 @@ void EdnVectorBuf::Insert(int32_t pos, const int8_t& item) * @return --- * */ -void EdnVectorBuf::Insert(int32_t pos, std::vector& items) +void EdnVectorBuf::Insert(int32_t pos, etk::VectorType& items) { if( pos > Size() || pos < 0 ) { APPL_ERROR("Request higher than buffer size : pos="< &tmpBuffer); + void Get( int32_t pos, int32_t nbElement, etk::VectorType &tmpBuffer); // insert functions void PushBack( const int8_t& item); void Insert( int32_t pos, const int8_t& item); - void Insert( int32_t pos, std::vector& items); + void Insert( int32_t pos, etk::VectorType& items); // Remove and insert functions void Replace( int32_t pos, const int8_t& item); - void Replace( int32_t pos, int32_t nbRemoveElement, std::vector& items); + void Replace( int32_t pos, int32_t nbRemoveElement, etk::VectorType& items); // Revove fonctions void Remove( int32_t pos, int32_t nbRemoveElement = 1); void PopBack( void); @@ -300,7 +300,6 @@ class EdnVectorBuf * @return The number requested */ int32_t Size(void) { return m_allocated - GapSize(); }; - int32_t size(void) { return m_allocated - GapSize(); }; Iterator Position(int32_t pos) { @@ -337,5 +336,6 @@ class EdnVectorBuf #undef __class__ #define __class__ NULL +void TestEdnVectorBuf(void); #endif diff --git a/jni/appl/Colorize/ColorizeManager.cpp b/jni/appl/Colorize/ColorizeManager.cpp index a06a17f..b215c56 100644 --- a/jni/appl/Colorize/ColorizeManager.cpp +++ b/jni/appl/Colorize/ColorizeManager.cpp @@ -67,10 +67,10 @@ class classColorManager: public ewol::EObject void DisplayListOfColor(void); private: - etk::UString m_fileColor; - std::vector listMyColor; //!< List of ALL Color - Colorize * errorColor; - color_ts basicColors[COLOR_NUMBER_MAX]; + etk::UString m_fileColor; + etk::VectorType listMyColor; //!< List of ALL Color + Colorize * errorColor; + color_ts basicColors[COLOR_NUMBER_MAX]; }; @@ -85,14 +85,14 @@ classColorManager::~classColorManager(void) int32_t i; // clean all Element - for (i=0; i< listMyColor.size(); i++) { + for (i=0; i< listMyColor.Size(); i++) { if (NULL != listMyColor[i]) { delete(listMyColor[i]); listMyColor[i] = NULL; } } // clear the compleate list - listMyColor.clear(); + listMyColor.Clear(); } void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data) @@ -125,14 +125,14 @@ void classColorManager::LoadFile(const char * xmlFilename) // Remove all old color : int32_t i; // clean all Element - for (i=0; i< listMyColor.size(); i++) { + for (i=0; i< listMyColor.Size(); i++) { if (NULL != listMyColor[i]) { delete(listMyColor[i]); listMyColor[i] = NULL; } } // clear the compleate list - listMyColor.clear(); + listMyColor.Clear(); m_fileColor = xmlFilename; APPL_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\""); @@ -275,7 +275,7 @@ void classColorManager::LoadFile(const char * xmlFilename) myNewColor->SetItalic(true); } } - listMyColor.push_back(myNewColor); + listMyColor.PushBack(myNewColor); } else { APPL_ERROR(PFX"(l "<Row()<<") node not suported : \""<Value()<<"\" must be [color]"); } @@ -299,7 +299,7 @@ void classColorManager::LoadFile(const char * xmlFilename) Colorize *classColorManager::Get(const char *colorName) { int32_t i; - for (i=0; iGetName(); if (elementName == colorName) { return listMyColor[i]; @@ -330,7 +330,7 @@ color_ts & classColorManager::Get(basicColor_te myColor) bool classColorManager::Exist(const char *colorName) { int32_t i; - for (i=0; iGetName(); if (elementName == colorName) { return true; @@ -349,7 +349,7 @@ void classColorManager::DisplayListOfColor(void) { int32_t i; APPL_INFO(PFX"List of ALL COLOR : "); - for (i=0; iGetName(); //APPL_INFO(i << " : \"" << elementName.c_str() << "\"" ); listMyColor[i]->Display(i); diff --git a/jni/appl/Gui/CodeView.cpp b/jni/appl/Gui/CodeView.cpp index fb1371d..956e6d5 100644 --- a/jni/appl/Gui/CodeView.cpp +++ b/jni/appl/Gui/CodeView.cpp @@ -54,7 +54,7 @@ CodeView::CodeView(void) m_bufferID = -1; m_buttunOneSelected = false; - m_lineNumberList.clear(); + m_lineNumberList.Clear(); m_textColorFg = etk::color::color_Black; @@ -91,11 +91,11 @@ void CodeView::UpdateNumberOfLineReference(int32_t bufferID) Vector2D tmpCoord; tmpCoord.x = 0; tmpCoord.y = 0; - if (m_lineNumberList.size()<=bufferID) { + if (m_lineNumberList.Size()<=bufferID) { // update the number of elements : - for (int32_t iii=m_lineNumberList.size(); iii <= bufferID; iii++) { + for (int32_t iii=m_lineNumberList.Size(); iii <= bufferID; iii++) { // add start line at 0 : - m_lineNumberList.push_back(tmpCoord); + m_lineNumberList.PushBack(tmpCoord); } } } @@ -289,7 +289,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event if(eventId == ednMsgBufferId) { //keep the reference of the display offset : if( m_bufferID >=0 - && m_bufferID < m_lineNumberList.size()) { + && m_bufferID < m_lineNumberList.Size()) { m_lineNumberList[m_bufferID] = m_originScrooled; } int32_t bufferID = 0; @@ -301,7 +301,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event UpdateNumberOfLineReference(m_bufferID); // set back if needed the display position ... if( m_bufferID >=0 - && m_bufferID < m_lineNumberList.size()) { + && m_bufferID < m_lineNumberList.Size()) { m_originScrooled = m_lineNumberList[m_bufferID]; } } else if (eventId == ednMsgGuiCopy) { diff --git a/jni/appl/Gui/CodeView.h b/jni/appl/Gui/CodeView.h index 7543338..bb120d2 100644 --- a/jni/appl/Gui/CodeView.h +++ b/jni/appl/Gui/CodeView.h @@ -48,19 +48,19 @@ class CodeView :public ewol::WidgetScrooled const char * const GetObjectType(void) { return "ApplCodeView"; }; virtual bool CalculateMinSize(void); private: - etk::UString m_label; - color_ts m_textColorFg; //!< Text color - color_ts m_textColorBg; //!< Background color - int32_t m_bufferID; - bool m_buttunOneSelected; - std::vector > m_lineNumberList; - void UpdateNumberOfLineReference(int32_t bufferID); + etk::UString m_label; + color_ts m_textColorFg; //!< Text color + color_ts m_textColorBg; //!< Background color + int32_t m_bufferID; + bool m_buttunOneSelected; + etk::VectorType > m_lineNumberList; + void UpdateNumberOfLineReference(int32_t bufferID); // drawing elements : - ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER]; - ewol::OObject2DTextColored m_OObjectTextBold[NB_BOUBLE_BUFFER]; - ewol::OObject2DTextColored m_OObjectTextItalic[NB_BOUBLE_BUFFER]; - ewol::OObject2DTextColored m_OObjectTextBoldItalic[NB_BOUBLE_BUFFER]; - ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER]; + ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER]; + ewol::OObject2DTextColored m_OObjectTextBold[NB_BOUBLE_BUFFER]; + ewol::OObject2DTextColored m_OObjectTextItalic[NB_BOUBLE_BUFFER]; + ewol::OObject2DTextColored m_OObjectTextBoldItalic[NB_BOUBLE_BUFFER]; + ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER]; public: virtual void OnRegenerateDisplay(void); diff --git a/jni/appl/Highlight/Highlight.cpp b/jni/appl/Highlight/Highlight.cpp index eb560b1..64c7ccc 100644 --- a/jni/appl/Highlight/Highlight.cpp +++ b/jni/appl/Highlight/Highlight.cpp @@ -33,14 +33,14 @@ #define __class__ "Highlight" -void Highlight::ParseRules(TiXmlNode *child, std::vector &mListPatern, int32_t level) +void Highlight::ParseRules(TiXmlNode *child, etk::VectorType &mListPatern, int32_t level) { // Create the patern ... HighlightPattern *myPattern = new HighlightPattern(); // parse under Element myPattern->ParseRules(child, level); // add element in the list - mListPatern.push_back(myPattern); + mListPatern.PushBack(myPattern); } @@ -100,7 +100,7 @@ Highlight::Highlight(etk::UString &xmlFilename) if (NULL != myData) { //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData); etk::UString * myEdnData = new etk::UString(myData); - m_listExtentions.push_back(myEdnData); + m_listExtentions.PushBack(myEdnData); } } else if (!strcmp(child->Value(), "pass1")) { // Get sub Nodes ... @@ -145,35 +145,35 @@ Highlight::~Highlight(void) { int32_t i; // clean all Element - for (i=0; i< m_listHighlightPass1.size(); i++) { + for (i=0; i< m_listHighlightPass1.Size(); i++) { if (NULL != m_listHighlightPass1[i]) { delete(m_listHighlightPass1[i]); m_listHighlightPass1[i] = NULL; } } // clear the compleate list - m_listHighlightPass1.clear(); + m_listHighlightPass1.Clear(); // clean all Element - for (i=0; i< m_listExtentions.size(); i++) { + for (i=0; i< m_listExtentions.Size(); i++) { if (NULL != m_listExtentions[i]) { delete(m_listExtentions[i]); m_listExtentions[i] = NULL; } } // clear the compleate list - m_listExtentions.clear(); + m_listExtentions.Clear(); } void Highlight::ReloadColor(void) { int32_t i; - for (i=0; i< m_listHighlightPass1.size(); i++) { + for (i=0; i< m_listHighlightPass1.Size(); i++) { if (NULL != m_listHighlightPass1[i]) { m_listHighlightPass1[i]->ReloadColor(); } } - for (i=0; i< m_listHighlightPass2.size(); i++) { + for (i=0; i< m_listHighlightPass2.Size(); i++) { if (NULL != m_listHighlightPass2[i]) { m_listHighlightPass2[i]->ReloadColor(); } @@ -183,7 +183,7 @@ void Highlight::ReloadColor(void) bool Highlight::HasExtention(etk::UString &ext) { int32_t i; - for (i=0; iGetName() ); //m_listHighlightPass1[i]->Display(); } // Display all elements - for (i=0; i< m_listHighlightPass2.size(); i++) { + for (i=0; i< m_listHighlightPass2.Size(); i++) { APPL_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() ); //m_listHighlightPass2[i]->Display(); } @@ -236,7 +236,7 @@ void Highlight::Display(void) // TODO : Celui qui appelle suprime des element pour rien ... Enfin c'est pas trègrave... Il suffirait juste de suprimer celuis d'avant si il n'est pas terminer... void Highlight::Parse(int32_t start, int32_t stop, - std::vector &metaData, + etk::VectorType &metaData, int32_t addingPos, EdnVectorBuf &buffer) { @@ -250,27 +250,27 @@ void Highlight::Parse(int32_t start, while (elementStartFind(elementStart, buffer.size(), resultat, buffer); + ret = m_listHighlightPass1[jjj]->Find(elementStart, buffer.Size(), resultat, buffer); if (HLP_FIND_ERROR != ret) { //APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" ); // Remove element in the current List where the current Element have a end inside the next... int32_t kkk=addingPos; - while(kkk < metaData.size() ) { + while(kkk < metaData.Size() ) { if (metaData[kkk].beginStart <= resultat.endStop) { // Remove element //APPL_INFO("Erase element=" << kkk); - metaData.erase(metaData.begin()+kkk, metaData.begin()+kkk+1); + metaData.EraseLen(kkk, kkk+1); // Increase the end of search - if (kkk < metaData.size()) { + if (kkk < metaData.Size()) { // just befor the end of the next element elementStop = metaData[kkk].beginStart-1; } else { // end of the buffer - elementStop = buffer.size(); + elementStop = buffer.Size(); } } else { // Not find ==> exit the cycle : @@ -278,7 +278,7 @@ void Highlight::Parse(int32_t start, } } // Add curent element in the list ... - metaData.insert(metaData.begin()+addingPos, resultat); + metaData.Insert(addingPos, resultat); //APPL_DEBUG("INSERT at "<< addingPos << " S=" << resultat.beginStart << " E=" << resultat.endStop ); // Update the current research starting element: (Set position at the end of the current element elementStart = resultat.endStop-1; @@ -300,7 +300,7 @@ void Highlight::Parse(int32_t start, */ void Highlight::Parse2(int32_t start, int32_t stop, - std::vector &metaData, + etk::VectorType &metaData, EdnVectorBuf &buffer) { //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" ); @@ -311,7 +311,7 @@ void Highlight::Parse2(int32_t start, //APPL_DEBUG("Parse element in the buffer id=" << elementStart); //try to fond the HL in ALL of we have int32_t jjj; - for (jjj=0; jjj &metaData, + etk::VectorType &metaData, int32_t addingPos, EdnVectorBuf &buffer); void Parse2(int32_t start, int32_t stop, - std::vector &metaData, + etk::VectorType &metaData, EdnVectorBuf &buffer); private: - void ParseRules(TiXmlNode *child, std::vector &mListPatern, int32_t level); - etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") - std::vector m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h" - std::vector m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer) - std::vector m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) ) + void ParseRules(TiXmlNode *child, etk::VectorType &mListPatern, int32_t level); + etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") + etk::VectorType m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h" + etk::VectorType m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer) + etk::VectorType m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) ) }; diff --git a/jni/appl/Highlight/HighlightManager.cpp b/jni/appl/Highlight/HighlightManager.cpp index e0c5353..e8eff76 100644 --- a/jni/appl/Highlight/HighlightManager.cpp +++ b/jni/appl/Highlight/HighlightManager.cpp @@ -35,7 +35,7 @@ class localClassHighlightManager: public ewol::EObject { private: - std::vector listHighlight; //!< List of ALL hightlight modules + etk::VectorType listHighlight; //!< List of ALL hightlight modules public: // Constructeur localClassHighlightManager(void) { @@ -44,14 +44,14 @@ class localClassHighlightManager: public ewol::EObject ~localClassHighlightManager(void) { int32_t i; // clean all Element - for (i=0; i< listHighlight.size(); i++) { + for (i=0; i< listHighlight.Size(); i++) { if (NULL != listHighlight[i]) { delete(listHighlight[i]); listHighlight[i] = NULL; } } // clear the compleate list - listHighlight.clear(); + listHighlight.Clear(); }; /** @@ -92,7 +92,7 @@ class localClassHighlightManager: public ewol::EObject Highlight* Get(etk::File &fileName) { int32_t i; - for (i=0; iFileNameCompatible(fileName) ) { return listHighlight[i]; } @@ -113,47 +113,47 @@ class localClassHighlightManager: public ewol::EObject { etk::UString xmlFilename = "lang_c.xml"; Highlight *myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_boo.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_Makefile.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_asm.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_xml.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_php.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_bash.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_matlab.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_java.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_lua.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = "lang_in.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); //myHightline->Display(); } diff --git a/jni/appl/Highlight/HighlightPattern.cpp b/jni/appl/Highlight/HighlightPattern.cpp index 40197eb..b371efa 100644 --- a/jni/appl/Highlight/HighlightPattern.cpp +++ b/jni/appl/Highlight/HighlightPattern.cpp @@ -118,7 +118,7 @@ void HighlightPattern::Display(void) } */ // Display all elements - for (int32_t i=0; i< m_subPatern.size(); i++) { + for (int32_t i=0; i< m_subPatern.Size(); i++) { APPL_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName() ); m_subPatern[i]->Display(); } diff --git a/jni/appl/Highlight/HighlightPattern.h b/jni/appl/Highlight/HighlightPattern.h index 9de8d8a..24f4388 100644 --- a/jni/appl/Highlight/HighlightPattern.h +++ b/jni/appl/Highlight/HighlightPattern.h @@ -33,7 +33,7 @@ class HighlightPattern; #include #include -#include +#include #include #include @@ -72,17 +72,17 @@ class HighlightPattern { void ReloadColor(void); private: - int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher .... - etk::UString m_paternName; //!< Current style name (like "c++" or "c" or "script Bash") - etk::UString m_colorName; //!< Current color name - Colorize * m_color; //!< Link to the color manager - etk::RegExp * m_regExpStart; //!< Start of Regular expression - etk::RegExp * m_regExpStop; //!< Stop of Regular Expression - bool m_haveStopPatern; //!< Stop patern presence - bool m_multiline; //!< The patern is multiline - uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern .... - std::vector m_subPatern; //!< Under patern of this one -// std::vector m_subColor; //!< Under Color in the start RegExp ... + int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher .... + etk::UString m_paternName; //!< Current style name (like "c++" or "c" or "script Bash") + etk::UString m_colorName; //!< Current color name + Colorize * m_color; //!< Link to the color manager + etk::RegExp * m_regExpStart; //!< Start of Regular expression + etk::RegExp * m_regExpStop; //!< Stop of Regular Expression + bool m_haveStopPatern; //!< Stop patern presence + bool m_multiline; //!< The patern is multiline + uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern .... + etk::VectorType m_subPatern; //!< Under patern of this one +// etk::VectorType m_subColor; //!< Under Color in the start RegExp ... }; #endif