From b08153975c2b4faa052ab678b9d38f156a32b9e3 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Fri, 1 Jan 2010 18:30:49 +0000 Subject: Updated filename.H function docs with indication of #include 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 --- src/filename_setext.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/filename_setext.cxx') 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 #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.
+ size \p buflen with the extension in \p ext.
+ If there's no '.' in \p buf, \p ext is appended.
+ If \p ext is NULL, behaves as if it were an empty string (""). + + \b Example + \code + #include + [..] + 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) { -- cgit v1.2.3