diff options
| author | Greg Ercolano <erco@seriss.com> | 2010-01-01 18:30:49 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2010-01-01 18:30:49 +0000 |
| commit | b08153975c2b4faa052ab678b9d38f156a32b9e3 (patch) | |
| tree | d8c4bcb7aaed8feb1dc23dcce33e91983c404145 /src/filename_setext.cxx | |
| parent | 2164880821959e68fbf55061eba274ca176e9b69 (diff) | |
Updated filename.H function docs with indication of #include <FL/filename.H>
and in several cases, code examples.
Solves issue raised on fltk.general (12/30/09) by Alvin.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6986 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/filename_setext.cxx')
| -rw-r--r-- | src/filename_setext.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/filename_setext.cxx b/src/filename_setext.cxx index d922dd3aa..e61b59938 100644 --- a/src/filename_setext.cxx +++ b/src/filename_setext.cxx @@ -26,14 +26,24 @@ // // Replace .ext with new extension -// If no . in name, append new extension -// If new extension is null, act like it is "" #include <FL/filename.H> #include "flstring.h" /** - Replaces the extension in \p buf of max. size \p buflen with the extension in \p ext. + Replaces the extension in \p buf of max.<br> + size \p buflen with the extension in \p ext.<br> + If there's no '.' in \p buf, \p ext is appended.<br> + If \p ext is NULL, behaves as if it were an empty string (""). + + \b Example + \code + #include <FL/filename.H> + [..] + char buf[1024] = "/path/myfile.cxx"; + fl_filename_setext(buf, sizeof(buf), ".txt"); // buf[] becomes "/path/myfile.txt" + \endcode + \return buf itself for calling convenience. */ char *fl_filename_setext(char *buf, int buflen, const char *ext) { |
