Contents Up Previous Next

Network, user and OS functions

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

::wxGetEmailAddress
::wxGetFreeMemory
::wxGetFullHostName
::wxGetHomeDir
::wxGetHostName
::wxGetOsDescription
::wxGetOsVersion
::wxIsPlatformLittleEndian
::wxIsPlatform64Bit
::wxGetUserHome
::wxGetUserId
::wxGetUserName


::wxGetEmailAddress

wxString wxGetEmailAddress()

bool wxGetEmailAddress(char * buf, int sz)

Copies the user's email address into the supplied buffer, by concatenating the values returned by wxGetFullHostName and wxGetUserId.

Returns true if successful, false otherwise.

インクルードファイル

<wx/utils.h>


::wxGetFreeMemory

wxMemorySize wxGetFreeMemory()

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

インクルードファイル

<wx/utils.h>


::wxGetFullHostName

wxString wxGetFullHostName()

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

参照

wxGetHostName

インクルードファイル

<wx/utils.h>


::wxGetHomeDir

wxString wxGetHomeDir()

Return the (current) user's home directory.

参照

wxGetUserHome
wxStandardPaths

インクルードファイル

<wx/utils.h>


::wxGetHostName

wxString wxGetHostName()

bool wxGetHostName(char * buf, int sz)

現在のホストマシン名を与えられたバッファへコピーします。Please note that the returned name is 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 HostName in the 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.

参照

wxGetFullHostName

インクルードファイル

<wx/utils.h>


::wxGetOsDescription

wxString wxGetOsDescription()

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

参照

::wxGetOsVersion

インクルードファイル

<wx/utils.h>


::wxGetOsVersion

wxOperatingSystemId wxGetOsVersion(int *major = NULL, int *minor = NULL)

Gets the version and the operating system ID for currently running OS. See wxPlatformInfo for more details about wxOperatingSystemId.

参照

::wxGetOsDescription, wxPlatformInfo

インクルードファイル

<wx/utils.h>


::wxIsPlatformLittleEndian

bool wxIsPlatformLittleEndian()

Returns true if the current platform is little endian (instead of big endian). The check is performed at run-time.

参照

Byte order macros

インクルードファイル

<wx/utils.h>


::wxIsPlatform64Bit

bool wxIsPlatform64Bit()

Returns true if the operating system the program is running under is 64 bit. The check is performed at run-time and may differ from the value available at compile-time (at compile-time you can just check if sizeof(void*)==8) since the program could be running in emulation mode or in a mixed 32/64 bit system (bi-architecture operating system).

Very important: this function is not 100% reliable on some systems given the fact that there isn't always a standard way to do a reliable check on the OS architecture.

インクルードファイル

<wx/utils.h>


::wxGetUserHome

const wxChar * wxGetUserHome(const wxString& user = "")

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

インクルードファイル

<wx/utils.h>


::wxGetUserId

wxString wxGetUserId()

bool wxGetUserId(char * buf, 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 UserId in the wxWidgets section of the WIN.INI file is tried.

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

参照

wxGetUserName

インクルードファイル

<wx/utils.h>


::wxGetUserName

wxString wxGetUserName()

bool wxGetUserName(char * buf, int sz)

This function returns the full user name (something like "Mr. John Smith").

Under Windows or NT, this function looks for the entry UserName in the wxWidgets section of the WIN.INI file. If PenWindows is running, the entry Current in the section User of the PENWIN.INI file is used.

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

参照

wxGetUserId

インクルードファイル

<wx/utils.h>