]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/function.tex
*** empty log message ***
[wxWidgets.git] / docs / latex / wx / function.tex
index fe92c20c42d165482ae79a5456d57d2c29a27f06..4f60964ec6885504e5bf92976f1ea6ea6138b9d4 100644 (file)
@@ -37,15 +37,17 @@ Returns TRUE if the file exists.
 
 \func{wxString}{wxFileNameFromPath}{\param{const wxString\& }{path}}
 
-Returns a temporary pointer to the filename for a full path.
-Copy this pointer for long-term use.
+\func{char*}{wxFileNameFromPath}{\param{char* }{path}}
+
+Returns the filename for a full path. The second form returns a pointer to
+temporary storage that should not be deallocated.
 
 \membersection{::wxFindFirstFile}\label{wxfindfirstfile}
 
-\func{wxString}{wxFindFirstFile}{\param{const wxString\& }{spec}, \param{int}{ flags = 0}}
+\func{wxString}{wxFindFirstFile}{\param{const char*}{spec}, \param{int}{ flags = 0}}
 
 This function does directory searching; returns the first file
-that matches the path {\it spec}, or NULL. Use \helpref{wxFindNextFile}{wxfindnextfile} to
+that matches the path {\it spec}, or the empty string. Use \helpref{wxFindNextFile}{wxfindnextfile} to
 get the next matching file.
 
 {\it spec} may contain wildcards.
@@ -59,7 +61,7 @@ For example:
 
 \begin{verbatim}
   wxString f = wxFindFirstFile("/home/project/*.*");
-  while (f)
+  while (f != "")
   {
     ...
     f = wxFindNextFile();
@@ -89,8 +91,7 @@ or drive name at the beginning.
 
 \func{wxString}{wxPathOnly}{\param{const wxString\& }{path}}
 
-Returns a temporary pointer to the directory part of the filename. Copy this
-pointer for long-term use.
+Returns the directory part of the filename.
 
 \membersection{::wxUnix2DosFilename}
 
@@ -168,7 +169,7 @@ Returns TRUE if successful, FALSE otherwise.
 
 \membersection{::wxGetWorkingDirectory}
 
-\func{wxString}{wxGetWorkingDirectory}{\param{const wxString\& }{buf=NULL}, \param{int }{sz=1000}}
+\func{wxString}{wxGetWorkingDirectory}{\param{char*}{buf=NULL}, \param{int }{sz=1000}}
 
 This function is obsolete: use \helpref{wxGetCwd}{wxgetcwd} instead.
 
@@ -180,7 +181,7 @@ if the buffer is NULL.
 
 \membersection{::wxGetTempFileName}
 
-\func{wxString}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{const wxString\& }{buf=NULL}}
+\func{char*}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char* }{buf=NULL}}
 
 Makes a temporary filename based on {\it prefix}, opens and closes the file,
 and places the name in {\it buf}. If {\it buf} is NULL, new store
@@ -239,6 +240,27 @@ The {\it flags} parameter is reserved for future use.
 Sets the current working directory, returning TRUE if the operation succeeded.
 Under MS Windows, the current drive is also changed if {\it dir} contains a drive specification.
 
+\membersection{::wxSplitPath}\label{wxsplitfunction}
+
+\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{const wxString *}{ path}, \param{const wxString *}{ name}, \param{const wxString *}{ ext}}
+
+This function splits a full file name into components: the path (including possible disk/drive
+specification under Windows), the base name and the extension. Any of the output parameters
+({\it path}, {\it name} or {\it ext}) may be NULL if you are not interested in the value of
+a particular component.
+
+wxSplitPath() will correctly handle filenames with both DOS and Unix path separators under
+Windows, however it will not consider backslashes as path separators under Unix (where backslash
+is a valid character in a filename).
+
+On entry, {\it fullname} should be non NULL (it may be empty though).
+
+On return, {\it path} contains the file path (without the trailing separator), {\it name}
+contains the file name and {\it ext} contains the file extension without leading dot. All
+three of them may be empty if the corresponding component is. The old contents of the
+strings pointed to by these parameters will be overwritten in any case (if the pointers
+are not NULL).
+
 \section{String functions}
 
 \membersection{::copystring}
@@ -350,7 +372,7 @@ if other wxWindows calls will be made before the value is to be used.
 
 Pop up a dialog box with title set to {\it caption}, message {\it message}, and a
 \rtfsp{\it default\_value}.  The user may type in text and press OK to return this text,
-or press Cancel to return NULL.
+or press Cancel to return the empty string.
 
 If {\it centre} is TRUE, the message text (which may include new line characters)
 is centred; if FALSE, the message is left-justified.
@@ -393,7 +415,7 @@ is centred; if FALSE, the message is left-justified.
 
 Pops up a dialog box containing a message, OK/Cancel buttons and a single-selection
 listbox. The user may choose an item and press OK to return a string or
-Cancel to return NULL.
+Cancel to return the empty string.
 
 {\it choices} is an array of {\it n} strings for the listbox.
 
@@ -1412,7 +1434,7 @@ See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfig
 
 <wx/utils.h>
 
-\membersection{::wxYield}
+\membersection{::wxYield}\label{wxyield}
 
 \func{bool}{wxYield}{\void}