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