function.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,826 行 · 第 1/5 页

TEX
1,826
字号
\func{}{wxCHANGE\_UMASK}{\param{int }{mask}}

Under Unix this macro changes the current process umask to the given value,
unless it is equal to $-1$ in which case nothing is done, and restores it to
the original value on scope exit. It works by declaring a variable which sets
umask to \arg{mask} in its constructor and restores it in its destructor.

Under other platforms this macro expands to nothing.


\membersection{::wxConcatFiles}\label{wxconcatfiles}

\func{bool}{wxConcatFiles}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2},
\param{const wxString\& }{file3}}

Concatenates {\it file1} and {\it file2} to {\it file3}, returning
true if successful.


\membersection{::wxCopyFile}\label{wxcopyfile}

\func{bool}{wxCopyFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}, \param{bool }{overwrite = true}}

Copies {\it file1} to {\it file2}, returning true if successful. If
{\it overwrite} parameter is true (default), the destination file is overwritten
if it exists, but if {\it overwrite} is false, the functions fails in this
case.


\membersection{::wxGetCwd}\label{wxgetcwd}

\func{wxString}{wxGetCwd}{\void}

Returns a string containing the current (or working) directory.


\membersection{::wxGetWorkingDirectory}\label{wxgetworkingdirectory}

\func{wxString}{wxGetWorkingDirectory}{\param{char *}{buf=NULL}, \param{int }{sz=1000}}

{\bf NB:} This function is deprecated: use \helpref{wxGetCwd}{wxgetcwd} instead.

Copies the current working directory into the buffer if supplied, or
copies the working directory into new storage (which you {\emph must} delete
yourself) if the buffer is NULL.

{\it sz} is the size of the buffer if supplied.


\membersection{::wxGetTempFileName}\label{wxgettempfilename}

\func{char *}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char *}{buf=NULL}}

\func{bool}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{wxString\& }{buf}}

%% Makes a temporary filename based on {\it prefix}, opens and closes the file,
%% and places the name in {\it buf}. If {\it buf} is NULL, new store
%% is allocated for the temporary filename using {\it new}.
%%
%% Under Windows, the filename will include the drive and name of the
%% directory allocated for temporary files (usually the contents of the
%% TEMP variable). Under Unix, the {\tt /tmp} directory is used.
%%
%% It is the application's responsibility to create and delete the file.

{\bf NB:} These functions are obsolete, please use\rtfsp
\helpref{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename}\rtfsp
instead.


\membersection{::wxIsWild}\label{wxiswild}

\func{bool}{wxIsWild}{\param{const wxString\& }{pattern}}

Returns true if the pattern contains wildcards. See \helpref{wxMatchWild}{wxmatchwild}.


\membersection{::wxMatchWild}\label{wxmatchwild}

\func{bool}{wxMatchWild}{\param{const wxString\& }{pattern}, \param{const wxString\& }{text}, \param{bool}{ dot\_special}}

Returns true if the \arg{pattern}\/ matches the {\it text}\/; if {\it
dot\_special}\/ is true, filenames beginning with a dot are not matched
with wildcard characters. See \helpref{wxIsWild}{wxiswild}.


\membersection{::wxMkdir}\label{wxmkdir}

\func{bool}{wxMkdir}{\param{const wxString\& }{dir}, \param{int }{perm = 0777}}

Makes the directory \arg{dir}, returning true if successful.

{\it perm} is the access mask for the directory for the systems on which it is
supported (Unix) and doesn't have any effect on the other ones.


\membersection{::wxParseCommonDialogsFilter}\label{wxparsecommondialogsfilter}

\func{int}{wxParseCommonDialogsFilter}{\param{const wxString\& }{wildCard}, \param{wxArrayString\& }{descriptions}, \param{wxArrayString\& }{filters}}

Parses the \arg{wildCard}, returning the number of filters.
Returns 0 if none or if there's a problem.
The arrays will contain an equal number of items found before the error.
On platforms where native dialogs handle only one filter per entry,
entries in arrays are automatically adjusted.
\arg{wildCard} is in the form:
\begin{verbatim}
 "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
\end{verbatim}

\membersection{::wxRemoveFile}\label{wxremovefile}

