wxPlatformInfo Class Reference
[Miscellaneous]

#include <wx/platinfo.h>

Inheritance diagram for wxPlatformInfo:

wxObject

List of all members.


Detailed Description

This class holds informations about the operating system and the toolkit that the application is running under and some basic architecture info of the machine where it's running.

Library:  wxBase

Category:  Miscellaneous

See also:
wxGetOsVersion(), wxIsPlatformLittleEndian(), wxIsPlatform64Bit(), wxAppTraits

Public Member Functions

 wxPlatformInfo ()
 wxPlatformInfo (wxPortId pid=wxPORT_UNKNOWN, int tkMajor=-1, int tkMinor=-1, wxOperatingSystemId id=wxOS_UNKNOWN, int osMajor=-1, int osMinor=-1, wxArchitecture arch=wxARCH_INVALID, wxEndianness endian=wxENDIAN_INVALID)
bool CheckOSVersion (int major, int minor) const
bool CheckToolkitVersion (int major, int minor) const
wxString GetArchName () const
wxArchitecture GetArchitecture () const
wxEndianness GetEndianness () const
wxString GetEndiannessName () const
int GetOSMajorVersion () const
int GetOSMinorVersion () const
wxString GetOperatingSystemFamilyName () const
wxOperatingSystemId GetOperatingSystemId () const
wxString GetOperatingSystemIdName () const
wxPortId GetPortId () const
wxString GetPortIdName () const
wxString GetPortIdShortName () const
int GetToolkitMajorVersion () const
int GetToolkitMinorVersion () const
bool IsOk () const
bool IsUsingUniversalWidgets () const
void SetArchitecture (wxArchitecture n)
void SetEndianness (wxEndianness n)
void SetOSVersion (int major, int minor)
void SetOperatingSystemId (wxOperatingSystemId n)
void SetPortId (wxPortId n)
void SetToolkitVersion (int major, int minor)
bool operator!= (const wxPlatformInfo &t) const
bool operator== (const wxPlatformInfo &t) const

Static Public Member Functions

static const wxPlatformInfo Get ()
static wxArchitecture GetArch (const wxString &arch)
static wxString GetArchName (wxArchitecture arch) const
static wxEndianness GetEndianness (const wxString &end) const
static wxString GetEndiannessName (wxEndianness end) const
static wxString GetOperatingSystemFamilyName (wxOperatingSystemId os) const
static wxOperatingSystemId GetOperatingSystemId (const wxString &name) const
static wxString GetOperatingSystemIdName (wxOperatingSystemId os) const
static wxPortId GetPortId (const wxString &portname) const
static wxString GetPortIdName (wxPortId port, bool usingUniversal) const
static wxString GetPortIdShortName (wxPortId port, bool usingUniversal) const

Constructor & Destructor Documentation

wxPlatformInfo::wxPlatformInfo (  ) 

Initializes the instance with the values corresponding to the currently running platform.

This is a fast operation because it only requires to copy the values internally cached for the currently running platform.

See also:
Get()

wxPlatformInfo::wxPlatformInfo ( wxPortId  pid = wxPORT_UNKNOWN,
int  tkMajor = -1,
int  tkMinor = -1,
wxOperatingSystemId  id = wxOS_UNKNOWN,
int  osMajor = -1,
int  osMinor = -1,
wxArchitecture  arch = wxARCH_INVALID,
wxEndianness  endian = wxENDIAN_INVALID 
)

Initializes the object using given values.


Member Function Documentation

bool wxPlatformInfo::CheckOSVersion ( int  major,
int  minor 
) const

Returns true if the OS version is at least major.minor.

See also:
GetOSMajorVersion(), GetOSMinorVersion(), CheckToolkitVersion()

bool wxPlatformInfo::CheckToolkitVersion ( int  major,
int  minor 
) const

Returns true if the toolkit version is at least major.minor.

See also:
GetToolkitMajorVersion(), GetToolkitMinorVersion(), CheckOSVersion()

static const wxPlatformInfo wxPlatformInfo::Get (  )  [static]

Returns the global wxPlatformInfo object, initialized with the values for the currently running platform.

static wxArchitecture wxPlatformInfo::GetArch ( const wxString arch  )  [static]

Converts the given string to a wxArchitecture enum value or to wxARCH_INVALID if the given string is not a valid architecture string (i.e. does not contain nor 32 nor 64 strings).

static wxString wxPlatformInfo::GetArchName ( wxArchitecture  arch  )  const [static]

Returns the name for the given wxArchitecture enumeration value.

wxString wxPlatformInfo::GetArchName (  )  const

Returns the name for the architecture of this wxPlatformInfo instance.

wxArchitecture wxPlatformInfo::GetArchitecture (  )  const

Returns the architecture ID of this wxPlatformInfo instance.

static wxEndianness wxPlatformInfo::GetEndianness ( const wxString end  )  const [static]

Converts the given string to a wxEndianness enum value or to wxENDIAN_INVALID if the given string is not a valid endianness string (i.e. does not contain nor little nor big strings).

wxEndianness wxPlatformInfo::GetEndianness (  )  const

Returns the endianness ID of this wxPlatformInfo instance.

static wxString wxPlatformInfo::GetEndiannessName ( wxEndianness  end  )  const [static]

Returns name for the given wxEndianness enumeration value.

wxString wxPlatformInfo::GetEndiannessName (  )  const

Returns the name for the endianness of this wxPlatformInfo instance.

