Пример #1
0
bool Service::SaveConfig( ConfigBase &config )
{
  config.WriteConfig( "ServiceID",    service_id );
  config.WriteConfig( "PID",          pid );
  config.WriteConfig( "Type",         type );
  config.WriteConfig( "Name",         name );
  config.WriteConfig( "Provider",     provider );
  config.WriteConfig( "Channel",      channel ? channel->GetKey( ) : -1 );

  config.DeleteConfig( "Streams" );
  Setting &n = config.ConfigList( "Streams" );
  ConfigBase c( n );
  for( std::map<uint16_t, Stream *>::iterator it = streams.begin( ); it != streams.end( ); it++ )
  {
    Setting &n2 = c.ConfigGroup( );
    ConfigBase c2( n2 );
    it->second->SaveConfig( c2 );
  }

  config.DeleteConfig( "CA" );
  Setting &n2 = config.ConfigList( "CA" );
  ConfigBase c2( n2 );
  for( std::set<std::pair<uint16_t, uint16_t> >::iterator it = caids.begin( ); it != caids.end( ); it++ )
  {
    Setting &n3 = c2.ConfigGroup( );
    ConfigBase c3( n3 );
    c3.WriteConfig( "CA_id", it->first );
    c3.WriteConfig( "CA_pid", it->second );
  }
  return true;
}
Пример #2
0
bool Event::SaveConfig( ConfigBase &config )
{
  config.WriteConfig( "EventID",     id );
  config.WriteConfig( "Start",       start );
  config.WriteConfig( "Duration",    duration );
  config.WriteConfig( "Name",        name );
  config.WriteConfig( "Description", description );
  config.WriteConfig( "Language",    language );
}