]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/filename.tex
fix ReceiveTimeout() reference
[wxWidgets.git] / docs / latex / wx / filename.tex
CommitLineData
2569938d
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: filename.tex
3%% Purpose: wxFileName documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 30.11.01
7%% RCS-ID: $Id$
8%% Copyright: (c) 2001 Vadim Zeitlin
8795498c 9%% License: wxWindows license
2569938d
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxFileName}}\label{wxfilename}
13
14wxFileName encapsulates a file name. This class serves two purposes: first, it
15provides the functions to split the file names into components and to recombine
16these components in the full file name which can then be passed to the OS file
fc2171bd 17functions (and \helpref{wxWidgets functions}{filefunctions} wrapping them).
2569938d 18Second, it includes the functions for working with the files itself. Note that
95c00185 19to change the file data you should use \helpref{wxFile}{wxfile} class instead.
2569938d
VZ
20wxFileName provides functions for working with the file attributes.
21
51cb1a65
RR
22When working with directory names (i.e. without filename and extension)
23make sure not to misuse the file name part of this class with the last
24directory. Instead initialize the wxFileName instance like this:
25
26\begin{verbatim}
27wxFileName dirname( wxT("C:\mydir"), wxEmptyString );
28MyMethod( dirname.GetPath() );
29\end{verbatim}
30
faa3bd94
RR
31The same can be done using the static method \helpref{wxFileName::DirName}{wxfilenamedirname}:
32
33\begin{verbatim}
34wxFileName dirname = wxFileName::DirName( wxT("C:\mydir") );
35MyMethod( dirname.GetPath() );
36\end{verbatim}
37
51cb1a65 38Accordingly, methods dealing with directories or directory names
faa3bd94 39like \helpref{IsDirReadable}{wxfilenameisdirreadable} use
51cb1a65 40\helpref{GetPath}{wxfilenamegetpath} whereas methods dealing
faa3bd94 41with file names like \helpref{IsFileReadable}{wxfilenameisfilereadable}
51cb1a65
RR
42use \helpref{GetFullPath}{wxfilenamegetfullpath}.
43
44If it is not known wether a string contains a directory name or
45a complete file name (such as when interpreting user input) you need to use
46the static function \helpref{wxFileName::DirExists}{wxfilenamedirexists}
faa3bd94
RR
47(or its identical variants \helpref{wxDir::Exists}{wxdirexists} and
48\helpref{wxDirExists}{functionwxdirexists}) and construct the wxFileName
49instance accordingly. This will only work if the directory actually exists,
50of course:
51cb1a65
RR
51
52\begin{verbatim}
53wxString user_input;
54// get input from user
55
56wxFileName fname;
57if (wxDirExists(user_input))
58 fname.AssignDir( user_input );
59else
60 fname.Assign( user_input );
61\end{verbatim}
62
2569938d
VZ
63\wxheading{Derived from}
64
65No base class
66
93ab511d
VZ
67\wxheading{Include files}
68
69<wx/filename.h>
70
a7af285d
VZ
71\wxheading{Library}
72
73\helpref{wxBase}{librarieslist}
74
2569938d
VZ
75\wxheading{Data structures}
76
77Many wxFileName methods accept the path format argument which is by\rtfsp
78{\tt wxPATH\_NATIVE} by default meaning to use the path format native for the
79current platform.
80
81The path format affects the operation of wxFileName functions in several ways:
82first and foremost, it defines the path separator character to use, but it also
83affects other things such as whether the path has the drive part or not.
84
85\begin{verbatim}
86enum wxPathFormat
87{
88 wxPATH_NATIVE = 0, // the path format for the current platform
89 wxPATH_UNIX,
f363e05c 90 wxPATH_BEOS = wxPATH_UNIX,
2569938d
VZ
91 wxPATH_MAC,
92 wxPATH_DOS,
f363e05c
VZ
93 wxPATH_WIN = wxPATH_DOS,
94 wxPATH_OS2 = wxPATH_DOS,
2569938d
VZ
95 wxPATH_VMS,
96
f363e05c 97 wxPATH_MAX // Not a valid value for specifying path format
2569938d
VZ
98}
99\end{verbatim}
100
6f91bc33
VZ
101\latexignore{\rtfignore{\wxheading{Function groups}}}
102
5bb9aeb2 103
f0e8a2d0 104\membersection{File name format}\label{filenameformat}
6f91bc33
VZ
105
106wxFileName currently supports the file names in the Unix, DOS/Windows, Mac OS
107and VMS formats. Although these formats are quite different, wxFileName tries
2edb0bde 108to treat them all in the same generic way. It supposes that all file names
6f91bc33
VZ
109consist of the following parts: the volume (also known as drive under Windows
110or device under VMS), the path which is a sequence of directory names separated
111by the \helpref{path separators}{wxfilenamegetpathseparators} and the full
112filename itself which, in turn, is composed from the base file name and the
113extension. All of the individual components of the file name may be empty and,
114for example, the volume name is always empty under Unix, but if they are all
115empty simultaneously, the filename object is considered to be in an invalid
0894707e 116state and \helpref{IsOk}{wxfilenameisok} returns {\tt false} for it.
6f91bc33
VZ
117
118File names can be case-sensitive or not, the function\rtfsp
119\helpref{IsCaseSensitive}{wxfilenameiscasesensitive} allows to determine this.
120
47ce5c4a
VZ
121The rules for determining whether the file name is absolute or relative also
122depend on the file name format and the only portable way to answer this
123question is to use \helpref{IsAbsolute}{wxfilenameisabsolute} or\rtfsp
124\helpref{IsRelative}{wxfilenameisrelative} method. Note that on Windows, "X:"
125refers to the current working directory on drive X. Therefore, a wxFileName
126instance constructed from for example "X:dir/file.ext" treats the portion
127beyond drive separator as being relative to that directory.
128
129To ensure that the filename is absolute, you may use\rtfsp
130\helpref{MakeAbsolute}{wxfilenamemakeabsolute}. There is also an inverse
131function \helpref{MakeRelativeTo}{wxfilenamemakerelativeto} which undoes
132what \helpref{Normalize(wxPATH\_NORM\_DOTS)}{wxfilenamenormalize} does.
6f91bc33
VZ
133
134Other functions returning information about the file format provided by this
135class are \helpref{GetVolumeSeparator}{wxfilenamegetvolumeseparator},\rtfsp
2db991f4 136\helpref{IsPathSeparator}{wxfilenameispathseparator}.
6f91bc33 137
5bb9aeb2 138
f0e8a2d0 139\membersection{File name construction}\label{filenameconstruction}
6f91bc33 140
3ff07edb
RR
141You can initialize a wxFileName instance using one of the following functions:
142
143\helpref{wxFileName constructors}{wxfilenamewxfilename}\\
144\helpref{Assign}{wxfilenameassign}\\
145\helpref{AssignCwd}{wxfilenameassigncwd}\\
146\helpref{AssignDir}{wxfilenameassigndir}\\
147\helpref{AssignHomeDir}{wxfilenameassignhomedir}\\
148\helpref{AssignHomeTempFileName}{wxfilenameassigntempfilename}\\
23fb9116
VZ
149\helpref{DirName}{wxfilenamedirname}\\
150\helpref{FileName}{wxfilenamefilename}\\
3ff07edb 151\helpref{operator $=$}{wxfilenameoperatorassign}
6f91bc33 152
5bb9aeb2 153
f0e8a2d0 154\membersection{File tests}\label{filetests}
6f91bc33 155
47ce5c4a
VZ
156Before doing other tests, you should use \helpref{IsOk}{wxfilenameisok} to
157verify that the filename is well defined. If it is,\rtfsp
158\helpref{FileExists}{wxfilenamefileexists} can be used to test whether a file
159with such name exists and \helpref{DirExists}{wxfilenamedirexists} can be used
160to test for directory existence.
6f91bc33
VZ
161
162File names should be compared using \helpref{SameAs}{wxfilenamesameas} method
3ff07edb
RR
163or \helpref{operator $==$}{wxfilenameoperatorequal}.
164
165For testing basic access modes, you can use:
166
167\helpref{IsDirWritable}{wxfilenameisdirwritable}\\
168\helpref{IsDirReadable}{wxfilenameisdirreadable}\\
169\helpref{IsFileWritable}{wxfilenameisfilewritable}\\
170\helpref{IsFileReadable}{wxfilenameisfilereadable}\\
171\helpref{IsFileExecutable}{wxfilenameisfileexecutable}
6f91bc33 172
5bb9aeb2 173
f0e8a2d0 174\membersection{File name components}\label{filenamecomponents}
6f91bc33 175
2458d90b
VZ
176These functions allow to examine and modify the individual directories of the
177path:
6f91bc33
VZ
178
179\helpref{AppendDir}{wxfilenameappenddir}\\
180\helpref{InsertDir}{wxfilenameinsertdir}\\
181\helpref{GetDirCount}{wxfilenamegetdircount}
182\helpref{PrependDir}{wxfilenameprependdir}\\
2458d90b
VZ
183\helpref{RemoveDir}{wxfilenameremovedir}\\
184\helpref{RemoveLastDir}{wxfilenameremovelastdir}
6f91bc33
VZ
185
186To change the components of the file name individually you can use the
187following functions:
188
189\helpref{GetExt}{wxfilenamegetext}\\
190\helpref{GetName}{wxfilenamegetname}\\
191\helpref{GetVolume}{wxfilenamegetvolume}\\
192\helpref{HasExt}{wxfilenamehasext}\\
193\helpref{HasName}{wxfilenamehasname}\\
194\helpref{HasVolume}{wxfilenamehasvolume}\\
195\helpref{SetExt}{wxfilenamesetext}\\
0b40f3d8
RR
196\helpref{ClearExt}{wxfilenameclearext}\\
197\helpref{SetEmptyExt}{wxfilenamesetemptyext}\\
6f91bc33
VZ
198\helpref{SetName}{wxfilenamesetname}\\
199\helpref{SetVolume}{wxfilenamesetvolume}\\
200
5bb9aeb2 201
f0e8a2d0 202\membersection{Operations}\label{filenameoperations}
6f91bc33
VZ
203
204These methods allow to work with the file creation, access and modification
6dbb903b
VZ
205times. Note that not all filesystems under all platforms implement these times
206in the same way. For example, the access time under Windows has a resolution of
207one day (so it is really the access date and not time). The access time may be
208updated when the file is executed or not depending on the platform.
6f91bc33
VZ
209
210\helpref{GetModificationTime}{wxfilenamegetmodificationtime}\\
211\helpref{GetTimes}{wxfilenamegettimes}\\
212\helpref{SetTimes}{wxfilenamesettimes}\\
213\helpref{Touch}{wxfilenametouch}
214
215Other file system operations functions are:
216
217\helpref{Mkdir}{wxfilenamemkdir}\\
218\helpref{Rmdir}{wxfilenamermdir}
219
2569938d
VZ
220\latexignore{\rtfignore{\wxheading{Members}}}
221
5bb9aeb2 222
6f91bc33 223\membersection{wxFileName::wxFileName}\label{wxfilenamewxfilename}
2569938d
VZ
224
225\func{}{wxFileName}{\void}
226
227Default constructor.
228
2569938d
VZ
229\func{}{wxFileName}{\param{const wxFileName\& }{filename}}
230
231Copy constructor.
232
2569938d
VZ
233\func{}{wxFileName}{\param{const wxString\& }{fullpath}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
234
95c00185 235Constructor taking a full filename. If it terminates with a '/', a directory path
2edb0bde 236is constructed (the name will be empty), otherwise a file name and
95c00185 237extension are extracted from it.
2569938d 238
2569938d
VZ
239\func{}{wxFileName}{\param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
240
6f91bc33 241Constructor from a directory name and a file name.
2569938d
VZ
242
243\func{}{wxFileName}{\param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{const wxString\& }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
244
95c00185 245Constructor from a directory name, base file name and extension.
81f25632
VZ
246
247\func{}{wxFileName}{\param{const wxString\& }{volume}, \param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{const wxString\& }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
248
95c00185 249Constructor from a volume name, a directory name, base file name and extension.
2569938d 250
5bb9aeb2 251
2569938d
VZ
252\membersection{wxFileName::AppendDir}\label{wxfilenameappenddir}
253
254\func{void}{AppendDir}{\param{const wxString\& }{dir}}
255
5bb9aeb2
VZ
256Appends a directory component to the path. This component should contain a
257single directory name level, i.e. not contain any path or volume separators nor
258should it be empty, otherwise the function does nothing (and generates an
259assert failure in debug build).
260
2569938d
VZ
261
262\membersection{wxFileName::Assign}\label{wxfilenameassign}
263
264\func{void}{Assign}{\param{const wxFileName\& }{filepath}}
265
2569938d
VZ
266\func{void}{Assign}{\param{const wxString\& }{fullpath}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
267
dfecbee5
VZ
268\func{void}{Assign}{\param{const wxString\& }{volume}, \param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{const wxString\& }{ext}, \param{bool }{hasExt}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
269
2569938d
VZ
270\func{void}{Assign}{\param{const wxString\& }{volume}, \param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{const wxString\& }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
271
2569938d
VZ
272\func{void}{Assign}{\param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
273
2569938d
VZ
274\func{void}{Assign}{\param{const wxString\& }{path}, \param{const wxString\& }{name}, \param{const wxString\& }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
275
95c00185 276Creates the file name from various combinations of data.
2569938d 277
5bb9aeb2 278
2569938d
VZ
279\membersection{wxFileName::AssignCwd}\label{wxfilenameassigncwd}
280
f363e05c 281\func{static void}{AssignCwd}{\param{const wxString\& }{volume = wxEmptyString}}
6f91bc33
VZ
282
283Makes this object refer to the current working directory on the specified
284volume (or current volume if {\it volume} is empty).
2569938d 285
6f91bc33 286\wxheading{See also}
2569938d 287
6f91bc33 288\helpref{GetCwd}{wxfilenamegetcwd}
2569938d 289
5bb9aeb2 290
2569938d
VZ
291\membersection{wxFileName::AssignDir}\label{wxfilenameassigndir}
292
293\func{void}{AssignDir}{\param{const wxString\& }{dir}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
294
95c00185 295Sets this file name object to the given directory name. The name and extension
81f25632 296will be empty.
2569938d 297
5bb9aeb2 298
2569938d
VZ
299\membersection{wxFileName::AssignHomeDir}\label{wxfilenameassignhomedir}
300
301\func{void}{AssignHomeDir}{\void}
302
95c00185 303Sets this file name object to the home directory.
2569938d 304
5bb9aeb2 305
2569938d
VZ
306\membersection{wxFileName::AssignTempFileName}\label{wxfilenameassigntempfilename}
307
df22f860 308\func{void}{AssignTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
2569938d 309
ade35f11
VZ
310The function calls \helpref{CreateTempFileName}{wxfilenamecreatetempfilename} to
311create a temporary file and sets this object to the name of the file. If a
312temporary file couldn't be created, the object is put into the\rtfsp
313\helpref{invalid}{wxfilenameisok} state.
2569938d 314
5bb9aeb2 315
2569938d
VZ
316\membersection{wxFileName::Clear}\label{wxfilenameclear}
317
318\func{void}{Clear}{\void}
319
ade35f11
VZ
320Reset all components to default, uninitialized state.
321
5bb9aeb2 322
0b40f3d8
RR
323\membersection{wxFileName::ClearExt}\label{wxfilenameclearext}
324
325\func{void}{SetClearExt}{\void}
326
327Removes the extension from the file name resulting in a
328file name with no trailing dot.
329
330\wxheading{See also}
331
332\helpref{SetExt}{wxfilenamesetext}
333\helpref{SetEmptyExt}{wxfilenamesetemptyext}
334
02a3b391 335\membersection{wxFileName::CreateTempFileName}\label{wxfilenamecreatetempfilename}
ade35f11 336
df22f860 337\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
ade35f11
VZ
338
339Returns a temporary file name starting with the given {\it prefix}. If
340the {\it prefix} is an absolute path, the temporary file is created in this
341directory, otherwise it is created in the default system directory for the
342temporary files or in the current directory.
2569938d 343
df22f860
VZ
344If the function succeeds, the temporary file is actually created. If\rtfsp
345{\it fileTemp} is not {\tt NULL}, this file will be opened using the name of
346the temporary file. When possible, this is done in an atomic way ensuring that
347no race condition occurs between the temporary file name generation and opening
348it which could often lead to security compromise on the multiuser systems.
349If {\it fileTemp} is {\tt NULL}, the file is only created, but not opened.
350
351Under Unix, the temporary file will have read and write permissions for the
352owner only to minimize the security problems.
353
354\wxheading{Parameters}
355
356\docparam{prefix}{Prefix to use for the temporary file name construction}
357
358\docparam{fileTemp}{The file to open or {\tt NULL} to just get the name}
ade35f11
VZ
359
360\wxheading{Return value}
361
362The full temporary file name or an empty string on error.
2569938d 363
5bb9aeb2 364
2569938d
VZ
365\membersection{wxFileName::DirExists}\label{wxfilenamedirexists}
366
8e41796c 367\constfunc{bool}{DirExists}{\void}
2569938d 368
8e41796c 369\func{static bool}{DirExists}{\param{const wxString\& }{dir}}
2569938d 370
f363e05c 371Returns {\tt true} if the directory with this name exists.
2569938d 372
5bb9aeb2 373
2569938d
VZ
374\membersection{wxFileName::DirName}\label{wxfilenamedirname}
375
520200fd
VZ
376\func{static wxFileName}{DirName}{\param{const wxString\& }{dir}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
377
378Returns the object corresponding to the directory with the given name.
379The {\it dir} parameter may have trailing path separator or not.
2569938d 380
95c00185 381
5bb9aeb2 382
2569938d
VZ
383\membersection{wxFileName::FileExists}\label{wxfilenamefileexists}
384
8e41796c 385\constfunc{bool}{FileExists}{\void}
2569938d 386
8e41796c 387\func{static bool}{FileExists}{\param{const wxString\& }{file}}
2569938d 388
f363e05c 389Returns {\tt true} if the file with this name exists.
2569938d 390
8e41796c
VZ
391\wxheading{See also}
392
393\helpref{DirExists}{wxfilenamedirexists}
394
520200fd 395
5bb9aeb2 396
2569938d
VZ
397\membersection{wxFileName::FileName}\label{wxfilenamefilename}
398
520200fd
VZ
399\func{static wxFileName}{FileName}{\param{const wxString\& }{file}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
400
401Returns the file name object corresponding to the given {\it file}. This
402function exists mainly for symmetry with \helpref{DirName}{wxfilenamedirname}.
2569938d 403
2569938d 404
5bb9aeb2 405
2569938d
VZ
406\membersection{wxFileName::GetCwd}\label{wxfilenamegetcwd}
407
f363e05c 408\func{static wxString}{GetCwd}{\param{const wxString\& }{volume = ""}}
6f91bc33 409
95c00185 410Retrieves the value of the current working directory on the specified volume. If
43e8916f 411the volume is empty, the program's current working directory is returned for the
6f91bc33
VZ
412current volume.
413
414\wxheading{Return value}
415
416The string containing the current working directory or an empty string on
417error.
2569938d 418
6f91bc33
VZ
419\wxheading{See also}
420
421\helpref{AssignCwd}{wxfilenameassigncwd}
2569938d 422
5bb9aeb2 423
2569938d
VZ
424\membersection{wxFileName::GetDirCount}\label{wxfilenamegetdircount}
425
426\constfunc{size\_t}{GetDirCount}{\void}
427
95c00185 428Returns the number of directories in the file name.
2569938d 429
5bb9aeb2 430
2569938d
VZ
431\membersection{wxFileName::GetDirs}\label{wxfilenamegetdirs}
432
433\constfunc{const wxArrayString\&}{GetDirs}{\void}
434
95c00185 435Returns the directories in string array form.
2569938d 436
5bb9aeb2 437
2569938d
VZ
438\membersection{wxFileName::GetExt}\label{wxfilenamegetext}
439
440\constfunc{wxString}{GetExt}{\void}
441
95c00185 442Returns the file name extension.
2569938d 443
5bb9aeb2 444
f363e05c
VZ
445\membersection{wxFileName::GetForbiddenChars}\label{wxfilenamegetforbiddenchars}
446
447\func{static wxString}{GetForbiddenChars}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
448
449Returns the characters that can't be used in filenames and directory names for the specified format.
450
5bb9aeb2 451
2569938d
VZ
452\membersection{wxFileName::GetFormat}\label{wxfilenamegetformat}
453
f363e05c 454\func{static wxPathFormat}{GetFormat}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 455
95c00185 456Returns the canonical path format for this platform.
2569938d 457
5bb9aeb2 458
2569938d
VZ
459\membersection{wxFileName::GetFullName}\label{wxfilenamegetfullname}
460
461\constfunc{wxString}{GetFullName}{\void}
462
95c00185 463Returns the full name (including extension but excluding directories).
2569938d 464
5bb9aeb2 465
2569938d
VZ
466\membersection{wxFileName::GetFullPath}\label{wxfilenamegetfullpath}
467
468\constfunc{wxString}{GetFullPath}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
469
95c00185 470Returns the full path with name and extension.
2569938d 471
5bb9aeb2 472
2569938d
VZ
473\membersection{wxFileName::GetHomeDir}\label{wxfilenamegethomedir}
474
f363e05c 475\func{static wxString}{GetHomeDir}{\void}
2569938d 476
95c00185 477Returns the home directory.
2569938d 478
5bb9aeb2 479
2569938d
VZ
480\membersection{wxFileName::GetLongPath}\label{wxfilenamegetlongpath}
481
482\constfunc{wxString}{GetLongPath}{\void}
483
484Return the long form of the path (returns identity on non-Windows platforms)
485
5bb9aeb2 486
2569938d
VZ
487\membersection{wxFileName::GetModificationTime}\label{wxfilenamegetmodificationtime}
488
489\constfunc{wxDateTime}{GetModificationTime}{\void}
490
95c00185 491Returns the last time the file was last modified.
2569938d 492
5bb9aeb2 493
2569938d
VZ
494\membersection{wxFileName::GetName}\label{wxfilenamegetname}
495
496\constfunc{wxString}{GetName}{\void}
497
4e43c815
VZ
498Returns the name part of the filename (without extension).
499
500\wxheading{See also}
501
502\helpref{GetFullName}{wxfilenamegetfullname}
503
2569938d 504
5bb9aeb2 505
2569938d
VZ
506\membersection{wxFileName::GetPath}\label{wxfilenamegetpath}
507
93fa67c0 508\constfunc{wxString}{GetPath}{\param{int }{flags = {\tt wxPATH\_GET\_VOLUME}}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 509
95c00185 510Returns the path part of the filename (without the name or extension). The
33b97389 511possible flags values are:
2569938d 512
d1853d47 513\twocolwidtha{5cm}
33b97389 514\begin{twocollist}\itemsep=0pt
d1853d47 515\twocolitem{{\bf wxPATH\_GET\_VOLUME}}{Return the path with the volume (does
93fa67c0
VZ
516nothing for the filename formats without volumes), otherwise the path without
517volume part is returned.}
d1853d47 518\twocolitem{{\bf wxPATH\_GET\_SEPARATOR}}{Return the path with the trailing
33b97389
VZ
519separator, if this flag is not given there will be no separator at the end of
520the path.}
521\end{twocollist}
522
5bb9aeb2 523
33b97389
VZ
524\membersection{wxFileName::GetPathSeparator}\label{wxfilenamegetpathseparator}
525
f363e05c 526\func{static wxChar}{GetPathSeparator}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
33b97389 527
95c00185 528Returns the usually used path separator for this format. For all formats but
33b97389
VZ
529{\tt wxPATH\_DOS} there is only one path separator anyhow, but for DOS there
530are two of them and the native one, i.e. the backslash is returned by this
531method.
532
533\wxheading{See also}
534
535\helpref{GetPathSeparators}{wxfilenamegetpathseparators}
2569938d 536
5bb9aeb2 537
2569938d
VZ
538\membersection{wxFileName::GetPathSeparators}\label{wxfilenamegetpathseparators}
539
f363e05c 540\func{static wxString}{GetPathSeparators}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 541
95c00185 542Returns the string containing all the path separators for this format. For all
33b97389 543formats but {\tt wxPATH\_DOS} this string contains only one character but for
7af3ca16 544DOS and Windows both {\tt '/'} and {\tt '\textbackslash'} may be used as
33b97389
VZ
545separators.
546
547\wxheading{See also}
2569938d 548
33b97389 549\helpref{GetPathSeparator}{wxfilenamegetpathseparator}
2569938d 550
5bb9aeb2 551
f1e77933
VZ
552\membersection{wxFileName::GetPathTerminators}\label{wxfilenamegetpathterminators}
553
554\func{static wxString}{GetPathTerminators}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
555
556Returns the string of characters which may terminate the path part. This is the
557same as \helpref{GetPathSeparators}{wxfilenamegetpathseparators} except for VMS
558path format where $]$ is used at the end of the path part.
559
560
8b4b9395
VZ
561\membersection{wxFileName::GetPathWithSep}\label{wxfilenamegetpathwithsep}
562
563\constfunc{wxString}{GetPathWithSep}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
564
565Returns the path with the trailing separator, useful for appending the name to
566the given path.
567
568This is the same as calling \helpref{GetPath}{wxfilenamegetpath}
569\texttt{(wxPATH\_GET\_VOLUME | wxPATH\_GET\_SEPARATOR, format)}.
570
571
2569938d
VZ
572\membersection{wxFileName::GetShortPath}\label{wxfilenamegetshortpath}
573
574\constfunc{wxString}{GetShortPath}{\void}
575
95c00185 576Return the short form of the path (returns identity on non-Windows platforms).
2569938d 577
5bb9aeb2 578
23b8a262
JS
579\membersection{wxFileName::GetSize}\label{wxfilenamegetsize}
580
581\constfunc{wxULongLong}{GetSize}{\void}
582
583\func{static wxULongLong}{GetSize}{\param{const wxString\& }{filename}}
584
585Returns the size of this file (first form) or the size of the given file (second form).
586If the file does not exist or its size could not be read (because e.g. the file is locked
587by another process) the returned value is {\tt wxInvalidSize}.
588
589
590\membersection{wxFileName::GetHumanReadableSize}\label{wxfilenamegethumanreadablesize}
591
592\constfunc{wxString}{GetHumanReadableSize}{\param{const wxString\& }{failmsg = "Not available"}, \param{int }{precision = 1}}
593
594\func{static wxString}{GetHumanReadableSize}{\param{const wxULongLong\& }{bytes}, \param{const wxString\& }{nullsize = "Not available"}, \param{int }{precision = 1}}
595
596Returns the size of this file (first form) or the given number of bytes (second form)
597in a human-readable form.
598
599If the size could not be retrieved the {\tt failmsg} string is returned (first form).
600If {\tt bytes} is {\tt wxInvalidSize} or zero, then {\tt nullsize} is returned (second form).
601
602In case of success, the returned string is a floating-point number with {\tt precision} decimal digits
603followed by the size unit (B, kB, MB, GB, TB: respectively bytes, kilobytes, megabytes, gigabytes, terabytes).
604
605
8d7d6dea
JS
606\membersection{wxFileName::GetTempDir}\label{wxfilenamegettempdir}
607
608\func{static wxString}{GetTempDir}{\void}
609
610Returns the directory used for temporary files.
611
612
2569938d
VZ
613\membersection{wxFileName::GetTimes}\label{wxfilenamegettimes}
614
6dbb903b 615\constfunc{bool}{GetTimes}{\param{wxDateTime* }{dtAccess}, \param{wxDateTime* }{dtMod}, \param{wxDateTime* }{dtCreate}}
2569938d 616
95c00185 617Returns the last access, last modification and creation times. The last access
ebb39671
VZ
618time is updated whenever the file is read or written (or executed in the case
619of Windows), last modification time is only changed when the file is written
620to. Finally, the creation time is indeed the time when the file was created
621under Windows and the inode change time under Unix (as it is impossible to
622retrieve the real file creation time there anyhow) which can also be changed
623by many operations after the file creation.
2569938d 624
51cb1a65
RR
625If no filename or extension is specified in this instance of wxFileName
626(and therefore \helpref{IsDir}{wxfilenameisdir} returns {\tt true}) then
627this function will return the directory times of the path specified by
628\helpref{GetPath}{wxfilenamegetpath}, otherwise the file times of the
629file specified by \helpref{GetFullPath}{wxfilenamegetfullpath}.
630
95c00185 631Any of the pointers may be {\tt NULL} if the corresponding time is not
ebb39671
VZ
632needed.
633
634\wxheading{Return value}
635
0894707e 636{\tt true} on success, {\tt false} if we failed to retrieve the times.
2569938d 637
5bb9aeb2 638
2569938d
VZ
639\membersection{wxFileName::GetVolume}\label{wxfilenamegetvolume}
640
641\constfunc{wxString}{GetVolume}{\void}
642
f70c0443 643Returns the string containing the volume for this file name, empty if it
ebb39671
VZ
644doesn't have one or if the file system doesn't support volumes at all (for
645example, Unix).
2569938d 646
5bb9aeb2 647
2569938d
VZ
648\membersection{wxFileName::GetVolumeSeparator}\label{wxfilenamegetvolumeseparator}
649
f363e05c 650\func{static wxString}{GetVolumeSeparator}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 651
95c00185 652Returns the string separating the volume from the path for this format.
2569938d 653
5bb9aeb2 654
2569938d
VZ
655\membersection{wxFileName::HasExt}\label{wxfilenamehasext}
656
657\constfunc{bool}{HasExt}{\void}
658
f363e05c 659Returns {\tt true} if an extension is present.
2569938d 660
5bb9aeb2 661
2569938d
VZ
662\membersection{wxFileName::HasName}\label{wxfilenamehasname}
663
664\constfunc{bool}{HasName}{\void}
665
f363e05c 666Returns {\tt true} if a name is present.
2569938d 667
5bb9aeb2 668
2569938d
VZ
669\membersection{wxFileName::HasVolume}\label{wxfilenamehasvolume}
670
671\constfunc{bool}{HasVolume}{\void}
672
f363e05c 673Returns {\tt true} if a volume specifier is present.
2569938d 674
5bb9aeb2 675
2569938d
VZ
676\membersection{wxFileName::InsertDir}\label{wxfilenameinsertdir}
677
2458d90b 678\func{void}{InsertDir}{\param{size\_t }{before}, \param{const wxString\& }{dir}}
2569938d 679
5bb9aeb2
VZ
680Inserts a directory component before the zero-based position in the directory
681list. Please see \helpref{AppendDir}{wxfilenameappenddir} for important notes.
682
2569938d
VZ
683
684\membersection{wxFileName::IsAbsolute}\label{wxfilenameisabsolute}
685
686\func{bool}{IsAbsolute}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
687
f363e05c 688Returns {\tt true} if this filename is absolute.
2569938d 689
5bb9aeb2 690
2569938d
VZ
691\membersection{wxFileName::IsCaseSensitive}\label{wxfilenameiscasesensitive}
692
f363e05c 693\func{static bool}{IsCaseSensitive}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 694
f363e05c 695Returns {\tt true} if the file names of this type are case-sensitive.
2569938d 696
5bb9aeb2 697
3ff07edb
RR
698\membersection{wxFileName::IsDirReadable}\label{wxfilenameisdirreadable}
699
700\constfunc{bool}{IsDirReadable}{\void}
701
702\func{static bool}{IsDirReadable}{\param{const wxString\& }{dir}}
703
704Returns {\tt true} if the directory component of this instance (or given \arg{dir})
705is an existing directory and this process has read permissions on it.
706Read permissions on a directory mean that you can list the directory contents but it
707doesn't imply that you have read permissions on the files contained.
708
709
710\membersection{wxFileName::IsDirWritable}\label{wxfilenameisdirwritable}
711
712\constfunc{bool}{IsDirWritable}{\void}
713
714\func{static bool}{IsDirWritable}{\param{const wxString\& }{dir}}
715
716Returns {\tt true} if the directory component of this instance (or given \arg{dir})
717is an existing directory and this process has write permissions on it.
718Write permissions on a directory mean that you can create new files in the directory.
719
720
721\membersection{wxFileName::IsFileExecutable}\label{wxfilenameisfileexecutable}
722
723\constfunc{bool}{IsFileExecutable}{\void}
724
725\func{static bool}{IsFileExecutable}{\param{const wxString\& }{file}}
726
727Returns {\tt true} if a file with this name exists and if this process has execute permissions on it.
728
729
730\membersection{wxFileName::IsFileReadable}\label{wxfilenameisfilereadable}
731
732\constfunc{bool}{IsFileReadable}{\void}
733
734\func{static bool}{IsFileReadable}{\param{const wxString\& }{file}}
735
736Returns {\tt true} if a file with this name exists and if this process has read permissions on it.
737
738
739\membersection{wxFileName::IsFileWritable}\label{wxfilenameisfilewritable}
740
741\constfunc{bool}{IsFileWritable}{\void}
742
743\func{static bool}{IsFileWritable}{\param{const wxString\& }{file}}
744
745Returns {\tt true} if a file with this name exists and if this process has write permissions on it.
746
747
2569938d
VZ
748\membersection{wxFileName::IsOk}\label{wxfilenameisok}
749
750\constfunc{bool}{IsOk}{\void}
751
0894707e 752Returns {\tt true} if the filename is valid, {\tt false} if it is not
ade35f11
VZ
753initialized yet. The assignment functions and
754\helpref{Clear}{wxfilenameclear} may reset the object to the uninitialized,
755invalid state (the former only do it on failure).
2569938d 756
5bb9aeb2 757
2569938d
VZ
758\membersection{wxFileName::IsPathSeparator}\label{wxfilenameispathseparator}
759
f363e05c 760\func{static bool}{IsPathSeparator}{\param{wxChar }{ch}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 761
0894707e 762Returns {\tt true} if the char is a path separator for this format.
2569938d 763
5bb9aeb2 764
2569938d
VZ
765\membersection{wxFileName::IsRelative}\label{wxfilenameisrelative}
766
767\func{bool}{IsRelative}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
768
0894707e 769Returns {\tt true} if this filename is not absolute.
2569938d 770
5bb9aeb2 771
2db991f4 772\membersection{wxFileName::IsDir}\label{wxfilenameisdir}
2569938d 773
2db991f4 774\constfunc{bool}{IsDir}{\void}
2569938d 775
0894707e 776Returns {\tt true} if this object represents a directory, {\tt false} otherwise
2db991f4
VZ
777(i.e. if it is a file). Note that this method doesn't test whether the
778directory or file really exists, you should use
779\helpref{DirExists}{wxfilenamedirexists} or
780\helpref{FileExists}{wxfilenamefileexists} for this.
2569938d 781
5ab2950d
JS
782\membersection{wxFileName::MacFindDefaultTypeAndCreator}\label{wxfilenamemacfinddefaulttypeandcreator}
783
784\func{static bool}{MacFindDefaultTypeAndCreator}{\param{const wxString\& }{ext}, \param{wxUint32* }{type}, \param{wxUint32* }{creator}}
785
786On Mac OS, gets the common type and creator for the given extension.
787
788\membersection{wxFileName::MacRegisterDefaultTypeAndCreator}\label{wxfilenamemacregisterdefaulttypeandcreator}
789
790\func{static void}{MacRegisterDefaultTypeAndCreator}{\param{const wxString\& }{ext}, \param{wxUint32 }{type}, \param{wxUint32 }{creator}}
791
792On Mac OS, registers application defined extensions and their default type and creator.
793
794\membersection{wxFileName::MacSetDefaultTypeAndCreator}\label{wxfilenamemacsetdefaulttypeandcreator}
795
796\func{bool}{MacSetDefaultTypeAndCreator}{\void}
797
798On Mac OS, looks up the appropriate type and creator from the registration and then sets it.
5bb9aeb2 799
0894707e
VS
800\membersection{wxFileName::MakeAbsolute}\label{wxfilenamemakeabsolute}
801
802\func{bool}{MakeAbsolute}{\param{const wxString\& }{cwd = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
803
804Make the file name absolute. This is a shortcut for
805{\tt \helpref{Normalize}{wxfilenamenormalize}(wxPATH\_NORM\_DOTS | wxPATH\_NORM\_ABSOLUTE | wxPATH\_NORM\_TILDE, cwd, format)}.
806
807\wxheading{See also}
808
809\helpref{MakeRelativeTo}{wxfilenamemakerelativeto},
810\helpref{Normalize}{wxfilenamenormalize},
811\helpref{IsAbsolute}{wxfilenameisabsolute}
812
5bb9aeb2 813
f7d886af
VZ
814\membersection{wxFileName::MakeRelativeTo}\label{wxfilenamemakerelativeto}
815
f363e05c 816\func{bool}{MakeRelativeTo}{\param{const wxString\& }{pathBase = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
f7d886af
VZ
817
818This function tries to put this file name in a form relative to {\it pathBase}.
819In other words, it returns the file name which should be used to access this
820file if the current directory were {\it pathBase}.
821
822\docparam{pathBase}{the directory to use as root, current directory is used by
823default}
824
825\docparam{format}{the file name format, native by default}
826
827\wxheading{Return value}
828
0894707e 829{\tt true} if the file name has been changed, {\tt false} if we failed to do
f7d886af
VZ
830anything with it (currently this only happens if the file name is on a volume
831different from the volume specified by {\it pathBase}).
832
833\wxheading{See also}
834
835\helpref{Normalize}{wxfilenamenormalize}
2569938d 836
5bb9aeb2 837
2569938d
VZ
838\membersection{wxFileName::Mkdir}\label{wxfilenamemkdir}
839
1527281e 840\func{bool}{Mkdir}{\param{int }{perm = 0777}, \param{int }{flags = $0$}}
2569938d 841
1527281e 842\func{static bool}{Mkdir}{\param{const wxString\& }{dir}, \param{int }{perm = 0777}, \param{int }{flags = $0$}}
2569938d 843
6f91bc33 844\docparam{dir}{the directory to create}
2569938d 845
6f91bc33
VZ
846\docparam{parm}{the permissions for the newly created directory}
847
1527281e
VZ
848\docparam{flags}{if the flags contain {\tt wxPATH\_MKDIR\_FULL} flag,
849try to create each directory in the path and also don't return an error
850if the target directory already exists.}
2569938d 851
6f91bc33 852\wxheading{Return value}
2569938d 853
0894707e 854Returns {\tt true} if the directory was successfully created, {\tt false}
6f91bc33 855otherwise.
2569938d 856
5bb9aeb2 857
2569938d
VZ
858\membersection{wxFileName::Normalize}\label{wxfilenamenormalize}
859
32a0d013 860\func{bool}{Normalize}{\param{int }{flags = wxPATH\_NORM\_ALL}, \param{const wxString\& }{cwd = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 861
0894707e 862Normalize the path. With the default flags value, the path will be
2569938d 863made absolute, without any ".." and "." and all environment
0894707e
VS
864variables will be expanded in it.
865
866\docparam{flags}{The kind of normalization to do with the file name. It can be
867any or-combination of the following constants:
d2c2afc9 868
0894707e
VS
869\begin{twocollist}
870\twocolitem{{\bf wxPATH\_NORM\_ENV\_VARS}}{replace env vars with their values}
bf7f7793 871\twocolitem{{\bf wxPATH\_NORM\_DOTS}}{squeeze all .. and . when possible; if there are too many .. and thus they cannot be all removed, \false will be returned}
08890e27 872\twocolitem{{\bf wxPATH\_NORM\_CASE}}{if filesystem is case insensitive, transform to lower case}
bf7f7793 873\twocolitem{{\bf wxPATH\_NORM\_ABSOLUTE}}{make the path absolute prepending \arg{cwd}}
0894707e 874\twocolitem{{\bf wxPATH\_NORM\_LONG}}{make the path the long form}
21f60945 875\twocolitem{{\bf wxPATH\_NORM\_SHORTCUT}}{resolve if it is a shortcut (Windows only)}
bf7f7793 876\twocolitem{{\bf wxPATH\_NORM\_TILDE}}{replace ~ and ~user (Unix only)}
ef92f440 877\twocolitem{{\bf wxPATH\_NORM\_ALL}}{all of previous flags except \texttt{wxPATH\_NORM\_CASE}}
0894707e 878\end{twocollist}
d2c2afc9 879}%
0894707e
VS
880
881\docparam{cwd}{If not empty, this directory will be used instead of current
bf7f7793 882working directory in normalization (see wxPATH\_NORM\_ABSOLUTE).}
0894707e 883
bf7f7793
RR
884\docparam{format}{The file name format to use when processing the paths, native by default.}
885
886
887\wxheading{Return value}
888
889\true if normalization was successfully or \false otherwise.
2569938d 890
5bb9aeb2 891
2569938d
VZ
892\membersection{wxFileName::PrependDir}\label{wxfilenameprependdir}
893
894\func{void}{PrependDir}{\param{const wxString\& }{dir}}
895
5bb9aeb2
VZ
896Prepends a directory to the file path. Please see
897\helpref{AppendDir}{wxfilenameappenddir} for important notes.
898
899
2569938d
VZ
900
901\membersection{wxFileName::RemoveDir}\label{wxfilenameremovedir}
902
2458d90b 903\func{void}{RemoveDir}{\param{size\_t }{pos}}
2569938d 904
2458d90b
VZ
905Removes the specified directory component from the path.
906
907\wxheading{See also}
908
909\helpref{GetDirCount}{wxfilenamegetdircount}
910
911
912\membersection{wxFileName::RemoveLastDir}\label{wxfilenameremovelastdir}
913
914\func{void}{RemoveLastDir}{\void}
915
916Removes last directory component from the path.
2569938d 917
5bb9aeb2 918
2569938d
VZ
919\membersection{wxFileName::Rmdir}\label{wxfilenamermdir}
920
921\func{bool}{Rmdir}{\void}
922
6f91bc33 923\func{static bool}{Rmdir}{\param{const wxString\& }{dir}}
2569938d 924
95c00185 925Deletes the specified directory from the file system.
2569938d 926
5bb9aeb2 927
2569938d
VZ
928\membersection{wxFileName::SameAs}\label{wxfilenamesameas}
929
2b5f62a0 930\constfunc{bool}{SameAs}{\param{const wxFileName\& }{filepath}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 931
95c00185 932Compares the filename using the rules of this platform.
2569938d 933
5bb9aeb2 934
2569938d
VZ
935\membersection{wxFileName::SetCwd}\label{wxfilenamesetcwd}
936
937\func{bool}{SetCwd}{\void}
938
6f91bc33 939\func{static bool}{SetCwd}{\param{const wxString\& }{cwd}}
2569938d 940
95c00185 941Changes the current working directory.
2569938d 942
5bb9aeb2 943
2569938d
VZ
944\membersection{wxFileName::SetExt}\label{wxfilenamesetext}
945
946\func{void}{SetExt}{\param{const wxString\& }{ext}}
947
0b40f3d8
RR
948Sets the extension of the file name. Setting an empty string
949as the extension will remove the extension resulting in a file
950name without a trailing dot, unlike a call to
951\helpref{SetEmptyExt}{wxfilenamesetemptyext}.
952
953\wxheading{See also}
954
955\helpref{SetEmptyExt}{wxfilenamesetemptyext}
956\helpref{ClearExt}{wxfilenameclearext}
957
958\membersection{wxFileName::SetEmptyExt}\label{wxfilenamesetemptyext}
959
960\func{void}{SetEmptyExt}{\void}
961
962Sets the extension of the file name to be an empty extension.
963This is different from having no extension at all as the file
964name will have a trailing dot after a call to this method.
965
966\wxheading{See also}
2569938d 967
0b40f3d8
RR
968\helpref{SetExt}{wxfilenamesetext}
969\helpref{ClearExt}{wxfilenameclearext}
5bb9aeb2 970
2569938d
VZ
971\membersection{wxFileName::SetFullName}\label{wxfilenamesetfullname}
972
973\func{void}{SetFullName}{\param{const wxString\& }{fullname}}
974
95c00185 975The full name is the file name and extension (but without the path).
2569938d 976
5bb9aeb2 977
2569938d
VZ
978\membersection{wxFileName::SetName}\label{wxfilenamesetname}
979
980\func{void}{SetName}{\param{const wxString\& }{name}}
981
4e43c815
VZ
982Sets the name part (without extension).
983
984\wxheading{See also}
985
986\helpref{SetFullName}{wxfilenamesetfullname}
2569938d 987
5bb9aeb2 988
2569938d
VZ
989\membersection{wxFileName::SetTimes}\label{wxfilenamesettimes}
990
6dbb903b 991\func{bool}{SetTimes}{\param{const wxDateTime* }{dtAccess}, \param{const wxDateTime* }{dtMod}, \param{const wxDateTime* }{dtCreate}}
2569938d 992
95c00185 993Sets the file creation and last access/modification times (any of the pointers may be NULL).
2569938d 994
5bb9aeb2 995
2569938d
VZ
996\membersection{wxFileName::SetVolume}\label{wxfilenamesetvolume}
997
998\func{void}{SetVolume}{\param{const wxString\& }{volume}}
999
95c00185 1000Sets the volume specifier.
2569938d 1001
5bb9aeb2 1002
2569938d
VZ
1003\membersection{wxFileName::SplitPath}\label{wxfilenamesplitpath}
1004
dfecbee5
VZ
1005\func{static void}{SplitPath}{\param{const wxString\& }{fullpath}, \param{wxString* }{volume}, \param{wxString* }{path}, \param{wxString* }{name}, \param{wxString* }{ext}, \param{bool }{*hasExt = \texttt{NULL}}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
1006
2bd25c5a 1007\func{static void}{SplitPath}{\param{const wxString\& }{fullpath}, \param{wxString* }{volume}, \param{wxString* }{path}, \param{wxString* }{name}, \param{wxString* }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 1008
2bd25c5a 1009\func{static void}{SplitPath}{\param{const wxString\& }{fullpath}, \param{wxString* }{path}, \param{wxString* }{name}, \param{wxString* }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
2569938d 1010
2bd25c5a
VZ
1011This function splits a full file name into components: the volume (with the
1012first version) path (including the volume in the second version), the base name
1013and the extension. Any of the output parameters ({\it volume}, {\it path},
1014{\it name} or {\it ext}) may be {\tt NULL} if you are not interested in the
1015value of a particular component. Also, {\it fullpath} may be empty on entry.
1016
1017On return, {\it path} contains the file path (without the trailing separator),
1018{\it name} contains the file name and {\it ext} contains the file extension
1019without leading dot. All three of them may be empty if the corresponding
1020component is. The old contents of the strings pointed to by these parameters
1021will be overwritten in any case (if the pointers are not {\tt NULL}).
2569938d 1022
dfecbee5
VZ
1023Note that for a filename ``foo.'' the extension is present, as indicated by the
1024trailing dot, but empty. If you need to cope with such cases, you should use
1025\arg{hasExt} instead of relying on testing whether \arg{ext} is empty or not.
1026
5bb9aeb2 1027
f1e77933
VZ
1028\membersection{wxFileName::SplitVolume}\label{wxfilenamesplitvolume}
1029
1030\func{static void}{SplitVolume}{\param{const wxString\& }{fullpath}, \param{wxString* }{volume}, \param{wxString* }{path}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
1031
1032Splits the given \arg{fullpath} into the volume part (which may be empty) and
1033the pure path part, not containing any volume.
1034
1035\wxheading{See also}
1036
1037\helpref{SplitPath}{wxfilenamesplitpath}
1038
1039
2569938d
VZ
1040\membersection{wxFileName::Touch}\label{wxfilenametouch}
1041
1042\func{bool}{Touch}{\void}
1043
95c00185 1044Sets the access and modification times to the current moment.
2569938d 1045
5bb9aeb2 1046
2569938d
VZ
1047\membersection{wxFileName::operator=}\label{wxfilenameoperatorassign}
1048
1049\func{wxFileName\& operator}{operator=}{\param{const wxFileName\& }{filename}}
1050
2569938d
VZ
1051\func{wxFileName\& operator}{operator=}{\param{const wxString\& }{filename}}
1052
6f91bc33 1053Assigns the new value to this filename object.
2569938d 1054
5bb9aeb2 1055
2569938d
VZ
1056\membersection{wxFileName::operator==}\label{wxfilenameoperatorequal}
1057
2b5f62a0 1058\constfunc{bool operator}{operator==}{\param{const wxFileName\& }{filename}}
2569938d 1059
2b5f62a0 1060\constfunc{bool operator}{operator==}{\param{const wxString\& }{filename}}
2569938d 1061
0894707e 1062Returns {\tt true} if the filenames are equal. The string {\it filenames} is
2b5f62a0
VZ
1063interpreted as a path in the native filename format.
1064
5bb9aeb2 1065
2b5f62a0
VZ
1066\membersection{wxFileName::operator!=}\label{wxfilenameoperatornotequal}
1067
1068\constfunc{bool operator}{operator!=}{\param{const wxFileName\& }{filename}}
1069
1070\constfunc{bool operator}{operator!=}{\param{const wxString\& }{filename}}
1071
0894707e 1072Returns {\tt true} if the filenames are different. The string {\it filenames}
2b5f62a0 1073is interpreted as a path in the native filename format.
6f91bc33 1074