From 18f1dfac45268ce887fdef9584b5b70304574942 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Sat, 17 May 2025 17:33:54 +0300 Subject: [PATCH] [traffxml] Documentation Signed-off-by: mvglasow --- traffxml/traff_model_xml.cpp | 25 ------------------------- traffxml/traff_model_xml.hpp | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/traffxml/traff_model_xml.cpp b/traffxml/traff_model_xml.cpp index d0511bb24..a9d612465 100644 --- a/traffxml/traff_model_xml.cpp +++ b/traffxml/traff_model_xml.cpp @@ -593,31 +593,6 @@ bool MessageFromXml(pugi::xml_node node, TraffMessage & message) return true; } -/** - * @brief Retrieves a TraFF feed from an XML document. - * - * The document must conform loosely to the TraFF specification (currently version 0.8). - * - * The name of the root element is not verified, but the `message` elements must be its immediate - * children. - * - * Custom elements and attributes which are not part of the TraFF specification are ignored. - * - * Values which cannot be parsed correctly are skipped. - * - * Events whose event type does not match their event class are skipped. - * - * Messages, events, locations or points which lack mandatory information are skipped. - * - * If children are skipped but the parent remains valid, parsing it will report success. - * - * Parsing the feed will report failure if all its messages fail to parse, but not if it has no - * messages. - * - * @param document The XML document from which to retrieve the messages. - * @param feed Receives the TraFF feed. - * @return `true` on success, `false` on failure. - */ bool ParseTraff(pugi::xml_document const & document, TraffFeed & feed) { bool result = false; diff --git a/traffxml/traff_model_xml.hpp b/traffxml/traff_model_xml.hpp index b60cadc6f..fa2320982 100644 --- a/traffxml/traff_model_xml.hpp +++ b/traffxml/traff_model_xml.hpp @@ -15,6 +15,31 @@ class xml_node; namespace traffxml { +/** + * @brief Retrieves a TraFF feed from an XML document. + * + * The document must conform loosely to the TraFF specification (currently version 0.8). + * + * The name of the root element is not verified, but the `message` elements must be its immediate + * children. + * + * Custom elements and attributes which are not part of the TraFF specification are ignored. + * + * Values which cannot be parsed correctly are skipped. + * + * Events whose event type does not match their event class are skipped. + * + * Messages, events, locations or points which lack mandatory information are skipped. + * + * If children are skipped but the parent remains valid, parsing it will report success. + * + * Parsing the feed will report failure if all its messages fail to parse, but not if it has no + * messages. + * + * @param document The XML document from which to retrieve the messages. + * @param feed Receives the TraFF feed. + * @return `true` on success, `false` on failure. + */ bool ParseTraff(pugi::xml_document const & document, TraffFeed & feed); /**