fltk
1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
![]() ![]() |
Macros | |
#define | FL_PATH_MAX 2048 |
#define | fl_dirent_h_cyclic_include |
Typedefs | |
typedef int() | Fl_File_Sort_F(struct dirent **, struct dirent **) |
Functions | |
const char * | fl_filename_name (const char *filename) |
const char * | fl_filename_ext (const char *buf) |
char * | fl_filename_setext (char *to, int tolen, const char *ext) |
int | fl_filename_expand (char *to, int tolen, const char *from) |
int | fl_filename_absolute (char *to, int tolen, const char *from) |
int | fl_filename_relative (char *to, int tolen, const char *from) |
int | fl_filename_match (const char *name, const char *pattern) |
int | fl_filename_isdir (const char *name) |
int | fl_alphasort (struct dirent **, struct dirent **) |
int | fl_casealphasort (struct dirent **, struct dirent **) |
int | fl_casenumericsort (struct dirent **, struct dirent **) |
int | fl_numericsort (struct dirent **, struct dirent **) |
int | fl_open_uri (const char *uri, char *msg, int msglen) |
void | fl_decode_uri (char *uri) |
File names and URI functions defined in <FL/filename.H>
#define fl_dirent_h_cyclic_include |
Definition at line 100 of file filename.H.
#define FL_PATH_MAX 2048 |
all path buffers should use this length
Definition at line 38 of file filename.H.
Definition at line 37 of file filename_list.cxx.
Definition at line 41 of file filename_list.cxx.
void fl_decode_uri | ( | char * | uri | ) |
Decodes a URL-encoded string.
In a Uniform Resource Identifier (URI), all non-ASCII bytes and several others (e.g., '<', '', ' ') are URL-encoded using 3 bytes by "%XY" where XY is the hexadecimal value of the byte. This function decodes the URI restoring its original UTF-8 encoded content. Decoding is done in-place.
Definition at line 253 of file fl_open_uri.cxx.
References last.
int fl_filename_absolute | ( | char * | to, |
int | tolen, | ||
const char * | from | ||
) |
Makes a filename absolute from a relative filename.
[out] | to | resulting absolute filename |
[in] | tolen | size of the absolute filename buffer |
[in] | from | relative filename |
Definition at line 56 of file filename_absolute.cxx.
References b, fl_getcwd(), isdirsep, start(), and strlcpy.
Referenced by Fl_File_Chooser::directory(), Fl_File_Chooser::fileNameCB(), update_history(), and Fl_File_Chooser::value().
int fl_filename_expand | ( | char * | to, |
int | tolen, | ||
const char * | from | ||
) |
Expands a filename containing shell variables and tilde (~). Currently handles these variants:
Examples:
[out] | to | resulting expanded filename |
[in] | tolen | size of the expanded filename buffer |
[in] | from | filename containing shell variables |
Definition at line 63 of file filename_expand.cxx.
References fl_getenv(), isdirsep, pwd, start(), and strlcpy.
Referenced by Fl_File_Chooser::fileNameCB().
Gets the extensions of a filename.
[in] | buf | the filename to be parsed |
Definition at line 34 of file filename_ext.cxx.
Referenced by fl_filename_setext(), Fl_File_Icon::load(), and Fluid_Image::write_static().
int fl_filename_isdir | ( | const char * | n | ) |
Determines if a file exists and is a directory from its filename.
[in] | n | the filename to parse |
Definition at line 52 of file filename_isdir.cxx.
References FL_PATH_MAX, fl_stat(), isdirsep, and length.
Referenced by _fl_filename_isdir_quick(), extract_dir_from_path(), Fl_File_Chooser::fileNameCB(), Fl_File_Icon::find(), fl_filename_list(), load_kde_icons(), Fl_File_Chooser::update_preview(), and Fl_File_Chooser::value().
Checks if a string s
matches a pattern p
. The following syntax is used for the pattern:
Include:
[in] | s | the string to check for a match |
[in] | p | the string pattern |
Definition at line 44 of file filename_match.cxx.
Referenced by Fl_GTK_File_Chooser::custom_gtk_filter_function(), do_matching(), Fl_File_Icon::find(), Fl_Function_Type::has_signature(), Fl_File_Browser::load(), Fl_Plugin_Manager::loadAll(), and template_load().
Gets the file name from a path. Similar to basename(3), exceptions shown below.
filename
if there is none. Definition at line 2179 of file Fl_win32.cxx.
Referenced by Fl_GTK_File_Chooser::changed_output_type(), Fl_GTK_File_Chooser::custom_gtk_filter_function(), Fl_File_Icon::find(), Fl_File_Chooser::fl_file_chooser(), Fl_GTK_File_Chooser::fl_gtk_chooser_wrapper(), fl_show_file_selector(), goto_source_dir(), Fl_Window::show(), update_sourceview_cb(), write_cb(), write_code(), Fluid_Image::write_static(), and write_strings_cb().
int fl_filename_relative | ( | char * | to, |
int | tolen, | ||
const char * | from | ||
) |
Makes a filename relative to the current working directory.
[out] | to | resulting relative filename |
[in] | tolen | size of the relative filename buffer |
[in] | from | absolute filename |
Definition at line 128 of file filename_absolute.cxx.
References fl_getcwd(), FL_PATH_MAX, and strlcpy.
Referenced by Fl_File_Chooser::fl_dir_chooser(), Fl_File_Chooser::fl_file_chooser(), load_history(), and update_history().
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
Definition at line 40 of file filename_setext.cxx.
References buf, buflen, fl_filename_ext(), and strlcpy.
Referenced by update_sourceview_cb(), write_cb(), and write_strings_cb().
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
uri | The URI to open |
msg | Optional buffer which contains the command or error message |
msglen | Length of optional buffer |
Definition at line 98 of file fl_open_uri.cxx.
References command(), FL_PATH_MAX, NULL, path_find(), run_program(), snprintf, strlcat, and strlcpy.
Referenced by Fl_Help_View::load(), and show_help().