int wxPlatformInfo::GetOSMajorVersion (  )  const

Returns the run-time major version of the OS associated with this wxPlatformInfo instance.

See also:
wxGetOsVersion(), CheckOSVersion()

int wxPlatformInfo::GetOSMinorVersion (  )  const

Returns the run-time minor version of the OS associated with this wxPlatformInfo instance.

See also:
wxGetOsVersion(), CheckOSVersion()

static wxString wxPlatformInfo::GetOperatingSystemFamilyName ( wxOperatingSystemId  os  )  const [static]

Returns the operating system family name for the given wxOperatingSystemId enumeration value: Unix for wxOS_UNIX, Macintosh for wxOS_MAC, Windows for wxOS_WINDOWS, DOS for wxOS_DOS, OS/2 for wxOS_OS2.

wxString wxPlatformInfo::GetOperatingSystemFamilyName (  )  const

Returns the operating system family name of the OS associated with this wxPlatformInfo instance.

static wxOperatingSystemId wxPlatformInfo::GetOperatingSystemId ( const wxString name  )  const [static]

Converts the given string to a wxOperatingSystemId enum value or to wxOS_UNKNOWN if the given string is not a valid operating system name.

wxOperatingSystemId wxPlatformInfo::GetOperatingSystemId (  )  const

Returns the operating system ID of this wxPlatformInfo instance.

static wxString wxPlatformInfo::GetOperatingSystemIdName ( wxOperatingSystemId  os  )  const [static]

Returns the name for the given operating system ID value.

This can be a long name (e.g. Microsoft Windows NT); use GetOperatingSystemFamilyName() to retrieve a short, generic name.

wxString wxPlatformInfo::GetOperatingSystemIdName (  )  const

Returns the operating system name of the OS associated with this wxPlatformInfo instance.

static wxPortId wxPlatformInfo::GetPortId ( const wxString portname  )  const [static]

Converts the given string to a wxWidgets port ID value or to wxPORT_UNKNOWN if the given string does not match any of the wxWidgets canonical name ports ("wxGTK", "wxMSW", etc) nor any of the short wxWidgets name ports ("gtk", "msw", etc).

wxPortId wxPlatformInfo::GetPortId (  )  const

Returns the wxWidgets port ID associated with this wxPlatformInfo instance.

static wxString wxPlatformInfo::GetPortIdName ( wxPortId  port,
bool  usingUniversal 
) const [static]

Returns the name of the given wxWidgets port ID value. The usingUniversal argument specifies whether the port is in its native or wxUniversal variant.

The returned string always starts with the "wx" prefix and is a mixed-case string.

wxString wxPlatformInfo::GetPortIdName (  )  const

Returns the name of the wxWidgets port ID associated with this wxPlatformInfo instance.

static wxString wxPlatformInfo::GetPortIdShortName ( wxPortId  port,
bool  usingUniversal 
) const [static]

Returns the short name of the given wxWidgets port ID value. The usingUniversal argument specifies whether the port is in its native or wxUniversal variant.

The returned string does not start with the "wx" prefix and is always lower case.

wxString wxPlatformInfo::GetPortIdShortName (  )  const

Returns the short name of the wxWidgets port ID associated with this wxPlatformInfo instance.

int wxPlatformInfo::GetToolkitMajorVersion (  )  const

Returns the run-time major version of the toolkit associated with this wxPlatformInfo instance.

Note that if GetPortId() returns wxPORT_BASE, then this value is zero (unless externally modified with SetToolkitVersion()); that is, no native toolkit is in use. See wxAppTraits::GetToolkitVersion() for more info.

See also:
CheckToolkitVersion()

int wxPlatformInfo::GetToolkitMinorVersion (  )  const

Returns the run-time minor version of the toolkit associated with this wxPlatformInfo instance.

Note that if GetPortId() returns wxPORT_BASE, then this value is zero (unless externally modified with SetToolkitVersion()); that is, no native toolkit is in use. See wxAppTraits::GetToolkitVersion() for more info.

See also:
CheckToolkitVersion()

bool wxPlatformInfo::IsOk (  )  const

Returns true if this instance is fully initialized with valid values.

bool wxPlatformInfo::IsUsingUniversalWidgets (  )  const

Returns true if this wxPlatformInfo describes wxUniversal build.

void wxPlatformInfo::SetArchitecture ( wxArchitecture  n  ) 

Sets the architecture enum value associated with this wxPlatformInfo instance.

void wxPlatformInfo::SetEndianness ( wxEndianness  n  ) 

Sets the endianness enum value associated with this wxPlatformInfo instance.

void wxPlatformInfo::SetOSVersion ( int  major,
int  minor 
)

Sets the version of the operating system associated with this wxPlatformInfo instance.

void wxPlatformInfo::SetOperatingSystemId ( wxOperatingSystemId  n  ) 

Sets the operating system associated with this wxPlatformInfo instance.

void wxPlatformInfo::SetPortId ( wxPortId  n  ) 

Sets the wxWidgets port ID associated with this wxPlatformInfo instance.

void wxPlatformInfo::SetToolkitVersion ( int  major,
int  minor 
)

Sets the version of the toolkit associated with this wxPlatformInfo instance.

bool wxPlatformInfo::operator!= ( const wxPlatformInfo t  )  const

Inequality operator. Tests all class' internal variables.

bool wxPlatformInfo::operator== ( const wxPlatformInfo t  )  const

Equality operator. Tests all class' internal variables.



wxWidgets logo

[ top ]