diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2759f39 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,48 @@ +# language type: +language: cpp + +# compilator system: +compiler: +- clang +- gcc + +os: +- linux +- osx + +osx_image: xcode61 + +# previous actions: +before_script: + - rm -rf * + - git clone https://github.com/HeeroYui/ewol.git + - cd ewol; git checkout origin/dev -b dev; cd .. + - cd ewol; git submodule init; cd .. + - cd ewol; git submodule update; cd .. + - cd ewol; git submodule foreach git checkout master; cd .. + - cd ewol; git submodule foreach git pull; cd .. + +#install Gcc to have lisstdc++ 4.8 & gcc 4.8 +install: + - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + - sudo apt-get update -qq + - sudo apt-get install -qq g++-4.8 + - sudo rm /usr/bin/gcc /usr/bin/g++ + - sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc + - sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++ + +# build sequence with Lutin : +script: + - if [ "$CXX" == "clang++" ]; then ./ewol/build/lutin.py -C -P -cclang -mdebug -p exml_test; fi + - if [ "$CXX" == "g++" ]; then ./ewol/build/lutin.py -C -P -cgcc -mdebug -p exml_test; fi + +after_script: + - if [ "$CXX" == "clang++" ]; then ./out/Linux_x86_64/debug/staging/clang/exml_test/usr/bin/exml_test; fi + - if [ "$CXX" == "g++" ]; then ./out/Linux_x86_64/debug/staging/gcc/exml_test/usr/bin/exml_test; fi + +#send e-mail on compilation result: +notifications: + email: + - yui.heero@gmail.com + + diff --git a/exml/AttributeList.h b/exml/AttributeList.h index 6afd40a..c4bee4f 100644 --- a/exml/AttributeList.h +++ b/exml/AttributeList.h @@ -16,7 +16,7 @@ namespace exml { class AttributeList : public exml::Node { - public: + protected: /** * @brief Constructor */ @@ -29,6 +29,7 @@ namespace exml { exml::Node(_value) { }; + public: /** * @brief Destructor */ diff --git a/exml/Element.cpp b/exml/Element.cpp index 481d94b..385e3ee 100644 --- a/exml/Element.cpp +++ b/exml/Element.cpp @@ -138,7 +138,7 @@ void exml::Element::append(const std::shared_ptr& _node) { m_listSub.push_back(_node); } -std::string exml::Element::getText() { +std::string exml::Element::getText() const { std::string res; if (m_listSub.size() == 1) { if (m_listSub[0]->getType() == typeText) { diff --git a/exml/Element.h b/exml/Element.h index 4eb181a..40487cd 100644 --- a/exml/Element.h +++ b/exml/Element.h @@ -82,7 +82,7 @@ namespace exml { * @brief get the internal data of the element (if the element has some sub node thay are converted in xml string == > like this it is not needed to use * @return the curent data string. if Only one text node, then we get the parssed data (no & ...) if more than one node, then we transform &,",',<,> in xml normal text... */ - std::string getText(); + std::string getText() const; protected: bool subParse(const std::string& _data, int32_t& _pos, bool _caseSensitive, exml::filePos& _filePos, exml::Document& _doc, bool _mainNode=false); public: // herited function: diff --git a/exml/Node.h b/exml/Node.h index d8bba7b..2140ee9 100644 --- a/exml/Node.h +++ b/exml/Node.h @@ -163,7 +163,7 @@ namespace exml { /** * @brief get the current position where the element is in the file */ - const exml::filePos& getPos() { + const exml::filePos& getPos() const { return m_pos; }; protected: diff --git a/exml/Text.cpp b/exml/Text.cpp index 62680c8..7ef7cba 100644 --- a/exml/Text.cpp +++ b/exml/Text.cpp @@ -63,11 +63,14 @@ static bool isWhiteChar(char32_t _val) { return false; } - std::shared_ptr exml::Text::create() { return std::shared_ptr(new exml::Text()); } +std::shared_ptr exml::Text::create(const std::string& _data) { + return std::shared_ptr(new exml::Text(_data)); +} + bool exml::Text::iGenerate(std::string& _data, int32_t _indent) const { _data += replaceSpecialCharOut(m_value); return true; diff --git a/exml/Text.h b/exml/Text.h index 6d5aa78..baf7afd 100644 --- a/exml/Text.h +++ b/exml/Text.h @@ -19,13 +19,14 @@ namespace exml { * @brief Constructor */ Text() { }; - public: - static std::shared_ptr create(); /** * @brief Constructor * @param[in] _data String data of the current Text */ Text(const std::string& _data) : exml::Node(_data) { }; + public: + static std::shared_ptr create(); + static std::shared_ptr create(const std::string& _data); /** * @brief Destructor */