diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-03 20:20:40 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-03-03 20:20:40 +0100 |
commit | 42c0480b4fbf80afa0c5b13650a0af74311d7202 (patch) | |
tree | 13f40104b4d8ebcb394f9adbf0b6a723889acea9 /src/formats | |
parent | b6ec0740e027fc1bc7f6d2513583187061bc8f0a (diff) |
Implemented annotation handling
Diffstat (limited to 'src/formats')
-rw-r--r-- | src/formats/osml/OsmlParser.cpp | 7 | ||||
-rw-r--r-- | src/formats/osxml/OsxmlEventParser.hpp | 7 | ||||
-rw-r--r-- | src/formats/osxml/OsxmlParser.cpp | 4 |
3 files changed, 6 insertions, 12 deletions
diff --git a/src/formats/osml/OsmlParser.cpp b/src/formats/osml/OsmlParser.cpp index d169393..b5e5d8a 100644 --- a/src/formats/osml/OsmlParser.cpp +++ b/src/formats/osml/OsmlParser.cpp @@ -116,12 +116,7 @@ public: break; case OsmlStreamParser::State::ANNOTATION_END: { Variant elementName = Variant::fromString(std::string{}); - const auto &args = parser.getCommandArguments().asMap(); - auto it = args.find("name"); - if (it != args.end()) { - elementName = it->second; - } - stack.annotationEnd(parser.getCommandName(), elementName); + stack.annotationEnd(parser.getCommandName(), parser.getCommandArguments().asMap()); break; } case OsmlStreamParser::State::FIELD_START: diff --git a/src/formats/osxml/OsxmlEventParser.hpp b/src/formats/osxml/OsxmlEventParser.hpp index 4c5a485..888d5d6 100644 --- a/src/formats/osxml/OsxmlEventParser.hpp +++ b/src/formats/osxml/OsxmlEventParser.hpp @@ -81,12 +81,11 @@ public: * @param className is a string variant containing the name of the * annotation class that should end here. May be empty (or nullptr), if no * elementName has been specified at the end of the annotation. - * @param elementName is the name of the annotation element that should be - * ended here. May be empty (or nullptr), if no elementName has been - * specified at the end of the annotation. + * @param args is a map variant containing the arguments that were given + * to the annotation definition. */ virtual void annotationEnd(const Variant &className, - const Variant &elementName) = 0; + const Variant::mapType &args) = 0; /** * Called whenever the command or annotation tags end. diff --git a/src/formats/osxml/OsxmlParser.cpp b/src/formats/osxml/OsxmlParser.cpp index 10cc77a..a9a0ea8 100644 --- a/src/formats/osxml/OsxmlParser.cpp +++ b/src/formats/osxml/OsxmlParser.cpp @@ -79,9 +79,9 @@ public: } void annotationEnd(const Variant &className, - const Variant &elementName) override + const Variant::mapType &args) override { - stack.annotationEnd(className, elementName); + stack.annotationEnd(className, args); } void rangeEnd() override { stack.rangeEnd(); } |