|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
Defines | |
| #define | FL_PATH_MAX 2048 |
| #define | fl_dirent_h_cyclic_include |
Typedefs | |
| typedef int( | Fl_File_Sort_F )(struct dirent **, struct dirent **) |
Functions | |
| FL_EXPORT const char * | fl_filename_name (const char *filename) |
| FL_EXPORT const char * | fl_filename_ext (const char *buf) |
| FL_EXPORT char * | fl_filename_setext (char *to, int tolen, const char *ext) |
| FL_EXPORT int | fl_filename_expand (char *to, int tolen, const char *from) |
| FL_EXPORT int | fl_filename_absolute (char *to, int tolen, const char *from) |
| FL_EXPORT int | fl_filename_relative (char *to, int tolen, const char *from) |
| FL_EXPORT int | fl_filename_match (const char *name, const char *pattern) |
| FL_EXPORT int | fl_filename_isdir (const char *name) |
| FL_EXPORT int | fl_alphasort (struct dirent **, struct dirent **) |
| FL_EXPORT int | fl_casealphasort (struct dirent **, struct dirent **) |
| FL_EXPORT int | fl_casenumericsort (struct dirent **, struct dirent **) |
| FL_EXPORT int | fl_numericsort (struct dirent **, struct dirent **) |
| int | fl_open_uri (const char *uri, char *msg, int msglen) |
File names and URI functions defined in <FL/filename.H>
| #define fl_dirent_h_cyclic_include |
Definition at line 106 of file filename.H.
| #define FL_PATH_MAX 2048 |
all path buffers should use this length
Definition at line 44 of file filename.H.
Referenced by Fl_File_Chooser::directory(), Fl_File_Chooser::filter(), Fl_File_Chooser::fl_dir_chooser(), Fl_File_Chooser::fl_file_chooser(), fl_filename_isdir(), fl_filename_list(), fl_filename_relative(), fl_open_uri(), goto_source_dir(), Fl_Help_View::load(), Fl_File_Browser::load(), Fl_File_Icon::load_system_icons(), Fl_Class_Type::open(), Fl_Comment_Type::open(), redo_cb(), Fl_File_Chooser::rescan(), Fl_File_Chooser::rescan_keep_filename(), save_template_cb(), set_modflag(), show_help(), undo_cb(), undo_checkpoint(), undo_clear(), update_history(), update_sourceview_cb(), Fl_File_Chooser::value(), write_cb(), and write_strings_cb().
| typedef int( Fl_File_Sort_F)(struct dirent **, struct dirent **) |
| FL_EXPORT int fl_alphasort | ( | struct dirent ** | , |
| struct dirent ** | |||
| ) |
Definition at line 44 of file filename_list.cxx.
| FL_EXPORT int fl_casealphasort | ( | struct dirent ** | , |
| struct dirent ** | |||
| ) |
Definition at line 48 of file filename_list.cxx.
| FL_EXPORT int fl_casenumericsort | ( | struct dirent ** | , |
| struct dirent ** | |||
| ) |
Definition at line 97 of file numericsort.c.
| FL_EXPORT int fl_filename_absolute | ( | char * | to, |
| int | tolen, | ||
| const char * | from | ||
| ) |
Makes a filename absolute from a relative filename.
#include <FL/filename.H> [..] chdir("/var/tmp"); fl_filename_absolute(out, sizeof(out), "foo.txt"); // out="/var/tmp/foo.txt" fl_filename_absolute(out, sizeof(out), "./foo.txt"); // out="/var/tmp/foo.txt" fl_filename_absolute(out, sizeof(out), "../log/messages"); // out="/var/log/messages"
| [out] | to | resulting absolute filename |
| [in] | tolen | size of the absolute filename buffer |
| [in] | from | relative filename |
Definition at line 65 of file filename_absolute.cxx.
References b, fl_getcwd(), isdirsep, start, and strlcpy.
Referenced by Fl_File_Chooser::directory(), update_history(), and Fl_File_Chooser::value().
| FL_EXPORT int fl_filename_expand | ( | char * | to, |
| int | tolen, | ||
| const char * | from | ||
| ) |
Expands a filename containing shell variables and tilde (~). Currently handles these variants:
"~username" // if 'username' does not exist, result will be unchanged "~/file" "$VARNAME" // does NOT handle ${VARNAME}
Examples:
#include <FL/filename.H> [..] putenv("TMPDIR=/var/tmp"); fl_filename_expand(out, sizeof(out), "~fred/.cshrc"); // out="/usr/fred/.cshrc" fl_filename_expand(out, sizeof(out), "~/.cshrc"); // out="/usr/<yourname>/.cshrc" fl_filename_expand(out, sizeof(out), "$TMPDIR/foo.txt"); // out="/var/tmp/foo.txt"
| [out] | to | resulting expanded filename |
| [in] | tolen | size of the expanded filename buffer |
| [in] | from | filename containing shell variables |
Definition at line 72 of file filename_expand.cxx.
References fl_getenv(), isdirsep, start, strlcpy, and value.
| FL_EXPORT const char* fl_filename_ext | ( | const char * | buf | ) |
Gets the extensions of a filename.
#include <FL/filename.H> [..] const char *out; out = fl_filename_ext("/some/path/foo.txt"); // result: ".txt" out = fl_filename_ext("/some/path/foo"); // result: NULL
| [in] | buf | the filename to be parsed |
Definition at line 43 of file filename_ext.cxx.
References buf.
Referenced by fl_filename_setext(), Fl_File_Icon::load(), and Fluid_Image::write_static().
| FL_EXPORT int fl_filename_isdir | ( | const char * | n | ) |
Determines if a file exists and is a directory from its filename.
#include <FL/filename.H> [..] fl_filename_isdir("/etc"); // returns non-zero fl_filename_isdir("/etc/hosts"); // returns 0
| [in] | n | the filename to parse |
Definition at line 61 of file filename_isdir.cxx.
References FL_PATH_MAX, fl_stat(), isdirsep, and length.
Referenced by _fl_filename_isdir_quick(), Fl_File_Icon::find(), fl_filename_list(), Fl_File_Chooser::rescan_keep_filename(), and Fl_File_Chooser::value().
| FL_EXPORT int fl_filename_match | ( | const char * | s, |
| const char * | p | ||
| ) |
Checks if a string s matches a pattern p. The following syntax is used for the pattern:
Include:
#include <FL/filename.H>
| [in] | s | the string to check for a match |
| [in] | p | the string pattern |
Definition at line 53 of file filename_match.cxx.
References fl_filename_match().
Referenced by do_matching(), Fl_File_Icon::find(), fl_filename_match(), Fl_Function_Type::has_signature(), Fl_File_Browser::load(), Fl_Plugin_Manager::loadAll(), and template_load().
| FL_EXPORT const char* fl_filename_name | ( | const char * | name | ) |
Gets the file name from a path. Similar to basename(3), exceptions shown below.
#include <FL/filename.H> [..] const char *out; out = fl_filename_name("/usr/lib"); // out="lib" out = fl_filename_name("/usr/"); // out="" (basename(3) returns "usr" instead) out = fl_filename_name("/usr"); // out="usr" out = fl_filename_name("/"); // out="" (basename(3) returns "/" instead) out = fl_filename_name("."); // out="." out = fl_filename_name(".."); // out=".."
filename if there is none.returns pointer to the filename, or null if name ends with ':'
Definition at line 2339 of file Fl_mac.cxx.
References name.
Referenced by Fl_File_Icon::find(), Fl_File_Chooser::fl_file_chooser(), fl_show_file_selector(), goto_source_dir(), Fl_Window::show(), update_sourceview_cb(), write_cb(), Fluid_Image::write_code(), write_code(), Fluid_Image::write_static(), and write_strings_cb().
| FL_EXPORT int fl_filename_relative | ( | char * | to, |
| int | tolen, | ||
| const char * | from | ||
| ) |
Makes a filename relative to the current working directory.
#include <FL/filename.H> [..] chdir("/var/tmp/somedir"); // set cwd to /var/tmp/somedir [..] char out[FL_PATH_MAX]; fl_filename_relative(out, sizeof(out), "/var/tmp/somedir/foo.txt"); // out="foo.txt", return=1 fl_filename_relative(out, sizeof(out), "/var/tmp/foo.txt"); // out="../foo.txt", return=1 fl_filename_relative(out, sizeof(out), "foo.txt"); // out="foo.txt", return=0 (no change) fl_filename_relative(out, sizeof(out), "./foo.txt"); // out="./foo.txt", return=0 (no change) fl_filename_relative(out, sizeof(out), "../foo.txt"); // out="../foo.txt", return=0 (no change)
| [out] | to | resulting relative filename |
| [in] | tolen | size of the relative filename buffer |
| [in] | from | absolute filename |
Definition at line 137 of file filename_absolute.cxx.
References fl_filename_relative(), fl_getcwd(), FL_PATH_MAX, and strlcpy.
Referenced by Fl_File_Chooser::fl_dir_chooser(), Fl_File_Chooser::fl_file_chooser(), fl_filename_relative(), load_history(), and update_history().
| FL_EXPORT char* fl_filename_setext | ( | char * | buf, |
| int | buflen, | ||
| const char * | ext | ||
| ) |
Replaces the extension in buf of max.
size buflen with the extension in ext.
If there's no '.' in buf, ext is appended.
If ext is NULL, behaves as if it were an empty string ("").
Example
#include <FL/filename.H> [..] char buf[FL_PATH_MAX] = "/path/myfile.cxx"; fl_filename_setext(buf, sizeof(buf), ".txt"); // buf[] becomes "/path/myfile.txt"
Definition at line 49 of file filename_setext.cxx.
References fl_filename_ext(), and strlcpy.
Referenced by update_sourceview_cb(), write_cb(), and write_strings_cb().
| FL_EXPORT int fl_numericsort | ( | struct dirent ** | , |
| struct dirent ** | |||
| ) |
Definition at line 105 of file numericsort.c.
| int fl_open_uri | ( | const char * | uri, |
| char * | msg, | ||
| int | msglen | ||
| ) |
Opens the specified Uniform Resource Identifier (URI). Uses an operating-system dependent program or interface. For URIs using the "ftp", "http", or "https" schemes, the system default web browser is used to open the URI, while "mailto" and "news" URIs are typically opened using the system default mail reader and "file" URIs are opened using the file system navigator.
On success, the (optional) msg buffer is filled with the command that was run to open the URI; on Windows, this will always be "open uri".
On failure, the msg buffer is filled with an English error message.
Example
#include <FL/filename.H> [..] char errmsg[512]; if ( !fl_open_uri("http://google.com/", errmsg, sizeof(errmsg)) ) { char warnmsg[768]; sprintf(warnmsg, "Error: %s", errmsg); fl_alert(warnmsg); }
| uri | The URI to open |
| msg | Optional buffer which contains the command or error message |
| msglen | Length of optional buffer |
Definition at line 95 of file fl_open_uri.cxx.
References FL_PATH_MAX, i, NULL, snprintf, strlcat, and strlcpy.
Referenced by Fl_Help_View::load().