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

View File

@ -13,7 +13,7 @@
#undef __class__
#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_paternName(""),
m_hasParsingError(true),
@ -68,7 +68,7 @@ void appl::HighlightPattern::display() {
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">
@ -87,7 +87,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
setName(myEdnDataTmp);
setLevel(_level);
exml::Element* xChild = _child->getNamed("color");
std::shared_ptr<const exml::Element> xChild = _child->getNamed("color");
if (nullptr != xChild) {
std::string myData = xChild->getText();
if (myData.size() != 0) {

View File

@ -33,7 +33,7 @@ namespace appl {
public:
// Constructeur
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();
private:
std::string m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
@ -96,7 +96,7 @@ namespace appl {
appl::HighlightInfo& _resultat,
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);
};
};