filename.tex
来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 917 行 · 第 1/3 页
TEX
917 行
\func{bool}{IsRelative}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
Returns {\tt true} if this filename is not absolute.
\membersection{wxFileName::IsDir}\label{wxfilenameisdir}
\constfunc{bool}{IsDir}{\void}
Returns {\tt true} if this object represents a directory, {\tt false} otherwise
(i.e. if it is a file). Note that this method doesn't test whether the
directory or file really exists, you should use
\helpref{DirExists}{wxfilenamedirexists} or
\helpref{FileExists}{wxfilenamefileexists} for this.
\membersection{wxFileName::MacFindDefaultTypeAndCreator}\label{wxfilenamemacfinddefaulttypeandcreator}
\func{static bool}{MacFindDefaultTypeAndCreator}{\param{const wxString\& }{ext}, \param{wxUint32* }{type}, \param{wxUint32* }{creator}}
On Mac OS, gets the common type and creator for the given extension.
\membersection{wxFileName::MacRegisterDefaultTypeAndCreator}\label{wxfilenamemacregisterdefaulttypeandcreator}
\func{static void}{MacRegisterDefaultTypeAndCreator}{\param{const wxString\& }{ext}, \param{wxUint32 }{type}, \param{wxUint32 }{creator}}
On Mac OS, registers application defined extensions and their default type and creator.
\membersection{wxFileName::MacSetDefaultTypeAndCreator}\label{wxfilenamemacsetdefaulttypeandcreator}
\func{bool}{MacSetDefaultTypeAndCreator}{\void}
On Mac OS, looks up the appropriate type and creator from the registration and then sets it.
\membersection{wxFileName::MakeAbsolute}\label{wxfilenamemakeabsolute}
\func{bool}{MakeAbsolute}{\param{const wxString\& }{cwd = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
Make the file name absolute. This is a shortcut for
{\tt \helpref{Normalize}{wxfilenamenormalize}(wxPATH\_NORM\_DOTS | wxPATH\_NORM\_ABSOLUTE | wxPATH\_NORM\_TILDE, cwd, format)}.
\wxheading{See also}
\helpref{MakeRelativeTo}{wxfilenamemakerelativeto},
\helpref{Normalize}{wxfilenamenormalize},
\helpref{IsAbsolute}{wxfilenameisabsolute}
\membersection{wxFileName::MakeRelativeTo}\label{wxfilenamemakerelativeto}
\func{bool}{MakeRelativeTo}{\param{const wxString\& }{pathBase = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
This function tries to put this file name in a form relative to {\it pathBase}.
In other words, it returns the file name which should be used to access this
file if the current directory were {\it pathBase}.
\docparam{pathBase}{the directory to use as root, current directory is used by
default}
\docparam{format}{the file name format, native by default}
\wxheading{Return value}
{\tt true} if the file name has been changed, {\tt false} if we failed to do
anything with it (currently this only happens if the file name is on a volume
different from the volume specified by {\it pathBase}).
\wxheading{See also}
\helpref{Normalize}{wxfilenamenormalize}
\membersection{wxFileName::Mkdir}\label{wxfilenamemkdir}
\func{bool}{Mkdir}{\param{int }{perm = 0777}, \param{int }{flags = $0$}}
\func{static bool}{Mkdir}{\param{const wxString\& }{dir}, \param{int }{perm = 0777}, \param{int }{flags = $0$}}
\docparam{dir}{the directory to create}
\docparam{parm}{the permissions for the newly created directory}
\docparam{flags}{if the flags contain {\tt wxPATH\_MKDIR\_FULL} flag,
try to create each directory in the path and also don't return an error
if the target directory already exists.}
\wxheading{Return value}
Returns {\tt true} if the directory was successfully created, {\tt false}
otherwise.
\membersection{wxFileName::Normalize}\label{wxfilenamenormalize}
\func{bool}{Normalize}{\param{int }{flags = wxPATH\_NORM\_ALL}, \param{const wxString\& }{cwd = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
Normalize the path. With the default flags value, the path will be
made absolute, without any ".." and "." and all environment
variables will be expanded in it.
\docparam{flags}{The kind of normalization to do with the file name. It can be
any or-combination of the following constants:
\begin{twocollist}
\twocolitem{{\bf wxPATH\_NORM\_ENV\_VARS}}{replace env vars with their values}
\twocolitem{{\bf wxPATH\_NORM\_DOTS}}{squeeze all .. and . and prepend cwd}
\twocolitem{{\bf wxPATH\_NORM\_TILDE}}{Unix only: replace ~ and ~user}
\twocolitem{{\bf wxPATH\_NORM\_CASE}}{if filesystem is case insensitive, transform to lower case}
\twocolitem{{\bf wxPATH\_NORM\_ABSOLUTE}}{make the path absolute}
\twocolitem{{\bf wxPATH\_NORM\_LONG}}{make the path the long form}
\twocolitem{{\bf wxPATH\_NORM\_SHORTCUT}}{resolve if it is a shortcut (Windows only)}
\twocolitem{{\bf wxPATH\_NORM\_ALL}}{all of previous flags except \texttt{wxPATH\_NORM\_CASE}}
\end{twocollist}
}%
\docparam{cwd}{If not empty, this directory will be used instead of current
working directory in normalization.}
\docparam{format}{The file name format, native by default.}
\membersection{wxFileName::PrependDir}\label{wxfilenameprependdir}
\func{void}{PrependDir}{\param{const wxString\& }{dir}}
Prepends a directory to the file path. Please see
\helpref{AppendDir}{wxfilenameappenddir} for important notes.
\membersection{wxFileName::RemoveDir}\label{wxfilenameremovedir}
\func{void}{RemoveDir}{\param{size\_t }{pos}}
Removes the specified directory component from the path.
\wxheading{See also}
\helpref{GetDirCount}{wxfilenamegetdircount}
\membersection{wxFileName::RemoveLastDir}\label{wxfilenameremovelastdir}
\func{void}{RemoveLastDir}{\void}
Removes last directory component from the path.
\membersection{wxFileName::Rmdir}\label{wxfilenamermdir}
\func{bool}{Rmdir}{\void}
\func{static bool}{Rmdir}{\param{const wxString\& }{dir}}
Deletes the specified directory from the file system.
\membersection{wxFileName::SameAs}\label{wxfilenamesameas}
\constfunc{bool}{SameAs}{\param{const wxFileName\& }{filepath}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
Compares the filename using the rules of this platform.
\membersection{wxFileName::SetCwd}\label{wxfilenamesetcwd}
\func{bool}{SetCwd}{\void}
\func{static bool}{SetCwd}{\param{const wxString\& }{cwd}}
Changes the current working directory.
\membersection{wxFileName::SetExt}\label{wxfilenamesetext}
\func{void}{SetExt}{\param{const wxString\& }{ext}}
Sets the extension of the file name. Setting an empty string
as the extension will remove the extension resulting in a file
name without a trailing dot, unlike a call to
\helpref{SetEmptyExt}{wxfilenamesetemptyext}.
\wxheading{See also}
\helpref{SetEmptyExt}{wxfilenamesetemptyext}
\helpref{ClearExt}{wxfilenameclearext}
\membersection{wxFileName::SetEmptyExt}\label{wxfilenamesetemptyext}
\func{void}{SetEmptyExt}{\void}
Sets the extension of the file name to be an empty extension.
This is different from having no extension at all as the file
name will have a trailing dot after a call to this method.
\wxheading{See also}
\helpref{SetExt}{wxfilenamesetext}
\helpref{ClearExt}{wxfilenameclearext}
\membersection{wxFileName::SetFullName}\label{wxfilenamesetfullname}
\func{void}{SetFullName}{\param{const wxString\& }{fullname}}
The full name is the file name and extension (but without the path).
\membersection{wxFileName::SetName}\label{wxfilenamesetname}
\func{void}{SetName}{\param{const wxString\& }{name}}
Sets the name part (without extension).
\wxheading{See also}
\helpref{SetFullName}{wxfilenamesetfullname}
\membersection{wxFileName::SetTimes}\label{wxfilenamesettimes}
\func{bool}{SetTimes}{\param{const wxDateTime* }{dtAccess}, \param{const wxDateTime* }{dtMod}, \param{const wxDateTime* }{dtCreate}}
Sets the file creation and last access/modification times (any of the pointers may be NULL).
\membersection{wxFileName::SetVolume}\label{wxfilenamesetvolume}
\func{void}{SetVolume}{\param{const wxString\& }{volume}}
Sets the volume specifier.
\membersection{wxFileName::SplitPath}\label{wxfilenamesplitpath}
\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}}
\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}}
\func{static void}{SplitPath}{\param{const wxString\& }{fullpath}, \param{wxString* }{path}, \param{wxString* }{name}, \param{wxString* }{ext}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
This function splits a full file name into components: the volume (with the
first version) path (including the volume in the second version), the base name
and the extension. Any of the output parameters ({\it volume}, {\it path},
{\it name} or {\it ext}) may be {\tt NULL} if you are not interested in the
value of a particular component. Also, {\it fullpath} may be empty on entry.
On return, {\it path} contains the file path (without the trailing separator),
{\it name} contains the file name and {\it ext} contains the file extension
without leading dot. All three of them may be empty if the corresponding
component is. The old contents of the strings pointed to by these parameters
will be overwritten in any case (if the pointers are not {\tt NULL}).
Note that for a filename ``foo.'' the extension is present, as indicated by the
trailing dot, but empty. If you need to cope with such cases, you should use
\arg{hasExt} instead of relying on testing whether \arg{ext} is empty or not.
\membersection{wxFileName::SplitVolume}\label{wxfilenamesplitvolume}
\func{static void}{SplitVolume}{\param{const wxString\& }{fullpath}, \param{wxString* }{volume}, \param{wxString* }{path}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
Splits the given \arg{fullpath} into the volume part (which may be empty) and
the pure path part, not containing any volume.
\wxheading{See also}
\helpref{SplitPath}{wxfilenamesplitpath}
\membersection{wxFileName::Touch}\label{wxfilenametouch}
\func{bool}{Touch}{\void}
Sets the access and modification times to the current moment.
\membersection{wxFileName::operator=}\label{wxfilenameoperatorassign}
\func{wxFileName\& operator}{operator=}{\param{const wxFileName\& }{filename}}
\func{wxFileName\& operator}{operator=}{\param{const wxString\& }{filename}}
Assigns the new value to this filename object.
\membersection{wxFileName::operator==}\label{wxfilenameoperatorequal}
\constfunc{bool operator}{operator==}{\param{const wxFileName\& }{filename}}
\constfunc{bool operator}{operator==}{\param{const wxString\& }{filename}}
Returns {\tt true} if the filenames are equal. The string {\it filenames} is
interpreted as a path in the native filename format.
\membersection{wxFileName::operator!=}\label{wxfilenameoperatornotequal}
\constfunc{bool operator}{operator!=}{\param{const wxFileName\& }{filename}}
\constfunc{bool operator}{operator!=}{\param{const wxString\& }{filename}}
Returns {\tt true} if the filenames are different. The string {\it filenames}
is interpreted as a path in the native filename format.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?