diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-03-06 10:09:32 +0000 |
---|---|---|
committer | benjamin <benjamin@daaaf23c-2e50-4459-9457-1e69db5a47bf> | 2014-03-06 10:09:32 +0000 |
commit | 36a1402be747136711edc19f7bce45f36a625eb4 (patch) | |
tree | f9bcc7095561929dd527c02f4cbb3b68e7901385 | |
parent | d99095f4a181357bf0c6d10846351eb0b58b1ccf (diff) |
added proper namespaces and ignored end elements in xml parsing
git-svn-id: file:///var/local/svn/basicwriter@27 daaaf23c-2e50-4459-9457-1e69db5a47bf
-rw-r--r-- | src/model/RangeSet.hpp | 15 | ||||
-rw-r--r-- | src/xml/XmlReader.cpp | 5 | ||||
-rw-r--r-- | test/model/RangeSet.cpp | 2 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/model/RangeSet.hpp b/src/model/RangeSet.hpp index 3768431..e6e60e0 100644 --- a/src/model/RangeSet.hpp +++ b/src/model/RangeSet.hpp @@ -16,13 +16,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _RANGE_SET_HPP_ -#define _RANGE_SET_HPP_ +#ifndef _OUSIA_MODEL_RANGE_SET_HPP_ +#define _OUSIA_MODEL_RANGE_SET_HPP_ #include <limits> namespace ousia { - +namespace model { /** * The Range structure represents an interval of numerical values of type T. */ @@ -150,7 +150,7 @@ struct Range { * Returns a range that represents the spans the complete set defined by the * given type T. */ - static Range<T> hull() + static Range<T> typeRange() { return Range(std::numeric_limits<T>::min(), std::numeric_limits<T>::max()); @@ -163,7 +163,7 @@ struct Range { * @param till is the value up to which the range should be defined (till is * included in the set). */ - static Range<T> hullUntil(const T &till) + static Range<T> typeRangeUntil(const T &till) { return Range(std::numeric_limits<T>::min(), till); } @@ -175,7 +175,7 @@ struct Range { * @param from is the value from which the range should be defined (from is * included in the set). */ - static Range<T> hullFrom(const T &from) + static Range<T> typeRangeFrom(const T &from) { return Range(from, std::numeric_limits<T>::max()); } @@ -319,6 +319,7 @@ public: }; } +} -#endif /* _RANGE_SET_HPP_ */ +#endif /* _OUSIA_MODEL_RANGE_SET_HPP_ */ diff --git a/src/xml/XmlReader.cpp b/src/xml/XmlReader.cpp index fd03ffb..c7de564 100644 --- a/src/xml/XmlReader.cpp +++ b/src/xml/XmlReader.cpp @@ -55,7 +55,8 @@ bool XmlReader::expectOneOf(std::vector<XmlElementHandler> &handlers) << xml.name().toString().toStdString() << "\" instead!" << std::endl; return false; - case QXmlStreamReader::EndElement: + /* This is Benjamins noob way of handling things: We just ignore them. + case QXmlStreamReader::EndElement: // Expected tag was not found, instead we found a closing tag! // TODO: Use better logging mechanism! std::cout << "Expected one of the following tags: (" @@ -63,7 +64,7 @@ bool XmlReader::expectOneOf(std::vector<XmlElementHandler> &handlers) << "); but found end of element \"" << xml.name().toString().toStdString() << "\" instead!" << std::endl; - return false; + return false;*/ default: continue; } diff --git a/test/model/RangeSet.cpp b/test/model/RangeSet.cpp index f3aa209..d026025 100644 --- a/test/model/RangeSet.cpp +++ b/test/model/RangeSet.cpp @@ -21,6 +21,7 @@ #include <model/RangeSet.hpp> namespace ousia { +namespace model { TEST(Range, IsValid) { @@ -217,4 +218,5 @@ TEST(RangeSet, Contains) } } +} |