1. added wxFileName::CreateTempFileName() and implemented it properly (using

mkstemp() when available)
2. wxTempFile::Open() and wxGetTempFileName() now use CreateTempFileName()
   avoiding code duplication
3. updated the docs


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-12-01 17:18:11 +00:00
parent 1d21855083
commit ade35f11fe
11 changed files with 543 additions and 352 deletions

View File

@@ -234,15 +234,33 @@ get the value of user home (Unix only mainly)
\func{void}{AssignTempFileName}{\param{const wxString\& }{prefix}}
get a temp file name starting with thespecified prefix
The function calls \helpref{CreateTempFileName}{wxfilenamecreatetempfilename} to
create a temporary file and sets this object to the name of the file. If a
temporary file couldn't be created, the object is put into the\rtfsp
\helpref{invalid}{wxfilenameisok} state.
\membersection{wxFileName::Clear}\label{wxfilenameclear}
\func{void}{Clear}{\void}
reset all components to default, uninitialized state
Reset all components to default, uninitialized state.
\membersection{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename}
\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}}
Returns a temporary file name starting with the given {\it prefix}. If
the {\it prefix} is an absolute path, the temporary file is created in this
directory, otherwise it is created in the default system directory for the
temporary files or in the current directory.
If the function succeeds, the temporary file is actually created (but not
opened) as well. Under Unix, it will have read and write permissions for the
owner only.
\wxheading{Return value}
The full temporary file name or an empty string on error.
\membersection{wxFileName::DirExists}\label{wxfilenamedirexists}
@@ -443,9 +461,10 @@ are the file names of this type cases sensitive?
\constfunc{bool}{IsOk}{\void}
file tests
is the filename valid at all?
Returns {\tt TRUE} if the filename is valid, {\tt FALSE} if it is not
initialized yet. The assignment functions and
\helpref{Clear}{wxfilenameclear} may reset the object to the uninitialized,
invalid state (the former only do it on failure).
\membersection{wxFileName::IsPathSeparator}\label{wxfilenameispathseparator}

View File

@@ -265,15 +265,19 @@ if the buffer is NULL.
\func{bool}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{wxString\& }{buf}}
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
is allocated for the temporary filename using {\it new}.
%% 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
%% is allocated for the temporary filename using {\it new}.
%%
%% Under Windows, the filename will include the drive and name of the
%% directory allocated for temporary files (usually the contents of the
%% TEMP variable). Under Unix, the {\tt /tmp} directory is used.
%%
%% It is the application's responsibility to create and delete the file.
Under Windows, the filename will include the drive and name of the
directory allocated for temporary files (usually the contents of the
TEMP variable). Under Unix, the {\tt /tmp} directory is used.
It is the application's responsibility to create and delete the file.
These functions are obsolete, please use\rtfsp
\helpref{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename}\rtfsp
instead.
\membersection{::wxIsWild}\label{wxiswild}