Document the platform class and fix doxygen markup.

Originally committed to SVN as r3564.
This commit is contained in:
Amar Takhar 2009-09-26 19:59:24 +00:00
parent 9104079dab
commit e13ca226fb
1 changed files with 214 additions and 32 deletions

View File

@ -25,81 +25,263 @@
#include <wx/intl.h>
#endif
/// @class Platform
/// @brief Grab platform-specific information.
class Platform {
public:
/// @brief Constructor
/// Constructor
Platform() {};
/// @brief Destructor
/// Destructor
virtual ~Platform() {};
// Get platform instance.
/// Get platform instance.
static Platform* GetPlatform();
// These are platform agnostic.
/// @name Platform Agonstic
/// These are platform agnostic mostly from wx functions.
//@{
// From wxPlatformInfo
wxString ArchName(); /// Architecture
wxString OSFamily(); /// OS Family
wxString OSName(); /// OS Name
wxString Endian(); /// Endian
/// Architecture
/// @return Architecture name.
/// @retval 32 bit, 64 bit
wxString ArchName();
/// OS Family
/// @return OS Family
/// @retval Unix, Windows, Mac
wxString OSFamily();
/// OS Name
/// @return OS Name
/// @retval FreeBSD, Windows, Mac
wxString OSName();
/// Endian
/// @return Endian
/// @retval Little endian, Big endian
wxString Endian();
// From <wx/gdicmn.h>
wxString DisplayColour(); /// Is the display colour?
wxString DisplayDepth(); /// Depth
wxString DisplaySize(); /// Size
wxString DisplayPPI(); /// Pixels Per Inch
/// Is the display colour
/// @return true/false
/// @retval 1, 0
wxString DisplayColour();
/// Display depth
/// @return Depth
/// @return Integer
wxString DisplayDepth();
/// Display size
/// @return Size delimited by a space.
/// @retval "w h"
wxString DisplaySize();
/// Pixels per inch
/// @return PPI
/// @retval Integer
wxString DisplayPPI();
// Misc
wxString Signature(); /// Report signature.
wxString wxVersion(); /// wxWidgets version.
wxString Locale(); /// Locale
wxString Language(); /// Language currently in use
wxString SystemLanguage(); /// System language
wxString Date(); /// Date
wxString Time(); /// Time
wxString TimeZone(); /// TimeZone
// The following are all platform-specific.
/// Report signature
/// @return Signature
/// @retval SHA256 hash
wxString Signature();
/// wxWidgets version
/// @return Version
/// @retval Major.Minor.Micro.Patch: 2.9.0.0
wxString wxVersion();
/// Locale
/// @return Locale name
/// @retval C,POSIX,<code>
wxString Locale();
/// Language currently in use
/// @return Language reporter is currently running in
/// @retval Language code: en_US, en_CA...
wxString Language();
/// System language
/// @return Language operating system is currently running in
/// @retval Language code: en_US, en_CA...
wxString SystemLanguage();
/// Date
/// @return Date
/// @retval Date in YYYY-MM-DD
wxString Date();
/// Time
/// @return Time
/// @retval Time in HH:MM:SS
wxString Time();
/// TimeZone
/// @return TimeZone
/// @retval EST,EDT,JST...
wxString TimeZone();
//@}
/// @name Platform Specific
/// The following are all platform-specific.
//@{
// Misc
/// Operating System version
/// @return OS Version
/// @retval Any
virtual wxString OSVersion()=0;
// Hardware
virtual wxString CPUId()=0;
virtual wxString CPUSpeed()=0;
virtual wxString CPUCount()=0;
virtual wxString CPUCores()=0;
virtual wxString CPUFeatures()=0;
virtual wxString CPUFeatures2()=0;
virtual wxString Memory()=0;
virtual wxString Video()=0;
// Windows
/// CPU ID string
/// @return CPU ID
/// @retval Any, ex: Intel(R) Pentium(R) M processor 1600MHz
virtual wxString CPUId()=0;
/// CPU Speed
/// @return Speed
/// @retval Integer
virtual wxString CPUSpeed()=0;
/// CPU Count
/// @return Count
/// @retval Integer
virtual wxString CPUCount()=0;
/// CPU Cores
/// @return Cores
/// @retval Integer
virtual wxString CPUCores()=0;
/// CPU Features
/// @return Features set 1
/// @retval FPU,VME,DE,PSE,TSC,MSR...
virtual wxString CPUFeatures()=0;
/// CPU Features2
/// @return Features set 2
/// @retval CPU-specific features
virtual wxString CPUFeatures2()=0;
/// System memory
/// @return Memory
/// @retval Integer in bytes
virtual wxString Memory()=0;
/// Video card
/// @return Video card
/// @retval Any
virtual wxString Video()=0;
//@}
/// @name Windows
//@{
#ifdef __WINDOWS__
/// Service pack
/// @return Service pack
/// @retval Any
virtual wxString ServicePack()=0;
/// Graphics driver version
/// @return Driver version
/// @retval Any
virtual wxString DriverGraphicsVersion()=0;
/// Directshow filters installed
/// @return wxXmlNode of filters installed
/// @retval A wxXmlNode in the format of:
/// \verbatim
/// <filter>
/// <name version="[version]">[name]</name>
/// </filter>
/// \endverbatim
virtual wxString DirectShowFilters()=0;
/// AntiVirus installed
/// @return true/false
/// @retval 1,0
virtual wxString AntiVirus()=0;
/// Firewall installed
/// @return true/false
/// @retval 1,0
virtual wxString FireWall()=0;
/// DLL versions used
/// @return wxXmlNode of DLLs used
/// @retval A wxXmlNode in the format of:
/// \verbatim
/// <dll>
/// <file version="[version]">[name]</file>
/// </dll>
/// \endverbatim
virtual wxString DLLVersions()=0;
#endif
//@}
// Unix
/// @name Unix
//@{
#ifdef __UNIX__
/// Dynamic libraries used
/// @return wxXmlNode of libraries used
/// @retval A wxXmlNode in the format of:
/// \verbatim
/// <lib>
/// <file version="[version]">[name]</file>
/// </lib>
/// \endverbatim
virtual wxString UnixLibraries()=0;
/// Desktop environment
/// @return Environment
/// @retval Gnome, KDE, WindowMaker...
virtual wxString DesktopEnvironment()=0;
#endif
//@}
// OS X
/// @name OS X
//@{
#ifdef __OSX__
/// OS patch level
/// @return Patch level
/// @retval Any
virtual wxString PatchLevel()=0;
/// QuickTime extensions
/// @return wxXmlNode of extensions used
/// @retval A wxXmlNode in the format of:
/// \verbatim
/// <quicktime>
/// <ext version="[version]">[name]</file>
/// </quicktime>
/// \endverbatim
virtual wxString QuickTimeExt()=0;
/// Hardware model
/// @return Model
/// @retval Any
virtual wxString HardwareModel()=0;
#endif
//@}
private:
void Init();
/// wxPlatformInfo struct.
const wxPlatformInfo plat;
/// wxLocale instance.
wxLocale *locale;
};