30#include "common/support/CommonSupportXML.h"
31#include "dim/support/DimSupportXML.h"
32#include "spat/support/SpatSupportXML.h"
44 using spat::ptreesupport::operator<<;
48 dclspc
void ReadConnection(
const boost::property_tree::ptree& pt, Track::End& trackend )
noexcept;
49 dclspc
void ReadTrackEnd(
const boost::property_tree::ptree& pt, Track::End& trackend )
noexcept;
50 dclspc
void ReadTrackLocation(
const boost::property_tree::ptree& pt, TrackLocation& trackLocation )
noexcept;
51 dclspc
void ReadTrackLocationRef(
const boost::property_tree::ptree& pt, TrackLocationRef& trackLocationRef )
noexcept;
52 dclspc
void ReadTrackRange(
const boost::property_tree::ptree& pt, TrackRange& trackRange )
noexcept;
56 template<
class Interface>
57 inline void WriteLocalizedTag(
58 boost::property_tree::ptree& pt,
59 const std::string& tagName,
60 const Interface& refInterface )
62 auto localizedNames = refInterface.ReferenceNames( tagName +
"_" );
63 for(
const auto& localizedName : localizedNames ){
64 std::string localizedString{ localizedName };
65 boost::property_tree::ptree ptLocalizedTag;
66 std::string languageName = localizedString.substr( tagName.size() + 1 );
67 if( languageName !=
"unknown" )
68 ptLocalizedTag.add(
"<xmlattr>.language", localizedString.substr( tagName.size() + 1 ) );
70 ptLocalizedTag.put(
"", refInterface.Reference(localizedString) );
71 pt.add_child( tagName, ptLocalizedTag );
75 template<
class Interface>
76 inline void ReadLocalizedTag(
77 const boost::property_tree::ptree& pt,
79 Interface& refInterface,
80 const char* localeString )
82 auto optional = pt.get_optional<std::string>(
"<xmlattr>.language" );
84 refInterface.Reference( std::string{ tagName } +
"_" + *optional, pt.data() );
86 if( refInterface.Reference( tagName ).empty() || localeString == *optional )
87 refInterface.Reference( tagName, pt.data() );
90 refInterface.Reference( std::string{ tagName } +
"_unknown", pt.data() );
92 if( refInterface.Reference( tagName ).empty() )
93 refInterface.Reference( tagName, pt.data() );
102 inline void move_child(
103 boost::property_tree::ptree& toParent,
104 const boost::property_tree::ptree::path_type& path,
105 boost::property_tree::ptree& value )
107 toParent.add_child( path, boost::property_tree::ptree{} ).swap( value );
Home of the Track and TrackBuilder interfaces.
ptree operator support
Definition CommonSupportXML.h:42
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
A TrackLocation ist a location on a single track.
Definition TrackLocation.h:43
A track location, referencing the track by id.
Definition TrackLocation.h:102
An interval on a track, referenced by an id.
Definition TrackLocation.h:132