\func{bool}{wxRemoveFile}{\param{const wxString\& }{file}}

Removes \arg{file}, returning true if successful.


\membersection{::wxRenameFile}\label{wxrenamefile}

\func{bool}{wxRenameFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}, \param{bool }{overwrite = true}}

Renames \arg{file1} to \arg{file2}, returning true if successful.

If \arg{overwrite} parameter is true (default), the destination file is
overwritten if it exists, but if \arg{overwrite} is false, the functions fails
in this case.


\membersection{::wxRmdir}\label{wxrmdir}

\func{bool}{wxRmdir}{\param{const wxString\& }{dir}, \param{int}{ flags=0}}

Removes the directory {\it dir}, returning true if successful. Does not work under VMS.

The {\it flags} parameter is reserved for future use.


\membersection{::wxSetWorkingDirectory}\label{wxsetworkingdirectory}

\func{bool}{wxSetWorkingDirectory}{\param{const wxString\& }{dir}}

Sets the current working directory, returning true if the operation succeeded.
Under MS Windows, the current drive is also changed if {\it dir} contains a drive specification.


\membersection{::wxSplitPath}\label{wxsplitfunction}

\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}

{\bf NB:} This function is obsolete, please use
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.

This function splits a full file name into components: the path (including possible disk/drive
specification under Windows), the base name and the extension. Any of the output parameters
({\it path}, {\it name} or {\it ext}) may be NULL if you are not interested in the value of
a particular component.

wxSplitPath() will correctly handle filenames with both DOS and Unix path separators under
Windows, however it will not consider backslashes as path separators under Unix (where backslash
is a valid character in a filename).

On entry, {\it fullname} should be non-NULL (it may be empty though).

On return, {\it path} contains the file path (without the trailing separator), {\it name}
contains the file name and {\it ext} contains the file extension without leading dot. All
three of them may be empty if the corresponding component is. The old contents of the
strings pointed to by these parameters will be overwritten in any case (if the pointers
are not NULL).


\membersection{::wxTransferFileToStream}\label{wxtransferfiletostream}

\func{bool}{wxTransferFileToStream}{\param{const wxString\& }{filename}, \param{ostream\& }{stream}}

Copies the given file to {\it stream}. Useful when converting an old application to
use streams (within the document/view framework, for example).

\wxheading{Include files}

<wx/docview.h>


\membersection{::wxTransferStreamToFile}\label{wxtransferstreamtofile}

\func{bool}{wxTransferStreamToFile}{\param{istream\& }{stream} \param{const wxString\& }{filename}}

Copies the given stream to the file {\it filename}. Useful when converting an old application to
use streams (within the document/view framework, for example).

\wxheading{Include files}

<wx/docview.h>



\section{Network, user and OS functions}\label{networkfunctions}

The functions in this section are used to retrieve information about the
current computer and/or user characteristics.


\membersection{::wxGetEmailAddress}\label{wxgetemailaddress}

\func{wxString}{wxGetEmailAddress}{\void}

\func{bool}{wxGetEmailAddress}{\param{char * }{buf}, \param{int }{sz}}

Copies the user's email address into the supplied buffer, by
concatenating the values returned by \helpref{wxGetFullHostName}{wxgetfullhostname}\rtfsp
and \helpref{wxGetUserId}{wxgetuserid}.

Returns true if successful, false otherwise.

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetFreeMemory}\label{wxgetfreememory}

\func{wxMemorySize}{wxGetFreeMemory}{\void}

Returns the amount of free memory in bytes under environments which
support it, and -1 if not supported or failed to perform measurement.

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetFullHostName}\label{wxgetfullhostname}

\func{wxString}{wxGetFullHostName}{\void}

Returns the FQDN (fully qualified domain host name) or an empty string on
error.

\wxheading{See also}

\helpref{wxGetHostName}{wxgethostname}

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetHomeDir}\label{wxgethomedir}

\func{wxString}{wxGetHomeDir}{\void}

Return the (current) user's home directory.

\wxheading{See also}

\helpref{wxGetUserHome}{wxgetuserhome}\\
\helpref{wxStandardPaths}{wxstandardpaths}

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetHostName}\label{wxgethostname}

