#include "externals.hh" #include "c-project.hh" /*= A_ProjectPathListener ====================================================*/ A_ProjectPathListener::~A_ProjectPathListener( ) {} /*= T_Project ================================================================*/ void T_Project::setBasePath( T_FSPath const& path ) noexcept { assert( path.isValid( ) ); if ( basePath_ == path ) { return; } if ( path.isRelative( ) ) { basePath_ = ( Filesystem::Cwd( ) + path ).canonical( ); } else { basePath_ = path.canonical( ); } const auto n{ listeners_.size( ) }; for ( auto i = 0u ; i < n ; i ++ ) { listeners_[ i ]->projectPathChanged( ); } } /*----------------------------------------------------------------------------*/ T_String T_Project::pathOf( T_String const& file ) const noexcept { return ( basePath_ + T_FSPath{ file } ).canonical( ).toString( ); } T_String T_Project::pathOf( char const* file ) const noexcept { return ( basePath_ + T_FSPath{ file } ).canonical( ).toString( ); }