InterViews Reference Manual -- FileBrowser

NAME
FileBrowser - browse and/or select file names
SYNOPSIS
#include <InterViews/filebrowser.h>
DESCRIPTION
FileBrowser is a StringBrowser that displays file names. In addition to the standard StringBrowser constructor parameters, the FileBrowser constructor takes a directory name as an argument. The FileBrowser scans the corresponding directory, appending the file names to its list of strings. FileBrowser lets the user choose a file name, and the application queries the FileBrowser for the chosen file.
PUBLIC OPERATIONS
FileBrowser(ButtonState*, const char* dir, int rows, int cols,
bool uniqueSel, int highlight, const char* done)
FileBrowser(const char* name, ButtonState*, const char*, int,
int, bool, int, const char*)
Create a new FileBrowser object. The ButtonState, rows, cols, uniqueSel, highlight, done, and name parameters have semantics identical to those of the corresponding StringBrowser parameters. The dir parameter specifies the directory to search for file names. Internally, FileBrowser prepends dir to relative path specifications in operations that require them, thus avoiding a chdir(2).
bool IsADirectory(const char*)
Return whether or not the given relative path corresponds to a valid directory.
bool SetDirectory(const char* newdir)
Change the search directory to newdir if that directory is accessible. The function returns true if successful.
const char* GetDirectory()
Return the name of the search directory.
const char* ValidDirectories(const char* path)
Given a path string, return the largest substring (starting from the beginning of path) that represents a valid path. The substring is returned in a static buffer and should be copied before use.
const char* Normalize(const char* path)
Return a normalized version of path with all spurious slashes, dots, and tildes interpreted. The normalized path is returned in a static buffer and should be copied before use.
const char* Path(int i)
Return the ith string as it appears in the FileBrowser. This function prepends the search directory to the string, normalizes the concatenation, and returns the result.
SEE ALSO
Interactor , Button , StringBrowser

Next: FileChooser | Prev: Event | Up: index | Top: index