Exemplo n.º 1
0
boolean FBDirectory::LoadDirectory(const char* name) {
    char buf[max_filename_length+2];
    const char* path = buf;

    strcpy(buf, ValidDirectories(RealPath(name)));
    return Reset(buf);
}
Exemplo n.º 2
0
bool Directory::LoadDirectory (const char* name) {
    char buf[MAX_PATH_LENGTH+2];
    const char* path = buf;

    strcpy(buf, ValidDirectories(RealPath(name)));
    return Reset(buf);
}
Exemplo n.º 3
0
void FileBrowser::Init(const char* d) {
    dir = new FBDirectory(d);
    lastpath = fb_strdup(ValidDirectories(Normalize(d)));
    regexp = nil;
    directory_regexp = nil;
    mode = 0;
    directory_mode = 0;
}
Exemplo n.º 4
0
boolean FileBrowser::SetDirectory(const char* path) {
    boolean successful = true;
    path = ValidDirectories(path);
    const char* normpath = Normalize(path);

    if (strcmp(normpath, lastpath) != 0) {
        char* newnormpath = fb_strdup(normpath);
        successful = dir->LoadDirectory(newnormpath);

        if (successful) {
            delete [] lastpath;
            lastpath = newnormpath;
            UpdateStrings();
        } else {
            delete [] newnormpath;
        }
    }
    return successful;
}