[DEV] work with std::string
This commit is contained in:
parent
a5b44ae974
commit
101f77dc3d
@ -50,7 +50,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator-- (void) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
etk::UChar appl::Buffer::Iterator::operator* (void) {
|
||||
char32_t appl::Buffer::Iterator::operator* (void) {
|
||||
if (m_value != etk::UChar::Null) {
|
||||
return m_value;
|
||||
}
|
||||
@ -71,7 +71,7 @@ etk::UChar appl::Buffer::Iterator::operator* (void) {
|
||||
tmpVal[iii] = m_data->m_data[m_current+iii];
|
||||
}
|
||||
// transform ...
|
||||
m_value.setUtf8(tmpVal);
|
||||
m_value = etk::setUtf8(tmpVal);
|
||||
return m_value;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ appl::Buffer::~Buffer(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool appl::Buffer::loadFile(const etk::UString& _name) {
|
||||
bool appl::Buffer::loadFile(const std::string& _name) {
|
||||
APPL_DEBUG("Load file : '" << _name << "'");
|
||||
m_fileName = _name;
|
||||
m_isModify = true;
|
||||
@ -139,7 +139,7 @@ bool appl::Buffer::loadFile(const etk::UString& _name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void appl::Buffer::setFileName(const etk::UString& _name) {
|
||||
void appl::Buffer::setFileName(const std::string& _name) {
|
||||
if (m_fileName == _name) {
|
||||
return;
|
||||
}
|
||||
@ -199,9 +199,9 @@ appl::Buffer::Iterator appl::Buffer::getEndLine(const appl::Buffer::Iterator& _p
|
||||
}
|
||||
|
||||
|
||||
bool appl::Buffer::search(const appl::Buffer::Iterator& _pos, const etk::UChar& _search, appl::Buffer::Iterator& _result) {
|
||||
bool appl::Buffer::search(const appl::Buffer::Iterator& _pos, const char32_t& _search, appl::Buffer::Iterator& _result) {
|
||||
// move in the string
|
||||
etk::UChar value;
|
||||
char32_t value;
|
||||
for (Iterator it = _pos;
|
||||
(bool)it == true;
|
||||
++it) {
|
||||
@ -214,9 +214,9 @@ bool appl::Buffer::search(const appl::Buffer::Iterator& _pos, const etk::UChar&
|
||||
return false;
|
||||
}
|
||||
|
||||
bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos, const etk::UChar& _search, appl::Buffer::Iterator& _result) {
|
||||
bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos, const char32_t& _search, appl::Buffer::Iterator& _result) {
|
||||
// move in the string
|
||||
etk::UChar value;
|
||||
char32_t value;
|
||||
for (Iterator it = _pos - 1;
|
||||
(bool)it == true;
|
||||
--it) {
|
||||
@ -255,7 +255,7 @@ void appl::Buffer::moveCursor(esize_t _pos) {
|
||||
bool appl::Buffer::getPosAround(const appl::Buffer::Iterator& _startPos,
|
||||
appl::Buffer::Iterator &_beginPos,
|
||||
appl::Buffer::Iterator &_endPos) {
|
||||
etk::UChar currentValue = *position(_startPos);
|
||||
char32_t currentValue = *position(_startPos);
|
||||
_beginPos = begin();
|
||||
_endPos = end();
|
||||
if ( currentValue == etk::UChar::Tabulation
|
||||
@ -284,7 +284,7 @@ bool appl::Buffer::getPosAround(const appl::Buffer::Iterator& _startPos,
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if( false == currentValue.isSpecialChar()){
|
||||
} else if( false == etk::isSpecialChar(currentValue)){
|
||||
APPL_DEBUG("select normal Char");
|
||||
// Search back
|
||||
for (Iterator it = --position(_startPos);
|
||||
@ -292,7 +292,7 @@ bool appl::Buffer::getPosAround(const appl::Buffer::Iterator& _startPos,
|
||||
--it) {
|
||||
currentValue = *it;
|
||||
if ( currentValue != '_'
|
||||
&& true == currentValue.isSpecialChar()) {
|
||||
&& true == etk::isSpecialChar(currentValue)) {
|
||||
_beginPos = ++it;
|
||||
break;
|
||||
}
|
||||
@ -303,7 +303,7 @@ bool appl::Buffer::getPosAround(const appl::Buffer::Iterator& _startPos,
|
||||
++it) {
|
||||
currentValue = *it;
|
||||
if ( currentValue != '_'
|
||||
&& true == currentValue.isSpecialChar()) {
|
||||
&& true == etk::isSpecialChar(currentValue)) {
|
||||
_endPos = it;
|
||||
break;
|
||||
}
|
||||
@ -311,7 +311,7 @@ bool appl::Buffer::getPosAround(const appl::Buffer::Iterator& _startPos,
|
||||
return true;
|
||||
} else {
|
||||
APPL_DEBUG("select same char");
|
||||
etk::UChar comparechar = currentValue;
|
||||
char32_t comparechar = currentValue;
|
||||
// Search back
|
||||
for (Iterator it = --position(_startPos);
|
||||
(bool)it == true;
|
||||
@ -353,55 +353,47 @@ static const char *ControlCodeTable[32] = {
|
||||
"NUL", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "np", "cr", "so", "si",
|
||||
"dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us"};
|
||||
|
||||
void appl::Buffer::expand(esize_t& _indent, const etk::UChar& _value, etk::UString& _out) const {
|
||||
void appl::Buffer::expand(esize_t& _indent, const char32_t& _value, std::u32string& _out) const {
|
||||
_out.clear();
|
||||
int32_t tabDist = 4;
|
||||
if (_value == etk::UChar::Tabulation) {
|
||||
int32_t nSpaces = tabDist - (_indent % tabDist);
|
||||
for (int32_t iii=0; iii<nSpaces; iii++) {
|
||||
_out.append(etk::UChar::Space);
|
||||
_out += etk::UChar::Space;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// convert ASCII control codes to readable character sequences
|
||||
if (_value == etk::UChar::Null) {
|
||||
_out.append(etk::UChar('<'));
|
||||
_out.append(etk::UChar('n'));
|
||||
_out.append(etk::UChar('u'));
|
||||
_out.append(etk::UChar('l'));
|
||||
_out.append(etk::UChar('>'));
|
||||
_out += U"<nul>";
|
||||
return;
|
||||
}
|
||||
if (_value == etk::UChar::Return) {
|
||||
// nothing to display...
|
||||
_out.append(etk::UChar::Return);
|
||||
_out += etk::UChar::Return;
|
||||
return;
|
||||
}
|
||||
if (_value.get() <= 31) {
|
||||
_out.append(etk::UChar('<'));
|
||||
const char * tmp = ControlCodeTable[_value.get()];
|
||||
if (_value <= 31) {
|
||||
_out += '<';
|
||||
const char * tmp = ControlCodeTable[_value];
|
||||
while (*tmp!='\0') {
|
||||
_out.append(etk::UChar(*tmp));
|
||||
_out += *tmp;
|
||||
tmp++;
|
||||
}
|
||||
_out.append(etk::UChar('>'));
|
||||
_out += '>';
|
||||
return;
|
||||
}
|
||||
if (_value == etk::UChar::Delete) {
|
||||
_out.append(etk::UChar('<'));
|
||||
_out.append(etk::UChar('d'));
|
||||
_out.append(etk::UChar('e'));
|
||||
_out.append(etk::UChar('l'));
|
||||
_out.append(etk::UChar('>'));
|
||||
_out += U"<del>";
|
||||
return;
|
||||
}
|
||||
// nothing to do ...
|
||||
_out.append(_value);
|
||||
_out += _value;
|
||||
//APPL_DEBUG("plop : " << _out);
|
||||
}
|
||||
|
||||
appl::Buffer::Iterator appl::Buffer::countForwardNLines(const appl::Buffer::Iterator& _startPos, int32_t _nLines) {
|
||||
etk::UChar value;
|
||||
char32_t value;
|
||||
int32_t lineCount = 0;
|
||||
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
|
||||
for (Iterator it = ++position(_startPos);
|
||||
@ -422,7 +414,7 @@ appl::Buffer::Iterator appl::Buffer::countForwardNLines(const appl::Buffer::Iter
|
||||
|
||||
appl::Buffer::Iterator appl::Buffer::countBackwardNLines(const appl::Buffer::Iterator& _startPos, int32_t _nLines) {
|
||||
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
|
||||
etk::UChar value;
|
||||
char32_t value;
|
||||
int32_t lineCount = 0;
|
||||
for (Iterator it = --position(_startPos);
|
||||
it != begin();
|
||||
@ -442,7 +434,7 @@ appl::Buffer::Iterator appl::Buffer::countBackwardNLines(const appl::Buffer::Ite
|
||||
|
||||
|
||||
|
||||
bool appl::Buffer::copy(etk::UString& _data) {
|
||||
bool appl::Buffer::copy(std::string& _data) {
|
||||
_data.clear();
|
||||
if (hasTextSelected() == true) {
|
||||
esize_t startPos = getStartSelectionPos();
|
||||
@ -458,7 +450,7 @@ bool appl::Buffer::copy(etk::UString& _data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void appl::Buffer::copy(etk::UString& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
void appl::Buffer::copy(std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
_data.clear();
|
||||
esize_t startPos = getStartSelectionPos();
|
||||
esize_t endPos = getStopSelectionPos();
|
||||
@ -470,58 +462,57 @@ void appl::Buffer::copy(etk::UString& _data, const appl::Buffer::Iterator& _pos,
|
||||
}
|
||||
}
|
||||
|
||||
bool appl::Buffer::write(const etk::UString& _data, const appl::Buffer::Iterator& _pos) {
|
||||
etk::Char output = _data.c_str();
|
||||
m_data.insert(_pos, (int8_t*)((void*)output), output.size());
|
||||
regenerateHighLightAt(_pos, 0, output.size());
|
||||
bool appl::Buffer::write(const std::string& _data, const appl::Buffer::Iterator& _pos) {
|
||||
m_data.insert(_pos, (int8_t*)(_data.c_str()), _data.size());
|
||||
regenerateHighLightAt(_pos, 0, _data.size());
|
||||
m_selectMode = false;
|
||||
moveCursor((esize_t)_pos+output.size());
|
||||
moveCursor((esize_t)_pos+_data.size());
|
||||
countNumberofLine(); // TODO : use more intelligent counter
|
||||
setModification(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool appl::Buffer::replace(const etk::UString& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
etk::Char output = _data.c_str();
|
||||
m_data.replace(_pos, (esize_t)_posEnd-(esize_t)_pos, (int8_t*)((void*)output), output.size());
|
||||
regenerateHighLightAt(_pos, (esize_t)_posEnd-(esize_t)_pos, output.size());
|
||||
bool appl::Buffer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
m_data.replace(_pos, (esize_t)_posEnd-(esize_t)_pos, (int8_t*)(_data.c_str()), _data.size());
|
||||
regenerateHighLightAt(_pos, (esize_t)_posEnd-(esize_t)_pos, _data.size());
|
||||
m_selectMode = false;
|
||||
moveCursor((esize_t)_pos+output.size());
|
||||
moveCursor((esize_t)_pos+_data.size());
|
||||
countNumberofLine(); // TODO : use more intelligent counter
|
||||
setModification(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void appl::Buffer::removeSelection(void) {
|
||||
if (hasTextSelected() == true) {
|
||||
esize_t startPos = getStartSelectionPos();
|
||||
esize_t endPos = getStopSelectionPos();
|
||||
m_data.remove(startPos, endPos-startPos);
|
||||
regenerateHighLightAt(startPos, endPos-startPos, 0);
|
||||
m_selectMode = false;
|
||||
moveCursor(startPos);
|
||||
countNumberofLine(); // TODO : use more intelligent counter
|
||||
setModification(true);
|
||||
if (hasTextSelected() == false) {
|
||||
return;
|
||||
}
|
||||
esize_t startPos = getStartSelectionPos();
|
||||
esize_t endPos = getStopSelectionPos();
|
||||
m_data.remove(startPos, endPos-startPos);
|
||||
regenerateHighLightAt(startPos, endPos-startPos, 0);
|
||||
m_selectMode = false;
|
||||
moveCursor(startPos);
|
||||
countNumberofLine(); // TODO : use more intelligent counter
|
||||
setModification(true);
|
||||
}
|
||||
|
||||
void appl::Buffer::tryFindHighlightType(void) {
|
||||
etk::FSNode file(m_name);
|
||||
etk::UString type = appl::highlightManager::getTypeExtention(file.fileGetExtention());
|
||||
etk::FSNode file(m_fileName);
|
||||
std::string type = appl::highlightManager::getTypeExtention(file.fileGetExtention());
|
||||
if (type.size() == 0) {
|
||||
return;
|
||||
}
|
||||
APPL_CRITICAL("Find extention : " << type);
|
||||
APPL_DEBUG("Find extention type: " << type);
|
||||
setHighlightType(type);
|
||||
}
|
||||
|
||||
void appl::Buffer::setHighlightType(const etk::UString& _type) {
|
||||
void appl::Buffer::setHighlightType(const std::string& _type) {
|
||||
m_highlightType = "";
|
||||
cleanHighLight();
|
||||
if (m_highlight == NULL) {
|
||||
appl::Highlight::release(m_highlight);
|
||||
}
|
||||
etk::UString resourceName = appl::highlightManager::getFileWithTypeType(_type);
|
||||
std::string resourceName = appl::highlightManager::getFileWithTypeType(_type);
|
||||
if (resourceName == "") {
|
||||
return;
|
||||
}
|
||||
@ -548,67 +539,67 @@ void appl::Buffer::regenerateHighLightAt(int32_t _pos, int32_t _nbDeleted, int32
|
||||
int32_t startId;
|
||||
int32_t stopId;
|
||||
// clean data if needed
|
||||
if (0 != m_HLDataPass1.size() != 0) {
|
||||
// find element previous
|
||||
findMainHighLightPosition(_pos, posEnd, startId, stopId, true);
|
||||
|
||||
// remove deprecated element
|
||||
if ( startId == -1
|
||||
&& stopId == -1) {
|
||||
m_HLDataPass1.clear();
|
||||
} else if (startId == -1) {
|
||||
if (stopId == 0){
|
||||
m_HLDataPass1.erase(0);
|
||||
//APPL_DEBUG("1 * Erase 0");
|
||||
} else {
|
||||
m_HLDataPass1.eraseLen(0, stopId);
|
||||
//APPL_DEBUG("2 * Erase 0->" << stopId);
|
||||
}
|
||||
} else if (stopId == -1) {
|
||||
//APPL_DEBUG("3 * Erase " << startId+1 << "-> end");
|
||||
m_HLDataPass1.eraseLen(startId+1, m_HLDataPass1.size() - startId);
|
||||
stopId = -1;
|
||||
} else {
|
||||
int32_t currentSize = m_HLDataPass1.size();
|
||||
//APPL_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
|
||||
m_HLDataPass1.eraseLen(startId+1, stopId - startId);
|
||||
if (stopId == currentSize-1) {
|
||||
stopId = -1;
|
||||
}
|
||||
}
|
||||
//APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.size()-1);
|
||||
// update position after the range position :
|
||||
int32_t elemStart;
|
||||
if (startId == -1) {
|
||||
elemStart = 0;
|
||||
} else {
|
||||
elemStart = startId+1;
|
||||
}
|
||||
for (esize_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) {
|
||||
//APPL_DEBUG("move element=" << i);
|
||||
m_HLDataPass1[iii].beginStart += _nbAdded - _nbDeleted;
|
||||
m_HLDataPass1[iii].beginStop += _nbAdded - _nbDeleted;
|
||||
m_HLDataPass1[iii].endStart += _nbAdded - _nbDeleted;
|
||||
m_HLDataPass1[iii].endStop += _nbAdded - _nbDeleted;
|
||||
}
|
||||
//Regenerate Element inside range
|
||||
if ( startId == -1
|
||||
&& stopId == -1) {
|
||||
//APPL_DEBUG("******* Regenerate ALL");
|
||||
generateHighLightAt(0, m_data.size());
|
||||
} else if(-1 == startId) {
|
||||
//APPL_DEBUG("******* Regenerate START");
|
||||
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());
|
||||
} else {
|
||||
//APPL_DEBUG("******* Regenerate RANGE");
|
||||
generateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1);
|
||||
}
|
||||
} else {
|
||||
if (m_HLDataPass1.size() == 0) {
|
||||
// Parse the new element ...
|
||||
generateHighLightAt(0, m_data.size());
|
||||
return;
|
||||
}
|
||||
// find element previous
|
||||
findMainHighLightPosition(_pos, posEnd, startId, stopId, true);
|
||||
|
||||
// remove deprecated element
|
||||
if ( startId == -1
|
||||
&& stopId == -1) {
|
||||
m_HLDataPass1.clear();
|
||||
} else if (startId == -1) {
|
||||
if (stopId == 0){
|
||||
m_HLDataPass1.erase(m_HLDataPass1.begin());
|
||||
//APPL_DEBUG("1 * Erase 0");
|
||||
} else {
|
||||
m_HLDataPass1.erase(m_HLDataPass1.begin(), m_HLDataPass1.begin()+stopId);
|
||||
//APPL_DEBUG("2 * Erase 0->" << stopId);
|
||||
}
|
||||
} else if (stopId == -1) {
|
||||
//APPL_DEBUG("3 * Erase " << startId+1 << "-> end");
|
||||
m_HLDataPass1.erase(m_HLDataPass1.begin()+startId+1, m_HLDataPass1.end());
|
||||
stopId = -1;
|
||||
} else {
|
||||
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);
|
||||
if (stopId == currentSize-1) {
|
||||
stopId = -1;
|
||||
}
|
||||
}
|
||||
//APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.size()-1);
|
||||
// update position after the range position :
|
||||
int32_t elemStart;
|
||||
if (startId == -1) {
|
||||
elemStart = 0;
|
||||
} else {
|
||||
elemStart = startId+1;
|
||||
}
|
||||
for (esize_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) {
|
||||
//APPL_DEBUG("move element=" << i);
|
||||
m_HLDataPass1[iii].beginStart += _nbAdded - _nbDeleted;
|
||||
m_HLDataPass1[iii].beginStop += _nbAdded - _nbDeleted;
|
||||
m_HLDataPass1[iii].endStart += _nbAdded - _nbDeleted;
|
||||
m_HLDataPass1[iii].endStop += _nbAdded - _nbDeleted;
|
||||
}
|
||||
//Regenerate Element inside range
|
||||
if ( startId == -1
|
||||
&& stopId == -1) {
|
||||
//APPL_DEBUG("******* Regenerate ALL");
|
||||
generateHighLightAt(0, m_data.size());
|
||||
} else if(-1 == startId) {
|
||||
//APPL_DEBUG("******* Regenerate START");
|
||||
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());
|
||||
} else {
|
||||
//APPL_DEBUG("******* Regenerate RANGE");
|
||||
generateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace appl {
|
||||
|
||||
class DisplayHLData {
|
||||
public:
|
||||
etk::Vector<appl::HighlightInfo> HLData;
|
||||
std::vector<appl::HighlightInfo> HLData;
|
||||
int32_t posHLPass1;
|
||||
int32_t posHLPass2;
|
||||
};
|
||||
@ -34,7 +34,7 @@ namespace appl {
|
||||
private:
|
||||
int64_t m_current; //!< curent Id in the Buffer
|
||||
appl::Buffer* m_data; //!< Pointer on the curent Buffer
|
||||
etk::UChar m_value; //!< store vlue to prevent multiple calcule of getting the data
|
||||
char32_t m_value; //!< store vlue to prevent multiple calcule of getting the data
|
||||
public:
|
||||
/**
|
||||
* @brief Basic itarator constructor with no link.
|
||||
@ -212,7 +212,7 @@ namespace appl {
|
||||
* @brief Get the value on the current element
|
||||
* @return The request element value
|
||||
*/
|
||||
etk::UChar operator* (void);
|
||||
char32_t operator* (void);
|
||||
/**
|
||||
* @brief Get the position in the buffer
|
||||
* @return The requested position.
|
||||
@ -268,12 +268,12 @@ namespace appl {
|
||||
Buffer(void);
|
||||
~Buffer(void);
|
||||
private:
|
||||
etk::UString m_fileName; //!< name of the file (with his path)
|
||||
std::string m_fileName; //!< name of the file (with his path)
|
||||
public:
|
||||
/**
|
||||
* @brief get the curent filename of the Buffer
|
||||
*/
|
||||
const etk::UString& getFileName(void) {
|
||||
const std::string& getFileName(void) {
|
||||
return m_fileName;
|
||||
}
|
||||
/**
|
||||
@ -281,12 +281,12 @@ namespace appl {
|
||||
* @param[in] _name name of the file.
|
||||
* @return true if file corectly opened.
|
||||
*/
|
||||
bool loadFile(const etk::UString& _name);
|
||||
bool loadFile(const std::string& _name);
|
||||
/**
|
||||
* @brief Set a file name at this buffer (no saving ...)
|
||||
* @param[in] _name name of the file.
|
||||
*/
|
||||
void setFileName(const etk::UString& _name);
|
||||
void setFileName(const std::string& _name);
|
||||
/**
|
||||
* @brief save the file in the specify path.
|
||||
* @return true is saving well done
|
||||
@ -403,7 +403,7 @@ namespace appl {
|
||||
* @param[in] _value Current value to transform
|
||||
* @param[out] _out String that represent the curent value to display
|
||||
*/
|
||||
void expand(esize_t& _indent, const etk::UChar& _value, etk::UString& _out) const;
|
||||
void expand(esize_t& _indent, const char32_t& _value, std::u32string& _out) const;
|
||||
/**
|
||||
* @brief get the start of a line with the position in the buffer.
|
||||
* @param[in] _pos position in the buffer.
|
||||
@ -423,7 +423,7 @@ namespace appl {
|
||||
* @param[out] _result Research position.
|
||||
* @return true if pos if fined.
|
||||
*/
|
||||
bool search(const Iterator& _pos, const etk::UChar& _search, Iterator& _result);
|
||||
bool search(const Iterator& _pos, const char32_t& _search, Iterator& _result);
|
||||
/**
|
||||
* @brief Search a character in the buffer in back mode.
|
||||
* @param[in] _pos Position to start the search of the element.
|
||||
@ -431,7 +431,7 @@ namespace appl {
|
||||
* @param[out] _result Research position.
|
||||
* @return true if pos if fined.
|
||||
*/
|
||||
bool searchBack(const Iterator& _pos, const etk::UChar& _search, Iterator& _result);
|
||||
bool searchBack(const Iterator& _pos, const char32_t& _search, Iterator& _result);
|
||||
/**
|
||||
* @brief find the first character of the line "nLines" forward
|
||||
* @param[in] _startPos Start position.
|
||||
@ -452,21 +452,21 @@ namespace appl {
|
||||
* @param[out] _data Output stream to copy.
|
||||
* @return true of no error occured.
|
||||
*/
|
||||
bool copy(etk::UString& _data);
|
||||
bool copy(std::string& _data);
|
||||
/**
|
||||
* @brief copy data in the _data ref value.
|
||||
* @param[out] _data Output stream to copy.
|
||||
* @param[in] _pos Position to add the data.
|
||||
* @param[in] _posEnd End position to end replace the data.
|
||||
*/
|
||||
void copy(etk::UString& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
void copy(std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
/**
|
||||
* @brief Write data at a specific position
|
||||
* @param[in] _data Data to insert in the buffer
|
||||
* @param[in] _pos Position to add the data.
|
||||
* @return true if the write is done corectly
|
||||
*/
|
||||
bool write(const etk::UString& _data, const appl::Buffer::Iterator& _pos);
|
||||
bool write(const std::string& _data, const appl::Buffer::Iterator& _pos);
|
||||
/**
|
||||
* @brief Write data at a specific position
|
||||
* @param[in] _data Data to insert in the buffer
|
||||
@ -474,7 +474,7 @@ namespace appl {
|
||||
* @param[in] _posEnd End position to end replace the data.
|
||||
* @return true if the write is done corectly
|
||||
*/
|
||||
bool replace(const etk::UString& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
public: // iterator section :
|
||||
/**
|
||||
* @brief Get an iterator an an specific position
|
||||
@ -523,10 +523,10 @@ namespace appl {
|
||||
*/
|
||||
void countNumberofLine(void);
|
||||
protected:
|
||||
etk::UString m_highlightType; //!< Name of the highlight type
|
||||
std::string m_highlightType; //!< Name of the highlight type
|
||||
|
||||
appl::Highlight* m_highlight; //!< internal link with the Highlight system
|
||||
etk::Vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
|
||||
std::vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
|
||||
public:
|
||||
/**
|
||||
* @brief Find the Highligh capability
|
||||
@ -536,12 +536,12 @@ namespace appl {
|
||||
* @brief Set type of highlight
|
||||
* @param[in] _type type of the highlight
|
||||
*/
|
||||
void setHighlightType(const etk::UString& _type);
|
||||
void setHighlightType(const std::string& _type);
|
||||
/**
|
||||
* @brief Get type of highlight
|
||||
* @return Type of the highlight
|
||||
*/
|
||||
const etk::UString& setHighlightType(void) {
|
||||
const std::string& setHighlightType(void) {
|
||||
return m_highlightType;
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ appl::BufferManager::~BufferManager(void) {
|
||||
m_list.clear();
|
||||
}
|
||||
|
||||
appl::Buffer* appl::BufferManager::get(const etk::UString& _fileName, bool _createIfNeeded) {
|
||||
appl::Buffer* appl::BufferManager::get(const std::string& _fileName, bool _createIfNeeded) {
|
||||
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
|
||||
if (m_list[iii] == NULL) {
|
||||
continue;
|
||||
@ -53,7 +53,7 @@ appl::Buffer* appl::BufferManager::get(const etk::UString& _fileName, bool _crea
|
||||
return NULL;
|
||||
}
|
||||
tmp->loadFile(_fileName);
|
||||
m_list.pushBack(tmp);
|
||||
m_list.push_back(tmp);
|
||||
return tmp;
|
||||
}
|
||||
return NULL;
|
||||
@ -72,12 +72,12 @@ void appl::BufferManager::onObjectRemove(ewol::EObject * _removeObject) {
|
||||
continue;
|
||||
}
|
||||
m_list[iii] = NULL;
|
||||
m_list.remove(iii);
|
||||
m_list.erase(m_list.begin()+iii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool appl::BufferManager::exist(const etk::UString& _fileName) {
|
||||
bool appl::BufferManager::exist(const std::string& _fileName) {
|
||||
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
|
||||
if (m_list[iii] == NULL) {
|
||||
continue;
|
||||
@ -89,7 +89,7 @@ bool appl::BufferManager::exist(const etk::UString& _fileName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void appl::BufferManager::open(const etk::UString& _fileName) {
|
||||
void appl::BufferManager::open(const std::string& _fileName) {
|
||||
if (exist(_fileName) == false) {
|
||||
(void)get(_fileName, true);
|
||||
sendMultiCast(appl::MsgSelectNewFile, _fileName);
|
||||
@ -160,7 +160,7 @@ class classBufferManager: public ewol::EObject {
|
||||
|
||||
private:
|
||||
|
||||
etk::Vector<BufferText*> listBuffer; //!< element List of the char Elements
|
||||
std::vector<BufferText*> listBuffer; //!< element List of the char Elements
|
||||
|
||||
void removeAll(void); //!< remove all buffer
|
||||
int32_t m_idSelected;
|
||||
@ -363,7 +363,7 @@ int32_t classBufferManager::create(void) {
|
||||
// allocate a new Buffer
|
||||
BufferText *myBuffer = new BufferText();
|
||||
// add at the list of element
|
||||
listBuffer.pushBack(myBuffer);
|
||||
listBuffer.push_back(myBuffer);
|
||||
int32_t basicID = listBuffer.size() - 1;
|
||||
return basicID;
|
||||
}
|
||||
@ -380,7 +380,7 @@ int32_t classBufferManager::open(etk::FSNode &myFile) {
|
||||
// allocate a new Buffer
|
||||
BufferText *myBuffer = new BufferText(myFile);
|
||||
// add at the list of element
|
||||
listBuffer.pushBack(myBuffer);
|
||||
listBuffer.push_back(myBuffer);
|
||||
return listBuffer.size() - 1;
|
||||
} else {
|
||||
// the buffer already existed == > we open it ...
|
||||
@ -510,7 +510,7 @@ int32_t classBufferManager::witchBuffer(int32_t iEmeElement) {
|
||||
}
|
||||
|
||||
|
||||
appl::Buffer* get(const etk::UString& _filename);
|
||||
appl::Buffer* get(const std::string& _filename);
|
||||
appl::Buffer* get(esize_t _bufferID);
|
||||
esize_t size(void):
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace appl {
|
||||
BufferManager(void);
|
||||
~BufferManager(void);
|
||||
private:
|
||||
etk::Vector<appl::Buffer*> m_list; // list of all buffer curently open
|
||||
std::vector<appl::Buffer*> m_list; // list of all buffer curently open
|
||||
public:
|
||||
/**
|
||||
* @brief Get a specific buffer with his name (can create a new buffer).
|
||||
@ -28,18 +28,18 @@ namespace appl {
|
||||
* @param[in] _createIfNeeded Create the buffer if not existed.
|
||||
* @return a pointer on the buffer
|
||||
*/
|
||||
appl::Buffer* get(const etk::UString& _fileName, bool _createIfNeeded=false);
|
||||
appl::Buffer* get(const std::string& _fileName, bool _createIfNeeded=false);
|
||||
/**
|
||||
* @brief Load a specific file, event if it not existed:
|
||||
* @param[in] _fileName Name of the file to open or create.
|
||||
*/
|
||||
void open(const etk::UString& _fileName);
|
||||
void open(const std::string& _fileName);
|
||||
/**
|
||||
* @brief Check if a buffer is already open.
|
||||
* @param[in] _fileName name of the file.
|
||||
* @return true if the buffer is already open.
|
||||
*/
|
||||
bool exist(const etk::UString& _fileName);
|
||||
bool exist(const std::string& _fileName);
|
||||
/**
|
||||
* @brief Get count of all buffer availlable.
|
||||
* @return Number of buffer
|
||||
|
@ -14,7 +14,7 @@
|
||||
#define __class__ "GlyphDecoration"
|
||||
|
||||
|
||||
appl::GlyphDecoration::GlyphDecoration(const etk::UString &_newColorName) :
|
||||
appl::GlyphDecoration::GlyphDecoration(const std::string &_newColorName) :
|
||||
m_colorName(_newColorName),
|
||||
m_colorFG(etk::color::black),
|
||||
m_colorBG(etk::color::none),
|
||||
|
@ -16,25 +16,25 @@ namespace appl {
|
||||
class GlyphDecoration {
|
||||
public:
|
||||
// Constructeur
|
||||
GlyphDecoration(const etk::UString& _newColorName = "no_name");
|
||||
GlyphDecoration(const std::string& _newColorName = "no_name");
|
||||
~GlyphDecoration(void) {
|
||||
// nothing to do ...
|
||||
};
|
||||
private:
|
||||
etk::UString m_colorName; //!< curent color Name
|
||||
std::string m_colorName; //!< curent color Name
|
||||
public:
|
||||
/**
|
||||
* @brief Set color name of the element.
|
||||
* @param[in] _newColorName new color name.
|
||||
*/
|
||||
void setName(const etk::UString& _newColorName) {
|
||||
void setName(const std::string& _newColorName) {
|
||||
m_colorName = _newColorName;
|
||||
};
|
||||
/**
|
||||
* @brief Get the color name.
|
||||
* @return The name of the color.
|
||||
*/
|
||||
const etk::UString& getName(void) const {
|
||||
const std::string& getName(void) const {
|
||||
return m_colorName;
|
||||
};
|
||||
private:
|
||||
@ -44,7 +44,7 @@ namespace appl {
|
||||
* @brief Set foreground color.
|
||||
* @param[in] _myColor new color description.
|
||||
*/
|
||||
void setForeground(const etk::UString& _myColor) {
|
||||
void setForeground(const std::string& _myColor) {
|
||||
m_colorFG = _myColor;
|
||||
};
|
||||
/**
|
||||
@ -68,7 +68,7 @@ namespace appl {
|
||||
* @brief Set background color.
|
||||
* @param[in] _myColor new color description.
|
||||
*/
|
||||
void setBackground(const etk::UString& _myColor) {
|
||||
void setBackground(const std::string& _myColor) {
|
||||
m_colorBG = _myColor;
|
||||
};
|
||||
/**
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
|
||||
appl::GlyphPainting::GlyphPainting(const etk::UString& _filename) :
|
||||
appl::GlyphPainting::GlyphPainting(const std::string& _filename) :
|
||||
ewol::Resource(_filename) {
|
||||
EWOL_DEBUG("SFP : load \"" << _filename << "\"");
|
||||
reload();
|
||||
@ -34,6 +34,13 @@ void appl::GlyphPainting::reload(void) {
|
||||
APPL_ERROR("Can not load file : '" << m_name << "' = " << etk::FSNode(m_name).getFileSystemName());
|
||||
return;
|
||||
}
|
||||
// for debug only :
|
||||
/*
|
||||
APPL_WARNING("Load file : '" << m_name << "' = " << etk::FSNode(m_name).getFileSystemName());
|
||||
std::string tmppppp;
|
||||
doc.generate(tmppppp);
|
||||
APPL_DEBUG(tmppppp);
|
||||
*/
|
||||
ejson::Array* baseArray = doc.getArray("ednColor");
|
||||
if (baseArray == NULL) {
|
||||
APPL_ERROR("Can not get basic array : 'ednColor'");
|
||||
@ -45,9 +52,9 @@ void appl::GlyphPainting::reload(void) {
|
||||
APPL_DEBUG(" can not get object in 'ednColor' id=" << iii);
|
||||
continue;
|
||||
}
|
||||
etk::UString name = tmpObj->getStringValue("name", "");
|
||||
etk::UString background = tmpObj->getStringValue("background", "#FFF0");
|
||||
etk::UString foreground = tmpObj->getStringValue("foreground", "#000F");
|
||||
std::string name = tmpObj->getStringValue("name", "");
|
||||
std::string background = tmpObj->getStringValue("background", "#FFF0");
|
||||
std::string foreground = tmpObj->getStringValue("foreground", "#000F");
|
||||
bool italic = tmpObj->getBooleanValue("italic", false);
|
||||
bool bold = tmpObj->getBooleanValue("bold", false);
|
||||
APPL_VERBOSE("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'");
|
||||
@ -70,12 +77,12 @@ void appl::GlyphPainting::reload(void) {
|
||||
tmpDeco.setBackground(background);
|
||||
tmpDeco.setItalic(italic);
|
||||
tmpDeco.setBold(bold);
|
||||
m_list.pushBack(tmpDeco);
|
||||
m_list.push_back(tmpDeco);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esize_t appl::GlyphPainting::request(const etk::UString& _name) {
|
||||
esize_t appl::GlyphPainting::request(const std::string& _name) {
|
||||
for (esize_t iii=0; iii<m_list.size(); ++iii) {
|
||||
if (m_list[iii].getName() == _name) {
|
||||
return iii;
|
||||
@ -83,11 +90,11 @@ esize_t appl::GlyphPainting::request(const etk::UString& _name) {
|
||||
}
|
||||
// create an empty deco ...
|
||||
appl::GlyphDecoration tmpDeco(_name);
|
||||
m_list.pushBack(tmpDeco);
|
||||
m_list.push_back(tmpDeco);
|
||||
return m_list.size()-1;
|
||||
}
|
||||
|
||||
appl::GlyphPainting* appl::GlyphPainting::keep(const etk::UString& _filename) {
|
||||
appl::GlyphPainting* appl::GlyphPainting::keep(const std::string& _filename) {
|
||||
//EWOL_INFO("KEEP : appl::GlyphPainting : file : \"" << _filename << "\"");
|
||||
appl::GlyphPainting* object = static_cast<appl::GlyphPainting*>(getManager().localKeep(_filename));
|
||||
if (NULL != object) {
|
||||
|
@ -17,9 +17,9 @@
|
||||
namespace appl {
|
||||
class GlyphPainting : public ewol::Resource {
|
||||
private:
|
||||
etk::Vector<appl::GlyphDecoration> m_list;
|
||||
std::vector<appl::GlyphDecoration> m_list;
|
||||
protected:
|
||||
GlyphPainting(const etk::UString& _filename);
|
||||
GlyphPainting(const std::string& _filename);
|
||||
virtual ~GlyphPainting(void);
|
||||
public:
|
||||
const char* getType(void) {
|
||||
@ -34,7 +34,7 @@ namespace appl {
|
||||
* @param[in] _name Name of the deco.
|
||||
* @return id of the deco.
|
||||
*/
|
||||
esize_t request(const etk::UString& _name);
|
||||
esize_t request(const std::string& _name);
|
||||
/**
|
||||
* @brief Get Decoration handle.
|
||||
* @param[in] _id Id of the decoration.
|
||||
@ -58,7 +58,7 @@ namespace appl {
|
||||
* @param[in] _filename Name of the configuration file.
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
*/
|
||||
static appl::GlyphPainting* keep(const etk::UString& _filename);
|
||||
static appl::GlyphPainting* keep(const std::string& _filename);
|
||||
/**
|
||||
* @brief release the keeped resources
|
||||
* @param[in,out] reference on the object pointer
|
||||
|
@ -17,8 +17,8 @@
|
||||
#undef __class__
|
||||
#define __class__ "BufferView"
|
||||
|
||||
static void SortElementList(etk::Vector<appl::dataBufferStruct*>& _list) {
|
||||
etk::Vector<appl::dataBufferStruct *> tmpList = _list;
|
||||
static void SortElementList(std::vector<appl::dataBufferStruct*>& _list) {
|
||||
std::vector<appl::dataBufferStruct *> tmpList = _list;
|
||||
_list.clear();
|
||||
for(int32_t iii=0; iii<tmpList.size(); iii++) {
|
||||
if (NULL == tmpList[iii]) {
|
||||
@ -35,7 +35,7 @@ static void SortElementList(etk::Vector<appl::dataBufferStruct*>& _list) {
|
||||
}
|
||||
}
|
||||
//EWOL_DEBUG("position="<<findPos);
|
||||
_list.insert(findPos, tmpList[iii]);
|
||||
_list.insert(_list.begin()+findPos, tmpList[iii]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
APPL_ERROR("Allocation error of the tmp buffer list element");
|
||||
return;
|
||||
}
|
||||
m_list.pushBack(tmp);
|
||||
m_list.push_back(tmp);
|
||||
markToRedraw();
|
||||
return;
|
||||
}
|
||||
@ -140,7 +140,7 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
etk::FSNode name = tmpBuffer->getFileName();
|
||||
appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify);
|
||||
if (NULL != tmpElement) {
|
||||
m_list.pushBack(tmpElement);
|
||||
m_list.push_back(tmpElement);
|
||||
} else {
|
||||
APPL_ERROR("Allocation error of the tmp buffer list element");
|
||||
}
|
||||
@ -175,7 +175,7 @@ void BufferView::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
if (m_list[iii]->m_buffer != _removeObject) {
|
||||
continue;
|
||||
}
|
||||
m_list.remove(iii);
|
||||
m_list.erase(m_list.begin()+iii);
|
||||
markToRedraw();
|
||||
return;
|
||||
}
|
||||
@ -190,7 +190,7 @@ uint32_t BufferView::getNuberOfColomn(void) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool BufferView::getTitle(int32_t _colomn, etk::UString &_myTitle, etk::Color<> &_fg, etk::Color<> &_bg) {
|
||||
bool BufferView::getTitle(int32_t _colomn, std::string &_myTitle, etk::Color<> &_fg, etk::Color<> &_bg) {
|
||||
_myTitle = "Buffers : ";
|
||||
return true;
|
||||
}
|
||||
@ -199,7 +199,7 @@ uint32_t BufferView::getNuberOfRaw(void) {
|
||||
return m_list.size();
|
||||
}
|
||||
|
||||
bool BufferView::getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
bool BufferView::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
if( _raw >= 0
|
||||
&& _raw<m_list.size()
|
||||
&& NULL != m_list[_raw]) {
|
||||
|
@ -22,7 +22,7 @@ namespace appl
|
||||
public:
|
||||
etk::FSNode m_bufferName;
|
||||
appl::Buffer* m_buffer;
|
||||
dataBufferStruct(const etk::UString& _bufferName, appl::Buffer* _buffer) :
|
||||
dataBufferStruct(const std::string& _bufferName, appl::Buffer* _buffer) :
|
||||
m_bufferName(_bufferName),
|
||||
m_buffer(_buffer) {
|
||||
|
||||
@ -45,7 +45,7 @@ class BufferView : public widget::List
|
||||
private:
|
||||
int32_t m_selectedIdRequested;
|
||||
int32_t m_selectedID;
|
||||
etk::Vector<appl::dataBufferStruct*> m_list;
|
||||
std::vector<appl::dataBufferStruct*> m_list;
|
||||
public:
|
||||
// Constructeur
|
||||
BufferView(void);
|
||||
@ -61,9 +61,9 @@ class BufferView : public widget::List
|
||||
void removeAllElement(void);
|
||||
// Derived function
|
||||
virtual uint32_t getNuberOfColomn(void);
|
||||
virtual bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
virtual bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
virtual uint32_t getNuberOfRaw(void);
|
||||
virtual bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
virtual bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
virtual bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
||||
};
|
||||
|
||||
|
@ -34,14 +34,14 @@
|
||||
|
||||
namespace appl
|
||||
{
|
||||
etk::UString getVersion(void)
|
||||
std::string getVersion(void)
|
||||
{
|
||||
#define FIRST_YEAR (2010)
|
||||
etk::UString tmpOutput = (date::getYear()-FIRST_YEAR);
|
||||
std::string tmpOutput = std::to_string(date::getYear()-FIRST_YEAR);
|
||||
tmpOutput += ".";
|
||||
tmpOutput += date::getMonth();
|
||||
tmpOutput += std::to_string(date::getMonth());
|
||||
tmpOutput += ".";
|
||||
tmpOutput += date::getDay();
|
||||
tmpOutput += std::to_string(date::getDay());
|
||||
return tmpOutput;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ class ParameterAboutGui : public widget::Sizer {
|
||||
mySpacer->setExpand(bvec2(true,true));
|
||||
subWidgetAdd(mySpacer);
|
||||
}
|
||||
etk::UString tmpLabel = "<left>";
|
||||
std::string tmpLabel = "<left>";
|
||||
tmpLabel += " <b>Editeur De N'ours</b> : v:";
|
||||
tmpLabel += appl::getVersion();
|
||||
tmpLabel += "<br/>";
|
||||
@ -239,7 +239,7 @@ MainWindows::MainWindows(void) {
|
||||
|
||||
|
||||
// add generic shortcut ...
|
||||
// (shift, control, alt, meta, etk::UChar unicodeValue, const char * generateEventId, etk::UString& data)
|
||||
// (shift, control, alt, meta, char32_t unicodeValue, const char * generateEventId, std::string& data)
|
||||
shortCutAdd("ctrl+o", ednMsgGuiOpen, "", true);
|
||||
shortCutAdd("ctrl+n", ednMsgGuiNew, "", true);
|
||||
|
||||
@ -322,7 +322,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
return;
|
||||
}
|
||||
if (_msg.getData().toLower() == "current") {
|
||||
if (to_lower(_msg.getData()) == "current") {
|
||||
appl::Buffer* tmpBuffer = m_bufferManager->getBufferSelected();
|
||||
if (tmpBuffer == NULL) {
|
||||
APPL_WARNING("No buffer selected !!! ");
|
||||
@ -340,7 +340,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
APPL_ERROR("can not save the file !!! '" << tmpBuffer->getFileName() << "'");
|
||||
}
|
||||
return;
|
||||
} else if (_msg.getData().toLower() == "all") {
|
||||
} else if (to_lower(_msg.getData()) == "all") {
|
||||
APPL_TODO("Need to save all the buffers ... ");
|
||||
for (esize_t iii=0; iii < m_bufferManager->size(); ++iii) {
|
||||
appl::Buffer* tmpBuffer = m_bufferManager->get(iii);
|
||||
@ -386,8 +386,8 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
} else {
|
||||
tmpWidget->setTitle("Save files As...");
|
||||
tmpWidget->setValidateLabel("Save");
|
||||
etk::UString folder = "/home/";
|
||||
etk::UString fileName = "";
|
||||
std::string folder = "/home/";
|
||||
std::string fileName = "";
|
||||
if (true == myBuffer->haveName()) {
|
||||
etk::FSNode tmpName = myBuffer->getFileName();
|
||||
folder = tmpName.getNameFolder();
|
||||
@ -403,7 +403,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
}
|
||||
} else if (_msg.getMessage() == ednEventPopUpFileSaveAs) {
|
||||
// get the filename :
|
||||
etk::UString tmpData = _msg.getData();
|
||||
std::string tmpData = _msg.getData();
|
||||
APPL_DEBUG("Request Saving As file : " << tmpData);
|
||||
/*
|
||||
BufferManager::get(m_currentSavingAsIdBuffer)->setFileName(tmpData);
|
||||
@ -417,14 +417,14 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
if (NULL != tmpBuffer) {
|
||||
etk::FSNode compleateName = tmpBuffer->getFileName();
|
||||
bool isModify = tmpBuffer->isModify();
|
||||
etk::UString directName = compleateName.getName();
|
||||
std::string directName = compleateName.getName();
|
||||
if (true == isModify) {
|
||||
directName += " *";
|
||||
}
|
||||
if (NULL != m_widgetLabelFileName) {
|
||||
m_widgetLabelFileName->setLabel(etk::UString("<left>") + directName + "</left>");
|
||||
m_widgetLabelFileName->setLabel(std::string("<left>") + directName + "</left>");
|
||||
}
|
||||
etk::UString windowsTitle = "edn - ";
|
||||
std::string windowsTitle = "edn - ";
|
||||
windowsTitle += directName;
|
||||
setTitle(windowsTitle);
|
||||
return;
|
||||
|
@ -14,13 +14,13 @@
|
||||
#define __class__ "SearchData"
|
||||
|
||||
|
||||
static etk::UString m_findRequest = "";
|
||||
static std::string m_findRequest = "";
|
||||
|
||||
void SearchData::setSearch(const etk::UString &myData)
|
||||
void SearchData::setSearch(const std::string &myData)
|
||||
{
|
||||
m_findRequest = myData;
|
||||
}
|
||||
void SearchData::getSearch(etk::UString &myData)
|
||||
void SearchData::getSearch(std::string &myData)
|
||||
{
|
||||
myData = m_findRequest;
|
||||
}
|
||||
@ -32,12 +32,12 @@ bool SearchData::isSearchEmpty(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static etk::UString m_replaceRequest = "";
|
||||
void SearchData::setReplace(const etk::UString &myData)
|
||||
static std::string m_replaceRequest = "";
|
||||
void SearchData::setReplace(const std::string &myData)
|
||||
{
|
||||
m_replaceRequest = myData;
|
||||
}
|
||||
void SearchData::getReplace(etk::UString &myData)
|
||||
void SearchData::getReplace(std::string &myData)
|
||||
{
|
||||
myData = m_replaceRequest;
|
||||
}
|
||||
|
@ -14,11 +14,11 @@
|
||||
|
||||
namespace SearchData
|
||||
{
|
||||
void setSearch(const etk::UString &myData);
|
||||
void getSearch(etk::UString &myData);
|
||||
void setSearch(const std::string &myData);
|
||||
void getSearch(std::string &myData);
|
||||
bool isSearchEmpty(void);
|
||||
void setReplace(const etk::UString &myData);
|
||||
void getReplace(etk::UString &myData);
|
||||
void setReplace(const std::string &myData);
|
||||
void getReplace(std::string &myData);
|
||||
bool isReplaceEmpty(void);
|
||||
void setCase(bool value);
|
||||
bool getCase(void);
|
||||
|
@ -41,7 +41,7 @@ uint32_t appl::TagFileList::getNuberOfColomn(void) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool appl::TagFileList::getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
bool appl::TagFileList::getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
_myTitle = "title";
|
||||
return true;
|
||||
}
|
||||
@ -50,10 +50,10 @@ uint32_t appl::TagFileList::getNuberOfRaw(void) {
|
||||
return m_list.size();
|
||||
}
|
||||
|
||||
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
if (_raw >= 0 && _raw < m_list.size() && NULL != m_list[_raw]) {
|
||||
if (0 == _colomn) {
|
||||
_myTextToWrite = etk::UString(m_list[_raw]->fileLine);
|
||||
_myTextToWrite = std::to_string(m_list[_raw]->fileLine);
|
||||
} else {
|
||||
_myTextToWrite = m_list[_raw]->filename;
|
||||
}
|
||||
@ -102,7 +102,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::keyEvent::statu
|
||||
if( m_selectedLine >= 0
|
||||
&& m_selectedLine < m_list.size()
|
||||
&& NULL != m_list[m_selectedLine] ) {
|
||||
generateEventId(event, etk::UString(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
||||
generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
||||
} else {
|
||||
generateEventId(applEventCtagsListUnSelect);
|
||||
}
|
||||
@ -120,10 +120,10 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::keyEvent::statu
|
||||
* @param[in] file Compleate file name
|
||||
* @param[in] jump line id
|
||||
*/
|
||||
void appl::TagFileList::add(etk::UString& _file, int32_t _line) {
|
||||
void appl::TagFileList::add(std::string& _file, int32_t _line) {
|
||||
appl::TagListElement *tmpFile = new appl::TagListElement(_file, _line);
|
||||
if (NULL != tmpFile) {
|
||||
m_list.pushBack(tmpFile);
|
||||
m_list.push_back(tmpFile);
|
||||
}
|
||||
markToRedraw();
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ extern const char * const applEventCtagsListUnSelect;
|
||||
namespace appl {
|
||||
class TagListElement {
|
||||
public:
|
||||
etk::UString filename;
|
||||
std::string filename;
|
||||
int32_t fileLine;
|
||||
TagListElement(etk::UString& _file, int32_t _line) :
|
||||
TagListElement(std::string& _file, int32_t _line) :
|
||||
filename(_file),
|
||||
fileLine(_line) {
|
||||
|
||||
@ -34,16 +34,16 @@ namespace appl {
|
||||
class TagFileList : public widget::List {
|
||||
private:
|
||||
int32_t m_selectedLine;
|
||||
etk::Vector<appl::TagListElement*> m_list;
|
||||
std::vector<appl::TagListElement*> m_list;
|
||||
public:
|
||||
TagFileList(void);
|
||||
~TagFileList(void);
|
||||
// display API :
|
||||
virtual etk::Color<> getBasicBG(void);
|
||||
uint32_t getNuberOfColomn(void);
|
||||
bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
uint32_t getNuberOfRaw(void);
|
||||
bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
||||
// derived function
|
||||
const char * const getObjectType(void) {
|
||||
@ -55,7 +55,7 @@ namespace appl {
|
||||
* @param[in] file Compleate file name
|
||||
* @param[in] jump line id
|
||||
*/
|
||||
void add(etk::UString& _file, int32_t _line);
|
||||
void add(std::string& _file, int32_t _line);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -159,7 +159,7 @@ void appl::TagFileSelection::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
* @param[in] file Compleate file name
|
||||
* @param[in] jump line id
|
||||
*/
|
||||
void appl::TagFileSelection::addCtagsNewItem(etk::UString _file, int32_t _line) {
|
||||
void appl::TagFileSelection::addCtagsNewItem(std::string _file, int32_t _line) {
|
||||
if (NULL != m_listTag) {
|
||||
m_listTag->add(_file, _line);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace appl {
|
||||
class TagFileSelection : public widget::PopUp {
|
||||
private:
|
||||
appl::TagFileList* m_listTag;
|
||||
etk::UString m_eventNamed;
|
||||
std::string m_eventNamed;
|
||||
public:
|
||||
TagFileSelection(void);
|
||||
virtual ~TagFileSelection(void);
|
||||
@ -29,7 +29,7 @@ namespace appl {
|
||||
* @param[in] file Compleate file name
|
||||
* @param[in] jump line id
|
||||
*/
|
||||
void addCtagsNewItem(etk::UString file, int32_t line);
|
||||
void addCtagsNewItem(std::string file, int32_t line);
|
||||
public: // herited function
|
||||
const char * const getObjectType(void) { return "EwolFileChooser"; };
|
||||
void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
|
@ -21,7 +21,7 @@
|
||||
#undef __class__
|
||||
#define __class__ "TextViewer"
|
||||
|
||||
appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) :
|
||||
appl::TextViewer::TextViewer(const std::string& _fontName, int32_t _fontSize) :
|
||||
m_buffer(NULL),
|
||||
m_displayText(_fontName, _fontSize),
|
||||
m_insertMode(false) {
|
||||
@ -109,7 +109,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
||||
m_maxSize.setY(256);
|
||||
m_displayText.setTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft);
|
||||
m_displayText.setRelPos(vec3(10, 0, 0));
|
||||
etk::UString tmpString("<br/>\n"
|
||||
std::string tmpString("<br/>\n"
|
||||
"<font color=\"red\">\n"
|
||||
" <b>\n"
|
||||
" edn - Editeur De N'ours\n"
|
||||
@ -137,7 +137,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
||||
float countNbLine = 1;
|
||||
esize_t countColomn = 0;
|
||||
// the siplay string :
|
||||
etk::UString stringToDisplay;
|
||||
std::u32string stringToDisplay;
|
||||
esize_t bufferElementSize = 0;
|
||||
bool isSelect = false;
|
||||
appl::Buffer::Iterator selectPosStart = m_buffer->begin();
|
||||
@ -166,7 +166,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
||||
}
|
||||
// Display line number :
|
||||
m_lastOffsetDisplay = 0;
|
||||
vec3 tmpLetterSize = m_displayText.calculateSize((etk::UChar)'A');
|
||||
vec3 tmpLetterSize = m_displayText.calculateSize((char32_t)'A');
|
||||
{
|
||||
esize_t nbLine = m_buffer->getNumberOfLines();
|
||||
float nbLineCalc = nbLine;
|
||||
@ -277,7 +277,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
||||
}
|
||||
// set maximum size (X&Y) :
|
||||
{
|
||||
vec3 tmpLetterSize = m_displayText.calculateSize((etk::UChar)'A');
|
||||
vec3 tmpLetterSize = m_displayText.calculateSize((char32_t)'A');
|
||||
esize_t nbLines = m_buffer->getNumberOfLines();
|
||||
m_maxSize.setX(maxSizeX+m_originScrooled.x());
|
||||
m_maxSize.setY((float)nbLines*tmpLetterSize.y());
|
||||
@ -302,7 +302,7 @@ bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) {
|
||||
if (_event.getStatus() != ewol::keyEvent::statusDown) {
|
||||
return false;
|
||||
}
|
||||
etk::UChar localValue = _event.getChar();
|
||||
char32_t localValue = _event.getChar();
|
||||
if (localValue == etk::UChar::Return) {
|
||||
if (true == _event.getSpecialKey().isSetShift()) {
|
||||
localValue = etk::UChar::CarrierReturn;
|
||||
@ -333,15 +333,16 @@ bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) {
|
||||
m_buffer->setSelectMode(false);
|
||||
// normal adding char ...
|
||||
char output[5];
|
||||
int32_t nbElement = localValue.getUtf8(output);
|
||||
int32_t nbElement = etk::getUtf8(localValue, output);
|
||||
if ( m_buffer->hasTextSelected() == false
|
||||
&& _event.getSpecialKey().isSetInsert() == true) {
|
||||
appl::Buffer::Iterator pos = m_buffer->cursor();
|
||||
appl::Buffer::Iterator posEnd = pos;
|
||||
++posEnd;
|
||||
replace(localValue, pos, posEnd);
|
||||
replace(output, pos, posEnd);
|
||||
//TODO : choisce UTF ... replace(localValue, pos, posEnd);
|
||||
} else {
|
||||
etk::UString myString = output;
|
||||
std::string myString = output;
|
||||
write(myString);
|
||||
}
|
||||
return true;
|
||||
@ -492,11 +493,11 @@ void appl::TextViewer::mouseEventTriple(void) {
|
||||
}
|
||||
|
||||
appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativePos) {
|
||||
etk::UChar currentValue;
|
||||
char32_t currentValue;
|
||||
vec3 positionCurentDisplay(0,0,0);
|
||||
vec3 tmpLetterSize = m_displayText.calculateSize((etk::UChar)'A');
|
||||
vec3 tmpLetterSize = m_displayText.calculateSize((char32_t)'A');
|
||||
esize_t countColomn = 0;
|
||||
etk::UString stringToDisplay;
|
||||
std::u32string stringToDisplay;
|
||||
m_displayText.clear();
|
||||
m_displayText.forceLineReturn();
|
||||
for (appl::Buffer::Iterator it = m_buffer->begin();
|
||||
@ -532,7 +533,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
|
||||
|
||||
void appl::TextViewer::onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
if (m_buffer != NULL) {
|
||||
etk::UString data = ewol::clipBoard::get(_clipboardID);
|
||||
std::string data = ewol::clipBoard::get(_clipboardID);
|
||||
write(data);
|
||||
}
|
||||
markToRedraw();
|
||||
@ -602,7 +603,7 @@ void appl::TextViewer::setFontSize(int32_t _size) {
|
||||
setScrollingSize(_size*3.0*1.46); // 1.46 is a magic number ...
|
||||
}
|
||||
|
||||
void appl::TextViewer::setFontName(const etk::UString& _fontName) {
|
||||
void appl::TextViewer::setFontName(const std::string& _fontName) {
|
||||
m_displayText.setFontName(_fontName);
|
||||
}
|
||||
|
||||
@ -618,7 +619,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool appl::TextViewer::write(const etk::UString& _data) {
|
||||
bool appl::TextViewer::write(const std::string& _data) {
|
||||
if (m_buffer == NULL) {
|
||||
return false;
|
||||
}
|
||||
@ -628,7 +629,7 @@ bool appl::TextViewer::write(const etk::UString& _data) {
|
||||
return write(_data, m_buffer->cursor());
|
||||
}
|
||||
|
||||
bool appl::TextViewer::write(const etk::UString& _data, const appl::Buffer::Iterator& _pos) {
|
||||
bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer == NULL) {
|
||||
return false;
|
||||
}
|
||||
@ -642,7 +643,7 @@ bool appl::TextViewer::write(const etk::UString& _data, const appl::Buffer::Iter
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool appl::TextViewer::replace(const etk::UString& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
if (m_buffer == NULL) {
|
||||
return false;
|
||||
}
|
||||
@ -656,7 +657,7 @@ bool appl::TextViewer::replace(const etk::UString& _data, const appl::Buffer::It
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool appl::TextViewer::replace(const etk::UString& _data) {
|
||||
bool appl::TextViewer::replace(const std::string& _data) {
|
||||
if (m_buffer == NULL) {
|
||||
return false;
|
||||
}
|
||||
@ -788,9 +789,9 @@ void appl::TextViewer::moveCursorDown(esize_t _nbLine) {
|
||||
|
||||
// TODO : Rename ...
|
||||
appl::Buffer::Iterator appl::TextViewer::getPosSize(const appl::Buffer::Iterator& _startLinePos, float _distance) {
|
||||
etk::UChar currentValue;
|
||||
char32_t currentValue;
|
||||
esize_t countColomn = 0;
|
||||
etk::UString stringToDisplay;
|
||||
std::u32string stringToDisplay;
|
||||
m_displayText.clear();
|
||||
m_displayText.forceLineReturn();
|
||||
for (appl::Buffer::Iterator it = _startLinePos;
|
||||
@ -816,9 +817,9 @@ appl::Buffer::Iterator appl::TextViewer::getPosSize(const appl::Buffer::Iterator
|
||||
// TODO : Rename ...
|
||||
float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePos, const appl::Buffer::Iterator& _stopPos) {
|
||||
float ret = 0;
|
||||
etk::UChar currentValue;
|
||||
char32_t currentValue;
|
||||
esize_t countColomn = 0;
|
||||
etk::UString stringToDisplay;
|
||||
std::u32string stringToDisplay;
|
||||
m_displayText.clear();
|
||||
|
||||
for (appl::Buffer::Iterator it = _startLinePos;
|
||||
|
@ -42,7 +42,7 @@ namespace appl {
|
||||
private:
|
||||
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
||||
public:
|
||||
TextViewer(const etk::UString& _fontName="", int32_t _fontSize=-1);
|
||||
TextViewer(const std::string& _fontName="", int32_t _fontSize=-1);
|
||||
virtual ~TextViewer(void);
|
||||
private:
|
||||
appl::Buffer* m_buffer; //!< pointer on the current buffer to display (can be null if the buffer is remover or in state of changing buffer)
|
||||
@ -50,7 +50,7 @@ namespace appl {
|
||||
ewol::Drawing m_displayDrawing; //!< Other diaplay requested.
|
||||
public:
|
||||
void setFontSize(int32_t _size);
|
||||
void setFontName(const etk::UString& _fontName);
|
||||
void setFontName(const std::string& _fontName);
|
||||
protected: // derived function
|
||||
virtual void onDraw(void);
|
||||
public: // Derived function
|
||||
@ -73,10 +73,10 @@ namespace appl {
|
||||
public:
|
||||
// TODO : Doc : write data on buffer
|
||||
bool moveCursor(const appl::Buffer::Iterator& _pos);
|
||||
bool write(const etk::UString& _data);
|
||||
bool write(const etk::UString& _data, const appl::Buffer::Iterator& _pos);
|
||||
bool replace(const etk::UString& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
bool replace(const etk::UString& _data);
|
||||
bool write(const std::string& _data);
|
||||
bool write(const std::string& _data, const appl::Buffer::Iterator& _pos);
|
||||
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
bool replace(const std::string& _data);
|
||||
void remove(void);
|
||||
|
||||
|
||||
|
@ -18,17 +18,17 @@
|
||||
|
||||
|
||||
void appl::Highlight::parseRules(exml::Element* _child,
|
||||
etk::Vector<HighlightPattern*>& _mListPatern,
|
||||
std::vector<HighlightPattern*>& _mListPatern,
|
||||
int32_t _level) {
|
||||
// Create the patern ...
|
||||
HighlightPattern *myPattern = new HighlightPattern(m_paintingProperties);
|
||||
// parse under Element
|
||||
myPattern->parseRules(_child, _level);
|
||||
// add element in the list
|
||||
_mListPatern.pushBack(myPattern);
|
||||
_mListPatern.push_back(myPattern);
|
||||
}
|
||||
|
||||
appl::Highlight::Highlight(const etk::UString& _xmlFilename, const etk::UString& _colorFile) :
|
||||
appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _colorFile) :
|
||||
ewol::Resource(_xmlFilename),
|
||||
m_typeName("") {
|
||||
// keep color propertiy file :
|
||||
@ -55,10 +55,10 @@ appl::Highlight::Highlight(const etk::UString& _xmlFilename, const etk::UString&
|
||||
continue;
|
||||
}
|
||||
if (child->getValue() == "ext") {
|
||||
etk::UString myData = child->getText();
|
||||
std::string myData = child->getText();
|
||||
if (myData.size()!=0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
|
||||
m_listExtentions.pushBack(myData);
|
||||
m_listExtentions.push_back(myData);
|
||||
}
|
||||
} else if (child->getValue() == "pass1") {
|
||||
// get sub Nodes ...
|
||||
@ -107,17 +107,19 @@ appl::Highlight::~Highlight(void) {
|
||||
m_listExtentions.clear();
|
||||
}
|
||||
|
||||
bool appl::Highlight::hasExtention(const etk::UString& _ext) {
|
||||
bool appl::Highlight::hasExtention(const std::string& _ext) {
|
||||
for (int32_t iii=0; iii<m_listExtentions.size(); iii++) {
|
||||
if (m_listExtentions[iii] == _ext) {
|
||||
APPL_VERBOSE(" check : " << m_listExtentions[iii] << "=?=" << _ext);
|
||||
if ( m_listExtentions[iii] == "*." + _ext
|
||||
|| m_listExtentions[iii] == _ext) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool appl::Highlight::fileNameCompatible(const etk::UString& _fileName) {
|
||||
etk::UString extention;
|
||||
bool appl::Highlight::fileNameCompatible(const std::string& _fileName) {
|
||||
std::string extention;
|
||||
etk::FSNode file(_fileName);
|
||||
if (true == file.fileHasExtention() ) {
|
||||
extention = "*.";
|
||||
@ -158,7 +160,7 @@ void appl::Highlight::display(void) {
|
||||
*/
|
||||
void appl::Highlight::parse(int32_t start,
|
||||
int32_t stop,
|
||||
etk::Vector<appl::HighlightInfo> &metaData,
|
||||
std::vector<appl::HighlightInfo> &metaData,
|
||||
int32_t addingPos,
|
||||
etk::Buffer &buffer) {
|
||||
if (0 > addingPos) {
|
||||
@ -184,7 +186,8 @@ void appl::Highlight::parse(int32_t start,
|
||||
if (metaData[kkk].beginStart <= resultat.endStop) {
|
||||
// remove element
|
||||
//APPL_INFO("Erase element=" << kkk);
|
||||
metaData.eraseLen(kkk, kkk+1);
|
||||
// TODO : maybe an error here ...
|
||||
metaData.erase(metaData.begin()+kkk, metaData.begin()+kkk*2+1);
|
||||
// Increase the end of search
|
||||
if (kkk < metaData.size()) {
|
||||
// just befor the end of the next element
|
||||
@ -199,7 +202,7 @@ void appl::Highlight::parse(int32_t start,
|
||||
}
|
||||
}
|
||||
// add curent element in the list ...
|
||||
metaData.insert(addingPos, resultat);
|
||||
metaData.insert(metaData.begin()+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;
|
||||
@ -221,7 +224,7 @@ void appl::Highlight::parse(int32_t start,
|
||||
*/
|
||||
void appl::Highlight::parse2(int32_t start,
|
||||
int32_t stop,
|
||||
etk::Vector<appl::HighlightInfo> &metaData,
|
||||
std::vector<appl::HighlightInfo> &metaData,
|
||||
etk::Buffer &buffer) {
|
||||
//APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " == > position search: (" << start << "," << stop << ")" );
|
||||
int32_t elementStart = start;
|
||||
@ -239,7 +242,7 @@ void appl::Highlight::parse2(int32_t start,
|
||||
if (HLP_FIND_ERROR != ret) {
|
||||
//APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
|
||||
// add curent element in the list ...
|
||||
metaData.pushBack(resultat);
|
||||
metaData.push_back(resultat);
|
||||
elementStart = resultat.endStop-1;
|
||||
// Exit current cycle
|
||||
break;
|
||||
@ -250,7 +253,7 @@ void appl::Highlight::parse2(int32_t start,
|
||||
}
|
||||
}
|
||||
|
||||
appl::Highlight* appl::Highlight::keep(const etk::UString& _filename) {
|
||||
appl::Highlight* appl::Highlight::keep(const std::string& _filename) {
|
||||
//EWOL_INFO("KEEP : appl::Highlight : file : \"" << _filename << "\"");
|
||||
appl::Highlight* object = static_cast<appl::Highlight*>(getManager().localKeep(_filename));
|
||||
if (NULL != object) {
|
||||
|
@ -37,35 +37,35 @@ namespace appl {
|
||||
appl::GlyphPainting* m_paintingProperties;
|
||||
protected:
|
||||
// Constructeur
|
||||
Highlight(const etk::UString& _xmlFilename, const etk::UString& _colorFile);
|
||||
Highlight(const std::string& _xmlFilename, const std::string& _colorFile);
|
||||
~Highlight(void);
|
||||
private:
|
||||
etk::UString m_typeName; //!< descriptive string type like "C/C++"
|
||||
std::string m_typeName; //!< descriptive string type like "C/C++"
|
||||
public:
|
||||
const etk::UString& getTypeName(void) {
|
||||
const std::string& getTypeName(void) {
|
||||
return m_typeName;
|
||||
}
|
||||
public:
|
||||
bool hasExtention(const etk::UString& _ext);
|
||||
bool fileNameCompatible(const etk::UString& _fileName);
|
||||
bool hasExtention(const std::string& _ext);
|
||||
bool fileNameCompatible(const std::string& _fileName);
|
||||
void display(void);
|
||||
void parse(int32_t _start,
|
||||
int32_t _stop,
|
||||
etk::Vector<appl::HighlightInfo> &_metaData,
|
||||
std::vector<appl::HighlightInfo> &_metaData,
|
||||
int32_t _addingPos,
|
||||
etk::Buffer &_buffer);
|
||||
void parse2(int32_t _start,
|
||||
int32_t _stop,
|
||||
etk::Vector<appl::HighlightInfo> &_metaData,
|
||||
std::vector<appl::HighlightInfo> &_metaData,
|
||||
etk::Buffer &_buffer);
|
||||
private:
|
||||
void parseRules(exml::Element* _child,
|
||||
etk::Vector<HighlightPattern*> &_mListPatern,
|
||||
std::vector<HighlightPattern*> &_mListPatern,
|
||||
int32_t _level);
|
||||
etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
|
||||
etk::Vector<etk::UString> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
|
||||
etk::Vector<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer)
|
||||
etk::Vector<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) )
|
||||
std::string m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
|
||||
std::vector<std::string> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
|
||||
std::vector<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer)
|
||||
std::vector<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) )
|
||||
public:
|
||||
/**
|
||||
* @brief keep the resource pointer.
|
||||
@ -73,7 +73,7 @@ namespace appl {
|
||||
* @param[in] _filename Name of the configuration file.
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
*/
|
||||
static appl::Highlight* keep(const etk::UString& _filename);
|
||||
static appl::Highlight* keep(const std::string& _filename);
|
||||
/**
|
||||
* @brief release the keeped resources
|
||||
* @param[in,out] reference on the object pointer
|
||||
|
@ -15,21 +15,21 @@
|
||||
#undef __class__
|
||||
#define __class__ "highlightManager"
|
||||
|
||||
static etk::Vector<appl::Highlight*>& s_list(void) {
|
||||
static etk::Vector<appl::Highlight*> list;
|
||||
static std::vector<appl::Highlight*>& s_list(void) {
|
||||
static std::vector<appl::Highlight*> list;
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
void appl::highlightManager::init(void) {
|
||||
etk::Vector<appl::Highlight*>& hlList = s_list();
|
||||
std::vector<appl::Highlight*>& hlList = s_list();
|
||||
if (hlList.size() != 0) {
|
||||
APPL_ERROR("HighlightManager == > already exist, just unlink the previous ...");
|
||||
hlList.clear();
|
||||
}
|
||||
etk::FSNode myFile("DATA:languages/");
|
||||
// get the subfolder list :
|
||||
etk::Vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
|
||||
std::vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
|
||||
for (esize_t iii = 0; iii < list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -37,11 +37,11 @@ void appl::highlightManager::init(void) {
|
||||
if (list[iii]->getNodeType() != etk::FSN_FOLDER) {
|
||||
continue;
|
||||
}
|
||||
etk::UString filename = list[iii]->getName() + "/highlight.xml";
|
||||
std::string filename = list[iii]->getName() + "/highlight.xml";
|
||||
APPL_DEBUG("Load xml name : " << filename);
|
||||
appl::Highlight *myHightLine = appl::Highlight::keep(filename);
|
||||
if (myHightLine != NULL) {
|
||||
hlList.pushBack(myHightLine);
|
||||
hlList.push_back(myHightLine);
|
||||
} else {
|
||||
APPL_ERROR("Can not allocate HighLight");
|
||||
}
|
||||
@ -58,7 +58,7 @@ void appl::highlightManager::init(void) {
|
||||
}
|
||||
|
||||
void appl::highlightManager::unInit(void) {
|
||||
etk::Vector<Highlight*>& hlList = s_list();
|
||||
std::vector<Highlight*>& hlList = s_list();
|
||||
if (hlList.size() == 0) {
|
||||
APPL_DEBUG("HighlightManager ==> no highlight");
|
||||
hlList.clear();
|
||||
@ -74,27 +74,31 @@ void appl::highlightManager::unInit(void) {
|
||||
hlList.clear();
|
||||
}
|
||||
|
||||
etk::UString appl::highlightManager::getTypeExtention(const etk::UString& _extention) {
|
||||
std::string appl::highlightManager::getTypeExtention(const std::string& _extention) {
|
||||
if (_extention.size() == 0) {
|
||||
return "";
|
||||
}
|
||||
etk::Vector<Highlight*>& hlList = s_list();
|
||||
APPL_VERBOSE("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types");
|
||||
std::vector<Highlight*>& hlList = s_list();
|
||||
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
|
||||
if (hlList[iii] == NULL) {
|
||||
continue;
|
||||
}
|
||||
APPL_VERBOSE(" check : " << hlList[iii]->getTypeName());
|
||||
if (hlList[iii]->hasExtention(_extention) == true) {
|
||||
APPL_VERBOSE("Find type for extention : " << _extention
|
||||
<< " type : " << hlList[iii]->getTypeName());
|
||||
return hlList[iii]->getTypeName();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
etk::UString appl::highlightManager::getFileWithTypeType(const etk::UString& _type) {
|
||||
std::string appl::highlightManager::getFileWithTypeType(const std::string& _type) {
|
||||
if (_type.size() == 0) {
|
||||
return "";
|
||||
}
|
||||
etk::Vector<Highlight*>& hlList = s_list();
|
||||
std::vector<Highlight*>& hlList = s_list();
|
||||
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
|
||||
if (hlList[iii] == NULL) {
|
||||
continue;
|
||||
@ -106,8 +110,8 @@ etk::UString appl::highlightManager::getFileWithTypeType(const etk::UString& _ty
|
||||
return "";
|
||||
}
|
||||
|
||||
etk::Vector<etk::UString> appl::highlightManager::getTypeList(void) {
|
||||
etk::Vector<etk::UString> ret;
|
||||
std::vector<std::string> appl::highlightManager::getTypeList(void) {
|
||||
std::vector<std::string> ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -30,18 +30,18 @@ namespace appl {
|
||||
* @param[in] extention of the file
|
||||
* @return type of highlight
|
||||
*/
|
||||
etk::UString getTypeExtention(const etk::UString& _extention);
|
||||
std::string getTypeExtention(const std::string& _extention);
|
||||
/**
|
||||
* @brief Get filename with type.
|
||||
* @param[in] _type Type name of the highlight.
|
||||
* @return filename of the highlight.
|
||||
*/
|
||||
etk::UString getFileWithTypeType(const etk::UString& _type);
|
||||
std::string getFileWithTypeType(const std::string& _type);
|
||||
/**
|
||||
* @brief Get the list of extention type
|
||||
* @return the requested list.
|
||||
*/
|
||||
etk::Vector<etk::UString> getTypeList(void);
|
||||
std::vector<std::string> getTypeList(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -36,14 +36,14 @@ appl::HighlightPattern::~HighlightPattern(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void appl::HighlightPattern::setPaternStart(etk::UString& _regExp) {
|
||||
void appl::HighlightPattern::setPaternStart(std::string& _regExp) {
|
||||
if (m_regExpStart == NULL) {
|
||||
return;
|
||||
}
|
||||
m_regExpStart->setRegExp(_regExp);
|
||||
}
|
||||
|
||||
void appl::HighlightPattern::setPaternStop(etk::UString& _regExp) {
|
||||
void appl::HighlightPattern::setPaternStop(std::string& _regExp) {
|
||||
if (m_regExpStop != NULL) {
|
||||
delete(m_regExpStop);
|
||||
m_regExpStop = NULL;
|
||||
@ -58,11 +58,11 @@ void appl::HighlightPattern::setPaternStop(etk::UString& _regExp) {
|
||||
}
|
||||
}
|
||||
|
||||
void appl::HighlightPattern::setEscapeChar(const etk::UChar& _EscapeChar) {
|
||||
void appl::HighlightPattern::setEscapeChar(const char32_t& _EscapeChar) {
|
||||
m_escapeChar = _EscapeChar;
|
||||
}
|
||||
|
||||
void appl::HighlightPattern::setColorGlyph(etk::UString& _colorName) {
|
||||
void appl::HighlightPattern::setColorGlyph(std::string& _colorName) {
|
||||
m_colorName = _colorName;
|
||||
m_colorId = m_glyphPainting->request(m_colorName);
|
||||
APPL_VERBOSE("Resuest color name '" << m_colorName << "' => id=" << m_colorId);
|
||||
@ -94,8 +94,8 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
|
||||
*/
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// process attribute
|
||||
etk::UString highLightName = _child->getAttribute("name");
|
||||
etk::UString myEdnDataTmp = "???";
|
||||
std::string highLightName = _child->getAttribute("name");
|
||||
std::string myEdnDataTmp = "???";
|
||||
if (highLightName.size()!=0) {
|
||||
myEdnDataTmp = highLightName;
|
||||
}
|
||||
@ -104,34 +104,34 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
|
||||
|
||||
exml::Element* xChild = _child->getNamed("color");
|
||||
if (NULL != xChild) {
|
||||
etk::UString myData = xChild->getText();
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::UString myEdnData = myData;
|
||||
std::string myEdnData = myData;
|
||||
setColorGlyph(myEdnData);
|
||||
}
|
||||
}
|
||||
xChild = _child->getNamed("start");
|
||||
if (NULL != xChild) {
|
||||
etk::UString myData = xChild->getText();
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::UString myEdnData = myData;
|
||||
std::string myEdnData = myData;
|
||||
setPaternStart(myEdnData);
|
||||
}
|
||||
}
|
||||
xChild = _child->getNamed("end");
|
||||
if (NULL != xChild) {
|
||||
etk::UString myData = xChild->getText();
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::UString myEdnData = myData;
|
||||
std::string myEdnData = myData;
|
||||
setPaternStop(myEdnData);
|
||||
}
|
||||
}
|
||||
xChild = _child->getNamed("EscapeChar");
|
||||
if (NULL != xChild) {
|
||||
etk::UString myData = xChild->getText();
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
setEscapeChar(myData[0]);
|
||||
|
@ -35,34 +35,34 @@ namespace appl {
|
||||
HighlightPattern(appl::GlyphPainting*& _glyphPainting);
|
||||
~HighlightPattern(void);
|
||||
private:
|
||||
etk::UString m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
||||
std::string m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
||||
public:
|
||||
void setName(etk::UString& _name) {
|
||||
void setName(std::string& _name) {
|
||||
m_paternName = _name;
|
||||
};
|
||||
etk::UString getName(void) {
|
||||
std::string getName(void) {
|
||||
return m_paternName;
|
||||
};
|
||||
private:
|
||||
etk::RegExp<etk::Buffer>* m_regExpStart; //!< Start of Regular expression
|
||||
public:
|
||||
void setPaternStart(etk::UString& _regExp);
|
||||
void setPaternStart(std::string& _regExp);
|
||||
private:
|
||||
etk::RegExp<etk::Buffer>* m_regExpStop; //!< Stop of Regular Expression
|
||||
public:
|
||||
void setPaternStop(etk::UString& _regExp);
|
||||
void setPaternStop(std::string& _regExp);
|
||||
private:
|
||||
etk::UString m_colorName; //!< Current color name
|
||||
std::string m_colorName; //!< Current color name
|
||||
esize_t m_colorId; //!< Id of the the glyph painting
|
||||
public:
|
||||
void setColorGlyph(etk::UString& _colorName);
|
||||
void setColorGlyph(std::string& _colorName);
|
||||
const appl::GlyphDecoration& getColorGlyph(void) {
|
||||
return (*m_glyphPainting)[m_colorId];
|
||||
};
|
||||
private:
|
||||
etk::UChar m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
||||
char32_t m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
||||
public:
|
||||
void setEscapeChar(const etk::UChar& _EscapeChar);
|
||||
void setEscapeChar(const char32_t& _EscapeChar);
|
||||
private:
|
||||
bool m_multiline; //!< The patern is multiline
|
||||
public:
|
||||
|
@ -121,7 +121,7 @@ namespace appl {
|
||||
*/
|
||||
virtual bool onWrite(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data) {
|
||||
const std::string& _data) {
|
||||
return false;
|
||||
};
|
||||
protected:
|
||||
@ -144,7 +144,7 @@ namespace appl {
|
||||
*/
|
||||
virtual bool onReplace(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data,
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
return false;
|
||||
};
|
||||
|
@ -43,16 +43,16 @@ bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
startLine = _textDrawer.m_buffer->selectStart();
|
||||
}
|
||||
startLine = _textDrawer.m_buffer->getStartLine(startLine);
|
||||
etk::UString data = etk::UChar::Return;
|
||||
std::string data = "\n";
|
||||
|
||||
|
||||
for (appl::Buffer::Iterator it = startLine+1;
|
||||
(bool)it == true;
|
||||
++it) {
|
||||
if (*it == etk::UChar::Space) {
|
||||
data.append(etk::UChar::Space);
|
||||
data += etk::UChar::Space;
|
||||
} else if(*it == etk::UChar::Tabulation) {
|
||||
data.append(etk::UChar::Tabulation);
|
||||
data += etk::UChar::Tabulation;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ bool appl::TextPluginCopy::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
if ( _msg.getMessage() == ednMsgGuiCopy
|
||||
|| _msg.getMessage() == ednMsgGuiCut) {
|
||||
if (_textDrawer.m_buffer != NULL) {
|
||||
etk::UString value;
|
||||
std::string value;
|
||||
_textDrawer.m_buffer->copy(value);
|
||||
if (value.size() != 0) {
|
||||
ewol::clipBoard::set(ewol::clipBoard::clipboardStd, value);
|
||||
|
@ -49,12 +49,12 @@ bool appl::TextPluginHistory::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
return true;
|
||||
}
|
||||
if (m_redo[m_redo.size()-1] == NULL) {
|
||||
m_redo.popBack();
|
||||
m_redo.pop_back();
|
||||
return true;
|
||||
}
|
||||
appl::History *tmpElement = m_redo[m_redo.size()-1];
|
||||
m_redo.popBack();
|
||||
m_undo.pushBack(tmpElement);
|
||||
m_redo.pop_back();
|
||||
m_undo.push_back(tmpElement);
|
||||
_textDrawer.m_buffer->replace(tmpElement->m_addedText,
|
||||
_textDrawer.m_buffer->position(tmpElement->m_posAdded),
|
||||
_textDrawer.m_buffer->position(tmpElement->m_endPosRemoved) );
|
||||
@ -65,7 +65,7 @@ bool appl::TextPluginHistory::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
return true;
|
||||
}
|
||||
if (m_undo[m_undo.size()-1] == NULL) {
|
||||
m_undo.popBack();
|
||||
m_undo.pop_back();
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
@ -80,8 +80,8 @@ bool appl::TextPluginHistory::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
}
|
||||
*/
|
||||
appl::History *tmpElement = m_undo[m_undo.size()-1];
|
||||
m_undo.popBack();
|
||||
m_redo.pushBack(tmpElement);
|
||||
m_undo.pop_back();
|
||||
m_redo.push_back(tmpElement);
|
||||
_textDrawer.m_buffer->replace(tmpElement->m_removedText,
|
||||
_textDrawer.m_buffer->position(tmpElement->m_posAdded),
|
||||
_textDrawer.m_buffer->position(tmpElement->m_endPosAdded) );
|
||||
@ -122,7 +122,7 @@ void appl::TextPluginHistory::clearUndo(void) {
|
||||
|
||||
bool appl::TextPluginHistory::onWrite(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data) {
|
||||
const std::string& _data) {
|
||||
if (isEnable() == false) {
|
||||
return false;
|
||||
}
|
||||
@ -136,7 +136,7 @@ bool appl::TextPluginHistory::onWrite(appl::TextViewer& _textDrawer,
|
||||
if (tmpElement != NULL) {
|
||||
tmpElement->m_endPosAdded = (esize_t)_textDrawer.m_buffer->cursor();
|
||||
clearRedo();
|
||||
m_undo.pushBack(tmpElement);
|
||||
m_undo.push_back(tmpElement);
|
||||
}
|
||||
appl::textPluginManager::onCursorMove(_textDrawer, _textDrawer.m_buffer->cursor());
|
||||
return true;
|
||||
@ -144,7 +144,7 @@ bool appl::TextPluginHistory::onWrite(appl::TextViewer& _textDrawer,
|
||||
|
||||
bool appl::TextPluginHistory::onReplace(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data,
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
if (isEnable() == false) {
|
||||
return false;
|
||||
@ -160,7 +160,7 @@ bool appl::TextPluginHistory::onReplace(appl::TextViewer& _textDrawer,
|
||||
if (tmpElement != NULL) {
|
||||
tmpElement->m_endPosAdded = (esize_t)_textDrawer.m_buffer->cursor();
|
||||
clearRedo();
|
||||
m_undo.pushBack(tmpElement);
|
||||
m_undo.push_back(tmpElement);
|
||||
}
|
||||
appl::textPluginManager::onCursorMove(_textDrawer, _textDrawer.m_buffer->cursor());
|
||||
return true;
|
||||
@ -180,7 +180,7 @@ bool appl::TextPluginHistory::onRemove(appl::TextViewer& _textDrawer,
|
||||
tmpElement->m_endPosRemoved = (esize_t)_posEnd;
|
||||
_textDrawer.m_buffer->copy(tmpElement->m_removedText, _pos, _posEnd);
|
||||
clearRedo();
|
||||
m_undo.pushBack(tmpElement);
|
||||
m_undo.push_back(tmpElement);
|
||||
}
|
||||
_textDrawer.m_buffer->removeSelection();
|
||||
appl::textPluginManager::onCursorMove(_textDrawer, _textDrawer.m_buffer->cursor());
|
||||
|
@ -24,8 +24,8 @@ namespace appl {
|
||||
m_endPosRemoved(0) {
|
||||
|
||||
};
|
||||
etk::UString m_addedText;
|
||||
etk::UString m_removedText;
|
||||
std::string m_addedText;
|
||||
std::string m_removedText;
|
||||
esize_t m_posAdded;
|
||||
esize_t m_endPosAdded;
|
||||
esize_t m_endPosRemoved;
|
||||
@ -35,8 +35,8 @@ namespace appl {
|
||||
TextPluginHistory(void);
|
||||
~TextPluginHistory(void);
|
||||
private:
|
||||
etk::Vector<History*> m_undo; //!< History storing data
|
||||
etk::Vector<History*> m_redo; //!< History storing data
|
||||
std::vector<History*> m_undo; //!< History storing data
|
||||
std::vector<History*> m_redo; //!< History storing data
|
||||
public:
|
||||
virtual void onPluginEnable(appl::TextViewer& _textDrawer);
|
||||
virtual void onPluginDisable(appl::TextViewer& _textDrawer);
|
||||
@ -44,10 +44,10 @@ namespace appl {
|
||||
const ewol::EMessage& _msg);
|
||||
virtual bool onWrite(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data);
|
||||
const std::string& _data);
|
||||
virtual bool onReplace(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data,
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd);
|
||||
virtual bool onRemove(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
|
@ -16,36 +16,36 @@
|
||||
#undef __class__
|
||||
#define __class__ "textPluginManager"
|
||||
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getList(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getList(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnEventEntry(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnEventEntry(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnEventInput(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnEventInput(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnWrite(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnWrite(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnReplace(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnReplace(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnRemove(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnRemove(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnReceiveMessage(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnReceiveMessage(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
static etk::Vector<appl::TextViewerPlugin *>& getListOnCursorMove(void) {
|
||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||
static std::vector<appl::TextViewerPlugin *>& getListOnCursorMove(void) {
|
||||
static std::vector<appl::TextViewerPlugin *> s_list;
|
||||
return s_list;
|
||||
}
|
||||
|
||||
@ -84,27 +84,27 @@ void appl::textPluginManager::addPlugin(appl::TextViewerPlugin* _plugin) {
|
||||
if (_plugin == NULL) {
|
||||
return;
|
||||
}
|
||||
getList().pushBack(_plugin);
|
||||
getList().push_back(_plugin);
|
||||
if (_plugin->isAvaillableOnEventEntry() == true) {
|
||||
getListOnEventEntry().pushBack(_plugin);
|
||||
getListOnEventEntry().push_back(_plugin);
|
||||
}
|
||||
if (_plugin->isAvaillableOnEventInput() == true) {
|
||||
getListOnEventInput().pushBack(_plugin);
|
||||
getListOnEventInput().push_back(_plugin);
|
||||
}
|
||||
if (_plugin->isAvaillableOnWrite() == true) {
|
||||
getListOnWrite().pushBack(_plugin);
|
||||
getListOnWrite().push_back(_plugin);
|
||||
}
|
||||
if (_plugin->isAvaillableOnReplace() == true) {
|
||||
getListOnReplace().pushBack(_plugin);
|
||||
getListOnReplace().push_back(_plugin);
|
||||
}
|
||||
if (_plugin->isAvaillableOnRemove() == true) {
|
||||
getListOnRemove().pushBack(_plugin);
|
||||
getListOnRemove().push_back(_plugin);
|
||||
}
|
||||
if (_plugin->isAvaillableOnReceiveMessage() == true) {
|
||||
getListOnReceiveMessage().pushBack(_plugin);
|
||||
getListOnReceiveMessage().push_back(_plugin);
|
||||
}
|
||||
if (_plugin->isAvaillableOnCursorMove() == true) {
|
||||
getListOnCursorMove().pushBack(_plugin);
|
||||
getListOnCursorMove().push_back(_plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
|
||||
|
||||
bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
const ewol::EventEntry& _event) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnEventEntry();
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnEventEntry();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -142,7 +142,7 @@ bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
|
||||
bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer,
|
||||
const ewol::EventInput& _event) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnEventInput();
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnEventInput();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -156,8 +156,8 @@ bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer,
|
||||
|
||||
bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnWrite();
|
||||
const std::string& _data) {
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnWrite();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -171,9 +171,9 @@ bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
|
||||
|
||||
bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data,
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnReplace();
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnReplace();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -188,7 +188,7 @@ bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer,
|
||||
bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnRemove();
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnRemove();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -202,7 +202,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
|
||||
|
||||
bool appl::textPluginManager::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
const ewol::EMessage& _msg) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnReceiveMessage();
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnReceiveMessage();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
@ -216,7 +216,7 @@ bool appl::textPluginManager::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
|
||||
bool appl::textPluginManager::onCursorMove(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos) {
|
||||
etk::Vector<appl::TextViewerPlugin *>& list = getListOnCursorMove();
|
||||
std::vector<appl::TextViewerPlugin *>& list = getListOnCursorMove();
|
||||
for (esize_t iii=0; iii<list.size(); ++iii) {
|
||||
if (list[iii] == NULL) {
|
||||
continue;
|
||||
|
@ -69,7 +69,7 @@ namespace appl {
|
||||
*/
|
||||
bool onWrite(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data);
|
||||
const std::string& _data);
|
||||
/**
|
||||
* @brief Called when data is written in the buffer, and some are removed.
|
||||
* @param[in] _widget Reference on the widget caller.
|
||||
@ -80,7 +80,7 @@ namespace appl {
|
||||
*/
|
||||
bool onReplace(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const etk::UString& _data,
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd);
|
||||
/**
|
||||
* @brief Called when data is removed.
|
||||
|
@ -30,7 +30,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
if (_event.getStatus() != ewol::keyEvent::statusDown) {
|
||||
return false;
|
||||
}
|
||||
etk::UChar localValue = _event.getChar();
|
||||
char32_t localValue = _event.getChar();
|
||||
if (localValue != etk::UChar::Tabulation) {
|
||||
return false;
|
||||
}
|
||||
@ -43,7 +43,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
itStart = _textDrawer.m_buffer->getStartLine(itStart);
|
||||
itStop = _textDrawer.m_buffer->getEndLine(itStop);
|
||||
// copy the curent data in a classicle string:
|
||||
etk::UString data;
|
||||
std::string data;
|
||||
_textDrawer.m_buffer->copy(data, itStart, itStop);
|
||||
// TODO : Change this ...
|
||||
bool m_useTabs = true;
|
||||
@ -51,17 +51,17 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
|
||||
if (true == _event.getSpecialKey().isSetShift() ) {
|
||||
// un-indent
|
||||
data.add(0, etk::UChar::Return);
|
||||
data.insert(0, 1, etk::UChar::Return);
|
||||
for (esize_t iii=1; iii<data.size(); ++iii) {
|
||||
if (data[iii-1] == etk::UChar::Return) {
|
||||
if(data[iii] == etk::UChar::Tabulation) {
|
||||
data.remove(iii);
|
||||
data.erase(iii);
|
||||
} else if(data[iii] == etk::UChar::Space) {
|
||||
for (esize_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) {
|
||||
if(data[iii] == etk::UChar::Space) {
|
||||
data.remove(iii);
|
||||
data.erase(iii);
|
||||
} else if(data[iii] == etk::UChar::Tabulation) {
|
||||
data.remove(iii);
|
||||
data.erase(iii);
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
@ -70,24 +70,22 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
}
|
||||
}
|
||||
}
|
||||
data.remove(0);
|
||||
data.erase(0);
|
||||
} else {
|
||||
// indent
|
||||
data.add(0, etk::UChar::Return);
|
||||
data.insert(0, 1, etk::UChar::Return);
|
||||
for (esize_t iii=1; iii<data.size(); iii++) {
|
||||
if (data[iii-1] == etk::UChar::Return) {
|
||||
if (true == _event.getSpecialKey().isSetCtrl() ) {
|
||||
data.add(iii, etk::UChar::Space);
|
||||
data.insert(iii, 1, etk::UChar::Space);
|
||||
} else if (true == m_useTabs) {
|
||||
data.add(iii, etk::UChar::Tabulation);
|
||||
data.insert(iii, 1, etk::UChar::Tabulation);
|
||||
} else {
|
||||
for (int32_t jjj=0; jjj<m_tabDist; jjj++) {
|
||||
data.add(iii, etk::UChar::Space);
|
||||
}
|
||||
data.insert(iii, m_tabDist, etk::UChar::Space);
|
||||
}
|
||||
}
|
||||
}
|
||||
data.remove(0);
|
||||
data.erase(0);
|
||||
}
|
||||
// Real replace of DATA :
|
||||
_textDrawer.replace(data, itStart, itStop);
|
||||
|
@ -36,13 +36,13 @@ class CTagsManager: public ewol::EObject {
|
||||
int32_t multipleJump(void);
|
||||
void jumpTo(void);
|
||||
void printTag(const tagEntry *entry);
|
||||
etk::UString getFolder(etk::UString &inputString);
|
||||
etk::UString m_tagFolderBase;
|
||||
etk::UString m_tagFilename;
|
||||
std::string getFolder(std::string &inputString);
|
||||
std::string m_tagFolderBase;
|
||||
std::string m_tagFilename;
|
||||
tagFile * m_ctagFile;
|
||||
// history system
|
||||
int32_t m_historyPos;
|
||||
etk::Vector<etk::FSNode*> m_historyList;
|
||||
std::vector<etk::FSNode*> m_historyList;
|
||||
void registerHistory(void);
|
||||
};
|
||||
|
||||
@ -126,7 +126,7 @@ void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
// remove element ....
|
||||
delete(m_historyList[id]);
|
||||
m_historyList[id]=NULL;
|
||||
m_historyList.popBack();
|
||||
m_historyList.pop_back();
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -140,7 +140,7 @@ void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
sscanf(_msg.getData().c_str(), "%d:%s", &lineID, tmp);
|
||||
// generate envents
|
||||
sendMultiCast(ednMsgOpenFile, tmp);
|
||||
sendMultiCast(ednMsgGuiGotoLine, lineID - 1);
|
||||
sendMultiCast(ednMsgGuiGotoLine, std::to_string(lineID - 1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ void CTagsManager::registerHistory(void) {
|
||||
etk::FSNode * bufferFilename = new etk::FSNode();
|
||||
*bufferFilename = tmpBuf->getFileName();
|
||||
// TODO : bufferFilename->setLineNumber(tmpBuf->getCurrentLine());
|
||||
m_historyList.pushBack(bufferFilename);
|
||||
m_historyList.push_back(bufferFilename);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@ -182,7 +182,7 @@ void CTagsManager::registerHistory(void) {
|
||||
void CTagsManager::jumpTo(void) {
|
||||
if (NULL != m_ctagFile) {
|
||||
// get the middle button of the clipboard == > represent the current selection ...
|
||||
etk::UString data = ewol::clipBoard::get(ewol::clipBoard::clipboardSelection);
|
||||
std::string data = ewol::clipBoard::get(ewol::clipBoard::clipboardSelection);
|
||||
APPL_DEBUG("clipboard data : \"" << data << "\"");
|
||||
if (data.size() == 0) {
|
||||
APPL_INFO("No current selection");
|
||||
@ -194,7 +194,7 @@ void CTagsManager::jumpTo(void) {
|
||||
int32_t numberOfTags = 0;
|
||||
|
||||
// For all tags : Save in an internal Structure :
|
||||
etk::UString tmpFile(m_tagFolderBase + "/" + entry.file);
|
||||
std::string tmpFile(m_tagFolderBase + "/" + entry.file);
|
||||
etk::FSNode myfile(tmpFile);
|
||||
int32_t lineID = entry.address.lineNumber;
|
||||
printTag(&entry);
|
||||
@ -220,7 +220,7 @@ void CTagsManager::jumpTo(void) {
|
||||
registerHistory();
|
||||
APPL_INFO(" OPEN the TAG file Destination : " << tmpFile );
|
||||
sendMultiCast(ednMsgOpenFile, myfile.getName());
|
||||
sendMultiCast(ednMsgGuiGotoLine, lineID - 1);
|
||||
sendMultiCast(ednMsgGuiGotoLine, std::to_string(lineID - 1));
|
||||
}
|
||||
} else {
|
||||
APPL_INFO("no tag find ...");
|
||||
|
@ -46,24 +46,24 @@ class myParamGlobal : public ewol::EObject {
|
||||
bool onSetConfig(const ewol::EConfig& _conf) {
|
||||
// Not set the EObject node parameter (name == > not change ...)
|
||||
if (_conf.getConfig() == configEOL) {
|
||||
m_displayEOL = _conf.getData().toBool();
|
||||
m_displayEOL = stobool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configAutoIndent) {
|
||||
m_AutoIndent = _conf.getData().toBool();
|
||||
m_AutoIndent = stobool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configShowTabChar) {
|
||||
m_displayTabChar = _conf.getData().toBool();
|
||||
m_displayTabChar = stobool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configShowSpaceChar) {
|
||||
m_displaySpaceChar = _conf.getData().toBool();
|
||||
m_displaySpaceChar = stobool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool onGetConfig(const char* _config, etk::UString& _result) const {
|
||||
bool onGetConfig(const char* _config, std::string& _result) const {
|
||||
// Not set the EObject node parameter (name == > not change ...)
|
||||
if (_config == configEOL) {
|
||||
if (true == m_displayEOL) {
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <appl/globalMsg.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <regex>
|
||||
#include <etk/unicode.h>
|
||||
|
||||
char32_t mychar32;
|
||||
@ -48,37 +49,69 @@ int main(int _argc, const char *_argv[]) {
|
||||
appl::BufferManager* bufferManager = NULL;
|
||||
|
||||
etk::CCout& operator <<(etk::CCout& _os, const std::u32string& _obj) {
|
||||
etk::Vector<etk::UChar> tmpp;
|
||||
std::vector<char32_t> tmpp;
|
||||
for (size_t iii=0; iii<_obj.size(); ++iii) {
|
||||
tmpp.pushBack(_obj[iii]);
|
||||
tmpp.push_back(_obj[iii]);
|
||||
}
|
||||
etk::Vector<char> output_UTF8;
|
||||
std::vector<char> output_UTF8;
|
||||
unicode::convertUnicodeToUtf8(tmpp, output_UTF8);
|
||||
output_UTF8.pushBack('\0');
|
||||
output_UTF8.push_back('\0');
|
||||
_os << &output_UTF8[0];
|
||||
return _os;
|
||||
}
|
||||
|
||||
etk::CCout& operator <<(etk::CCout& _os, const std::regex_error& _e) {
|
||||
int32_t val = _e.code();
|
||||
switch(val) {
|
||||
case std::regex_constants::error_collate:
|
||||
_os << "{ error_collate = The expression contained an invalid collating element name.}";
|
||||
break;
|
||||
case std::regex_constants::error_ctype:
|
||||
_os << "{ error_ctype = The expression contained an invalid character class name.}";
|
||||
break;
|
||||
case std::regex_constants::error_escape:
|
||||
_os << "{ error_escape = The expression contained an invalid escaped character, or a trailing escape.}";
|
||||
break;
|
||||
case std::regex_constants::error_backref:
|
||||
_os << "{ error_backref = The expression contained an invalid back reference.}";
|
||||
break;
|
||||
case std::regex_constants::error_brack:
|
||||
_os << "{ error_brack = The expression contained mismatched brackets ([ and ]).}";
|
||||
break;
|
||||
case std::regex_constants::error_paren:
|
||||
_os << "{ error_paren = The expression contained mismatched parentheses (( and )).}";
|
||||
break;
|
||||
case std::regex_constants::error_brace:
|
||||
_os << "{ error_brace = The expression contained mismatched braces ({ and }).}";
|
||||
break;
|
||||
case std::regex_constants::error_badbrace:
|
||||
_os << "{ error_badbrace = The expression contained an invalid range between braces ({ and }).}";
|
||||
break;
|
||||
case std::regex_constants::error_range:
|
||||
_os << "{ error_range = The expression contained an invalid character range.}";
|
||||
break;
|
||||
case std::regex_constants::error_space:
|
||||
_os << "{ error_space = There was insufficient memory to convert the expression into a finite state machine.}";
|
||||
break;
|
||||
case std::regex_constants::error_badrepeat:
|
||||
_os << "{ error_badrepeat = The expression contained a repeat specifier (one of *?+{) that was not preceded by a valid regular expression.}";
|
||||
break;
|
||||
case std::regex_constants::error_complexity:
|
||||
_os << "{ error_complexity = The complexity of an attempted match against a regular expression exceeded a pre-set level.}";
|
||||
break;
|
||||
case std::regex_constants::error_stack:
|
||||
_os << "{ error_stack = There was insufficient memory to determine whether the regular expression could match the specified character sequence.}";
|
||||
break;
|
||||
}
|
||||
return _os;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief main application function initialisation
|
||||
*/
|
||||
bool APP_Init(ewol::eContext& _context) {
|
||||
APPL_INFO(" == > init APPL (START) [" << ewol::getBoardType() << "] (" << ewol::getCompilationMode() << ")");
|
||||
|
||||
std::vector<int32_t> valueExample;
|
||||
valueExample.push_back(23);
|
||||
valueExample.push_back(23);
|
||||
valueExample.push_back(23);
|
||||
valueExample.push_back(23);
|
||||
APPL_INFO("test de vector : " << valueExample[0]);
|
||||
std::cout << "test de debug direct ..." << std::endl;
|
||||
std::cerr << "test de debug direct .2." << std::endl;
|
||||
std::u32string ploppppp;
|
||||
ploppppp = U"exemple de texte sans accent : ";
|
||||
APPL_INFO( "retert : " << ploppppp);
|
||||
APPL_CRITICAL("kjkjhkjh");
|
||||
|
||||
|
||||
// TODO : remove this : Move if in the windows properties
|
||||
_context.setSize(vec2(800, 600));
|
||||
|
||||
@ -134,7 +167,7 @@ bool APP_Init(ewol::eContext& _context) {
|
||||
APPL_INFO("show list of files : ");
|
||||
bool ctagDetected = false;
|
||||
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
|
||||
etk::UString tmpppp = _context.getCmd().get(iii);
|
||||
std::string tmpppp = _context.getCmd().get(iii);
|
||||
if (tmpppp == "-t") {
|
||||
ctagDetected = true;
|
||||
} else if (true == ctagDetected) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user