* tdm_reaper.cpp: debug loggin for XML parse doc
* tdm_reaper.hpp: provide channelgroup/channel meta data objects * main.cpp: finish full CLI tool
This commit is contained in:
@@ -53,6 +53,13 @@ void tdm_reaper::process_tdm(bool showlog)
|
||||
std::cout<<"encoding: "<<(pugi::xml_encoding)xml_result_.encoding<<"\n\n";
|
||||
}
|
||||
|
||||
// check XML parse result
|
||||
if ( xml_result_.status != 0 )
|
||||
{
|
||||
throw std::runtime_error( std::string("failed to parse XML tree: " )
|
||||
+ xml_result_.description() );
|
||||
}
|
||||
|
||||
// collect meta-data
|
||||
pugi::xml_node tdmdocu = xml_doc_.child("usi:tdm").child("usi:documentation");
|
||||
meta_data_.docu_expo_ = tdmdocu.child_value("usi:exporter");
|
||||
|
@@ -160,6 +160,24 @@ public:
|
||||
return tdmroot_;
|
||||
}
|
||||
|
||||
// get channel/channelgroup meta object
|
||||
tdm_channel& channel(std::string channelid)
|
||||
{
|
||||
if ( tdmchannels_.count(channelid) == 1 ) {
|
||||
return tdmchannels_.at(channelid);
|
||||
} else {
|
||||
throw std::runtime_error(std::string("channel does not exist: ") + channelid);
|
||||
}
|
||||
}
|
||||
tdm_channelgroup& channelgroup(std::string groupid)
|
||||
{
|
||||
if ( tdmchannelgroups_.count(groupid) == 1 ) {
|
||||
return tdmchannelgroups_.at(groupid);
|
||||
} else {
|
||||
throw std::runtime_error(std::string("channelgroup does not exist: ") + groupid);
|
||||
}
|
||||
}
|
||||
|
||||
// get full channel(group) overview
|
||||
std::string get_channel_overview(format chformatter);
|
||||
|
||||
|
Reference in New Issue
Block a user