Пример #1
0
bool StLibrary::load(const StString& thePath) {
    // this is probably some logical error in the code if close() wasn't explicitly called before!
    ST_ASSERT(!isOpened(), "StLibrary::load() - library is already opened!");
    close();
    StString aDinLibExt = StString(ST_DLIB_SUFFIX);
    if(thePath.isEndsWithIgnoreCase(aDinLibExt)) {
        // got the full path?
        myPath = thePath;
        myLibH = DLibLoadFull(myPath);
        if(myLibH == NULL) {
            // try to remove an extension
            myPath = thePath.subString(0, thePath.getLength() - aDinLibExt.getLength());
            myLibH = DLibLoad(myPath);
        }
    } else {
        // got short name?
        myPath = thePath;
        myLibH = DLibLoad(myPath);
    }
    return isOpened();
}