[DEV] update new exml interface

This commit is contained in:
Edouard DUPIN 2015-01-14 21:10:23 +01:00
parent 0f64bad930
commit 192bd045fa
3 changed files with 11 additions and 11 deletions

View File

@ -40,8 +40,8 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
APPL_ERROR(" can not load file XML : " << _xmlFilename); APPL_ERROR(" can not load file XML : " << _xmlFilename);
return; return;
} }
exml::Element* root = doc.getNamed("EdnLang"); std::shared_ptr<exml::Element> root = doc.getNamed("EdnLang");
if (nullptr == root ) { if (root ==nullptr) {
APPL_ERROR("(l ?) main node not find: \"EdnLang\" ..."); APPL_ERROR("(l ?) main node not find: \"EdnLang\" ...");
return; return;
} }
@ -50,7 +50,7 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
int32_t level2 = 0; int32_t level2 = 0;
// parse all the elements : // parse all the elements :
for(size_t iii = 0; iii < root->size(); ++iii) { for(size_t iii = 0; iii < root->size(); ++iii) {
exml::Element* child = root->getElement(iii); std::shared_ptr<exml::Element> child = root->getElement(iii);
if (child == nullptr) { if (child == nullptr) {
// trash here all that is not element ... // trash here all that is not element ...
continue; continue;
@ -64,7 +64,7 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
} else if (child->getValue() == "pass1") { } else if (child->getValue() == "pass1") {
// get sub Nodes ... // get sub Nodes ...
for(size_t jjj=0; jjj< child->size(); jjj++) { for(size_t jjj=0; jjj< child->size(); jjj++) {
exml::Element* passChild = child->getElement(jjj); std::shared_ptr<exml::Element> passChild = child->getElement(jjj);
if (passChild == nullptr) { if (passChild == nullptr) {
continue; continue;
} }
@ -78,7 +78,7 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
} else if (child->getValue() == "pass2") { } else if (child->getValue() == "pass2") {
// get sub Nodes ... // get sub Nodes ...
for(size_t jjj=0; jjj< child->size(); jjj++) { for(size_t jjj=0; jjj< child->size(); jjj++) {
exml::Element* passChild = child->getElement(jjj); std::shared_ptr<exml::Element> passChild = child->getElement(jjj);
if (passChild == nullptr) { if (passChild == nullptr) {
continue; continue;
} }
@ -100,7 +100,7 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
int32_t level3=0; int32_t level3=0;
// get sub Nodes ... // get sub Nodes ...
for(size_t jjj=0; jjj< child->size(); jjj++) { for(size_t jjj=0; jjj< child->size(); jjj++) {
exml::Element* passChild = child->getElement(jjj); std::shared_ptr<exml::Element> passChild = child->getElement(jjj);
if (passChild == nullptr) { if (passChild == nullptr) {
continue; continue;
} }

View File

@ -13,7 +13,7 @@
#undef __class__ #undef __class__
#define __class__ "HighlightPattern" #define __class__ "HighlightPattern"
appl::HighlightPattern::HighlightPattern(const std::shared_ptr<appl::GlyphPainting>& _glyphPainting, exml::Element* _child, int32_t _level) : appl::HighlightPattern::HighlightPattern(const std::shared_ptr<appl::GlyphPainting>& _glyphPainting, const std::shared_ptr<const exml::Element>& _child, int32_t _level) :
m_glyphPainting(_glyphPainting), m_glyphPainting(_glyphPainting),
m_paternName(""), m_paternName(""),
m_hasParsingError(true), m_hasParsingError(true),
@ -68,7 +68,7 @@ void appl::HighlightPattern::display() {
APPL_INFO(" == > regex '" << m_regexValue << "'"); APPL_INFO(" == > regex '" << m_regexValue << "'");
} }
void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) { void appl::HighlightPattern::parseRules(const std::shared_ptr<const exml::Element>& _child, int32_t _level) {
//-------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------
/* /*
<rule name="my preprocesseur"> <rule name="my preprocesseur">
@ -87,7 +87,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
setName(myEdnDataTmp); setName(myEdnDataTmp);
setLevel(_level); setLevel(_level);
exml::Element* xChild = _child->getNamed("color"); std::shared_ptr<const exml::Element> xChild = _child->getNamed("color");
if (nullptr != xChild) { if (nullptr != xChild) {
std::string myData = xChild->getText(); std::string myData = xChild->getText();
if (myData.size() != 0) { if (myData.size() != 0) {

View File

@ -33,7 +33,7 @@ namespace appl {
public: public:
// Constructeur // Constructeur
HighlightPattern(); HighlightPattern();
HighlightPattern(const std::shared_ptr<appl::GlyphPainting>& _glyphPainting, exml::Element* _child, int32_t _level); HighlightPattern(const std::shared_ptr<appl::GlyphPainting>& _glyphPainting, const std::shared_ptr<const exml::Element>& _child, int32_t _level);
virtual ~HighlightPattern(); virtual ~HighlightPattern();
private: private:
std::string 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")
@ -96,7 +96,7 @@ namespace appl {
appl::HighlightInfo& _resultat, appl::HighlightInfo& _resultat,
const std::string& _buffer); const std::string& _buffer);
void parseRules(exml::Element* _child, int32_t _level); void parseRules(const std::shared_ptr<const exml::Element>& _child, int32_t _level);
}; };
}; };