- std::string pth = tokens[ 0 ];
- std::string lib = tokens[ 1 ];
- if( lib.find( "*" ) != std::string::npos )
- {
- std::string ext( cpPlugins_LIB_EXT );
- DIR* dir;
- struct dirent* ent;
- if( ( dir = opendir( pth.c_str( ) ) ) != NULL )
- {
- while( ( ent = readdir( dir ) ) != NULL )
- {
- std::string fname( ent->d_name );
- long pos = long( fname.size( ) ) - long( ext.size( ) );
- if( pos > 0 )
- {
- if( fname.substr( pos ) == ext )
- {
- std::regex re( lib );
- std::smatch match;
- if( std::regex_search( fname, match, re ) && match.size( ) >= 1 )
- {
- std::stringstream str;
- str
- << pth << cpPlugins_PATH_SEPARATOR << fname;
- libs.insert( str.str( ) );
- } // fi
-
- } // fi
-
- } // fi
-
- } // elihw
- closedir( dir );
-
- } // fi
- }
- else
- {
- std::stringstream str;
- str
- << pth << cpPlugins_PATH_SEPARATOR << cpPlugins_LIB_PREFIX
- << lib << cpPlugins_LIB_EXT;
- libs.insert( str.str( ) );
-
- } // fi
-
- } // fi
+ std::string dname, fname;
+ cpPlugins::OS::SplitPath( dname, fname, line );
+ auto files = cpPlugins::OS::LoadDirContents( dname, false, fname );
+ for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt )
+ libs.insert( *fIt );
+ }
+ else
+ libs.insert( line );