Rewrote the FileUtils support for data and library file paths, moving the

storage of the path lists into osgDB::Registry, and changed the data
structor from a char* to a std::deque.  Changed a names of couple of the
convinience functions in osgDB/FileUtils to better reflect the two
public FilePathList's - DataFilePathList and the LibraryFilePathList.

Added support into the osgDB::Registry::readNode/Image/Object methods
for pushing and popping the path of the current file being loaded.
This commit is contained in:
Robert Osfield
2002-06-17 21:50:37 +00:00
parent 27412c27c9
commit 6767dd49d0
17 changed files with 502 additions and 714 deletions

View File

@@ -36,15 +36,15 @@ DynamicLibrary::~DynamicLibrary()
DynamicLibrary* DynamicLibrary::loadLibrary(const std::string& libraryName)
{
char* fullLibraryName = osgDB::findDSO( libraryName.c_str() );
if (fullLibraryName==NULL) return NULL;
std::string fullLibraryName = osgDB::findLibraryFile(libraryName);
if (fullLibraryName.empty()) return NULL;
#if defined(WIN32) && !defined(__CYGWIN__)
HANDLE handle = LoadLibrary( fullLibraryName );
HANDLE handle = LoadLibrary( fullLibraryName.c_str() );
if (handle) return osgNew DynamicLibrary(libraryName,handle);
notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<std::endl;
#elif !defined(macintosh)
HANDLE handle = dlopen( fullLibraryName, RTLD_LAZY );
HANDLE handle = dlopen( fullLibraryName.c_str(), RTLD_LAZY );
if (handle) return osgNew DynamicLibrary(libraryName,handle);
notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<std::endl;
notify(WARN) << "DynamicLibrary::error "<<dlerror()<<std::endl;