rsked/source.cc
/// Convert a medium string to a mode enum. This is case *sensitive*.
/// * May throw Schedule_error
///
Convert a medium string to a mode enum. This is case *sensitive*.
Convert a medium string to a mode enum . This is case * sensitive * .
Medium strtomedium( const std::string &s )
{
    if (s == "off") {
        return Medium::off;
    } else if (s == "radio") {
        return Medium::radio;
    } else if (s == "stream") {
        return Medium::stream;
    } else if (s == "file") {
        return Medium::file;
    } else if (s == "directory") {
        return Medium::directory;
    } else if (s == "playlist") {
        return Medium::playlist;
    }
    LOG_ERROR(Lgr) << "Unknown medium '" << s << "'";
    throw Schedule_error();
}
Medium strtomedium ( const std :: string & s ) { if ( s == " " ) { return Medium :: off ; } else if ( s == " " ) { return Medium :: radio ; } else if ( s == " " ) { return Medium :: stream ; } else if ( s == " " ) { return Medium :: file ; } else if ( s == " " ) { return Medium :: directory ; } else if ( s == " " ) { return Medium :: playlist ; } LOG_ERROR ( Lgr ) << " " << s << " " ; throw Schedule_error ( ) ; }
Convert a medium string to a mode enum.
Convert a medium string to a mode enum .