\func{wxString}{wxGetHostName}{\void}

\func{bool}{wxGetHostName}{\param{char * }{buf}, \param{int }{sz}}

Copies the current host machine's name into the supplied buffer. Please note
that the returned name is {\it not} fully qualified, i.e. it does not include
the domain name.

Under Windows or NT, this function first looks in the environment
variable SYSTEM\_NAME; if this is not found, the entry {\bf HostName}\rtfsp
in the {\bf wxWidgets} section of the WIN.INI file is tried.

The first variant of this function returns the hostname if successful or an
empty string otherwise. The second (deprecated) function returns true
if successful, false otherwise.

\wxheading{See also}

\helpref{wxGetFullHostName}{wxgetfullhostname}

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetOsDescription}\label{wxgetosdescription}

\func{wxString}{wxGetOsDescription}{\void}

Returns the string containing the description of the current platform in a
user-readable form. For example, this function may return strings like
{\tt Windows NT Version 4.0} or {\tt Linux 2.2.2 i386}.

\wxheading{See also}

\helpref{::wxGetOsVersion}{wxgetosversion}

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetOsVersion}\label{wxgetosversion}

\func{int}{wxGetOsVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}}

Gets operating system version information.

\begin{twocollist}\itemsep=0pt
\twocolitemruled{Platform}{Return types}
\twocolitem{Mac OS}{Return value is wxMAC when compiled with CodeWarrior under Mac OS 8.x/9.x and Mac OS X, wxMAC\_DARWIN when compiled with the Apple Developer Tools under Mac OS X.

Both {\it major} and {\it minor} have to be looked at as hexadecimal numbers. So System 10.2.4 returns 0x10, resp 16 for {\it major} and 0x24, resp 36 for {\it minor}. }
\twocolitem{GTK}{Return value is wxGTK, For GTK 1.0, {\it major} is 1, {\it minor} is 0. }
\twocolitem{Motif}{Return value is wxMOTIF\_X, {\it major} is X version, {\it minor} is X revision.}
\twocolitem{OS/2}{Return value is wxOS2\_PM.}
\twocolitem{Windows 3.1}{Return value is wxWINDOWS, {\it major} is 3, {\it minor} is 1.}
\twocolitem{Windows NT/2000}{Return value is wxWINDOWS\_NT, version is returned in {\it major} and {\it minor}.}
\twocolitem{Windows 98}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 1 or greater.}
\twocolitem{Windows 95}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 0.}
\twocolitem{Win32s (Windows 3.1)}{Return value is wxWIN32S, {\it major} is 3, {\it minor} is 1.}
\twocolitem{Windows PocketPC}{Return value is wxWINDOWS\_POCKETPC, version is returned in {\it major} and {\it minor}.}
\twocolitem{Windows Smartphone}{Return value is wxWINDOWS\_SMARTPHONE, version is returned in {\it major} and {\it minor}.}
\twocolitem{Windows CE (non-specific)}{Return value is wxWINDOWS\_CE, version is returned in {\it major} and {\it minor}.}
\twocolitem{Watcom C++ 386 supervisor mode (Windows 3.1)}{Return value is wxWIN386, {\it major} is 3, {\it minor} is 1.}
\end{twocollist}

\wxheading{See also}

\helpref{::wxGetOsDescription}{wxgetosdescription}

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetUserHome}\label{wxgetuserhome}

\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}

Returns the home directory for the given user. If the username is empty
(default value), this function behaves like
\helpref{wxGetHomeDir}{wxgethomedir}.

\wxheading{Include files}

<wx/utils.h>


\membersection{::wxGetUserId}\label{wxgetuserid}

\func{wxString}{wxGetUserId}{\void}

\func{bool}{wxGetUserId}{\param{char * }{buf}, \param{int }{sz}}

This function returns the "user id" also known as "login name" under Unix i.e.
something like "jsmith". It uniquely identifies the current user (on this system).

Under Windows or NT, this function first looks in the environment
variables USER and LOGNAME; if neither of these is found, the entry {\bf UserId}\rtfsp
in the {\bf wxWidgets} section of the WIN.INI file is tried.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?