mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[traffxml] Documentation
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user