FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
xml_serializer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2025-present FERS Contributors (see AUTHORS.md).
4//
5// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
6
7/**
8 * @file xml_serializer.h
9 * @brief Provides functions to serialize the simulation world back into the FERS XML format.
10 */
11
12#pragma once
13
14#include <string>
15
16namespace core
17{
18 class World;
19}
20
21namespace serial
22{
23 /**
24 * @brief Serializes the entire simulation world into an XML formatted string.
25 *
26 * This function serves as the reverse of the XML parser. It is essential for allowing
27 * users to modify a scenario in a UI and then export their changes back into a valid
28 * FERS XML file that can be used by the CLI or shared. It iterates through the
29 * in-memory `core::World` object and reconstructs the corresponding XML structure.
30 *
31 * @param world The world object to serialize.
32 * @return A string containing the XML representation of the world.
33 */
34 std::string world_to_xml_string(const core::World& world);
35}
The World class manages the simulator environment.
Definition world.h:38
std::string world_to_xml_string(const core::World &world)
Serializes the entire simulation world into an XML formatted string.