rsked/source.cc
/// Compute, check, and record in m_res_path member the full pathname
/// of a host local resource. (Not applicable to radio or streams.)
/// The resource is generally a relative path. A relative path is
/// combined with one of the directory arguments:
///   - lib_path : the music library directory
///   - ann_path : the announcements directory
///   - pl_path : the playlist directory
///
/// Checks for existence of a file, directory, or playlist resource *if*
/// that is possible. Note that dynamic sources have pathnames might not
/// exist on any given day.  If a directory, it must have a readable file.
///
/// * Throws Schedule_error if it finds a provably invalid source.
///
Compute, check, and record in m_res_path member the full pathname
of a host local resource. (Not applicable to radio or streams.)
The resource is generally a relative path. A relative path is
combined with one of the directory arguments:
lib_path : the music library directory
ann_path : the announcements directory
pl_path : the playlist directory

Checks for existence of a file, directory, or playlist resource *if
that is possible. Note that dynamic sources have pathnames might not
exist on any given day.  If a directory, it must have a readable file.

Throws Schedule_error if it finds a provably invalid source.
Compute check and record in m_res_path member the full pathname of a host local resource . ( Not applicable to radio or streams . ) The resource is generally a relative path . A relative path is combined with one of the directory arguments : lib_path : the music library directory ann_path : the announcements directory pl_path : the playlist directory Checks for existence of a file directory or playlist resource * if that is possible . Note that dynamic sources have pathnames might not exist on any given day . If a directory it must have a readable file . Throws Schedule_error if it finds a provably invalid source .
void Source::validate(const ResPathSpec &rps ) 
{
    switch (m_medium) {
    case Medium::off:
    case Medium::radio:
    case Medium::stream:
        return;
    case Medium::file:
    case Medium::directory:
        if (m_announcementp) {
            rps.resolve_announcement(m_resource, m_res_path);
        } else {
            rps.resolve_library(m_resource, m_res_path);
        }
        break;
    case Medium::playlist:
        rps.resolve_playlist(m_resource, m_res_path);
        break;
    };
    try {
        if (not m_res_path.empty() and not m_dynamic) {
            verify_readable( m_res_path );
        }
    }
    catch( std::exception &ex ) {
        LOG_ERROR(Lgr) << "Source '" << m_name << "': " << ex.what();
        throw Schedule_error();
    }
}
void Source :: validate ( const ResPathSpec & rps ) { switch ( m_medium ) { case Medium :: off : case Medium :: radio : case Medium :: stream : return ; case Medium :: file : case Medium :: directory : if ( m_announcementp ) { rps . resolve_announcement ( m_resource , m_res_path ) ; } else { rps . resolve_library ( m_resource , m_res_path ) ; } break ; case Medium :: playlist : rps . resolve_playlist ( m_resource , m_res_path ) ; break ; } ; try { if ( not m_res_path . empty ( ) and not m_dynamic ) { verify_readable ( m_res_path ) ; } } catch ( std :: exception & ex ) { LOG_ERROR ( Lgr ) << " " << m_name << " " << ex . what ( ) ; throw Schedule_error ( ) ; } }
Compute, check, and record in m_res_path member the full pathname
of a host local resource.
Compute check and record in m_res_path member the full pathname of a host local resource .
// rpspec