FileSel based utility functions
|
|
These functions simplify opening files using single global file-selector. The configuration of file-selector is stored into global configuration.
String SelectFileOpen(const char *types)
Selects file for opening, types follow rules of Types method of FileSel. If selections is canceled, returns empty String.
String SelectFileSaveAs(const char *types)
Selects file for saving, types follow rules of Types method of FileSel. If selections is canceled, returns empty String.
String SelectDirectory()
Selects directory.
String SelectLoadFile(const char *types)
Selects file and loads it, types follow rules of Types method of FileSel. If selections is canceled or file cannot be opened, returns empty String::GetVoid().
bool SelectSaveFile(const char *types, const String& data)
Selects file and saves data to it, types follow rules of Types method of FileSel. Returns true on success.
This class inherits FileIn. Its constructor invokes global FileSel and opens selected file for reading:
SelectFileIn(const char *types)
types follow rules of Types method of FileSel. In case of any failure (selection is canceled, open fails), the resulting object is not in opened state (can be tested using operator bool).
This class inherits FileOut. Its constructor invokes global FileSel and opens selected file for writing:
SelectFileOut(const char *types)
types follow rules of Types method of FileSel. In case of any failure (selection is canceled, open fails), the resulting object is not in opened state (can be tested using operator bool).
|