hwdet Namespace Reference

Contains all detector's classes. More...


Data Structures

class  WindowsAdvancedFeatures
 Storage for all OS data specific to Windows. More...
class  WindowsDetector
 Windows detector core class. More...
class  AdvancedFeatures
 Empty class which enforces realtions between various implementations of AdvancedFeatures for various OSes. More...
class  BasicFeatures
 Storage class for common OS features. These features are supported by all detectors. More...
class  BeenDisk
 This class stores information about drive space available for BEEN to use. More...
class  CheckedResult
 Provides means to return two values from function - call status and return value. More...
class  Detector
 Base class for all detectors. Each detector for specific OS is derived from this class. More...
class  DiskDrive
 Storage class for disk drive related data. More...
class  DiskPartition
 Storage class for all partition related data. More...
class  Memory
 Storage class for all memory related data. More...
class  MessageReporter
 Class which provides simple way to report messages. More...
class  NetworkAdapter
 Storage for all network related data. More...
class  OperatingSystem
 This class stores all OS specific data. More...
class  Processor
 Storage class for all CPU related data. More...
class  Product
 Storage class for installed software product (application) related data. More...
class  XMLElement
 Basic class for all nodes in XML file. More...
class  XMLValueElement
 Node in XML file which contains value of given type. More...
class  XMLOutputFile
 Class which represent simple XML files. This class Only allows writing to such files (no parsing). More...

Typedefs

typedef ::std::string String
 ASCII string.
typedef ::std::stringstream StringStream
 ASCII string stream.
typedef ::std::istringstream IStringStream
 ASCII string input stream.
typedef ::std::ostringstream OStringStream
 ASCII string output stream.
typedef ::std::fstream FStream
 ASCII file stream.
typedef ::std::ifstream IFStream
 ASCII file input stream.
typedef ::std::ofstream OFStream
 ASCII file output stream.
typedef ::std::ostream OStream
 ASCII output stream.
typedef ::std::istream IStream
 ASCII input stream.
typedef ::std::iostream IOStream
 ASCII input/output stream.
typedef char Char
 ASCII character.

Functions

bool OpenRegistryKey (const HKEY hkey, const String &keyName, HKEY &result, const REGSAM access=KEY_READ)
 Open specified registry key.
bool CloseRegistryKey (const HKEY hkey)
 Close registry key.
bool EnumerateSubKeys (const HKEY hkey, std::vector< String > &result)
 Build list of all subkeys of specified key.
bool EnumerateValues (const HKEY hkey, std::vector< String > &result)
 Build list of all values of specified key.
String RegistryValueToString (BYTE *data, DWORD type, DWORD dataLength)
bool GetSubKeyValueMap (const HKEY hkey, const String &subKeyName, std::map< String, String > &result)
 Build map containing all values of specified key as strings.
bool GetValueAsString (const HKEY hkey, const String &valueName, String &result)
 Get specified value as a string.
String LeadToN (int number, size_t length=2, Char lead_char=TXT('0'))
 Convert number to string with specified length.
String VariantToString (const VARIANT &var)
 Convert variant to string.
unsigned __int64 VariantToUInt (const VARIANT &var)
 Convert variant to 64-bit unsigned int.
CheckedResult< StringGetValueAsString (IWbemClassObject *object, const LPCWSTR property_name)
 Retrieve value as string.
CheckedResult< unsigned __int64 > GetValueAsUInt (IWbemClassObject *object, const LPCWSTR property_name)
 Retrieve value as integer.
template<typename T>
String ConvertToXMLString (const T &value)
 Convert given value to the string.
String ConvertToXMLString (const String &value)
 Convert string to XML-friendly version (all special chars are escaped).

Variables

std::ostream & Cout = std::cout
 ACSII standard output stream.
std::ostream & Cerr = std::cerr
 ASCII standard input stream.
std::istream & Cin = std::cin
 ASCII standard input stream.
std::ostream & Cout
 ACSII standard output stream.
std::ostream & Cerr
 ASCII standard input stream.
std::istream & Cin
 ASCII standard input stream.
const Char DefaultEncoding [] = TXT("US-ASCII")
 Default encoding of the output.


Detailed Description

Contains all detector's classes.

Typedef Documentation

typedef ::std::string hwdet::String

ASCII string.

typedef ::std::stringstream hwdet::StringStream

ASCII string stream.

typedef ::std::istringstream hwdet::IStringStream

ASCII string input stream.

typedef ::std::ostringstream hwdet::OStringStream

ASCII string output stream.

typedef ::std::fstream hwdet::FStream

ASCII file stream.

typedef ::std::ifstream hwdet::IFStream

ASCII file input stream.

typedef ::std::ofstream hwdet::OFStream

ASCII file output stream.

typedef ::std::ostream hwdet::OStream

ASCII output stream.

typedef ::std::istream hwdet::IStream

ASCII input stream.

typedef ::std::iostream hwdet::IOStream

ASCII input/output stream.

typedef char hwdet::Char

ASCII character.


Function Documentation

bool hwdet::OpenRegistryKey ( const HKEY  hkey,
const String keyName,
HKEY &  result,
const REGSAM  access = KEY_READ 
)

Open specified registry key.

Open registry key with the specified name. Key has to be sub-key of the key already open.

Parameters:
hkey Handle to already opened registry key. This can be key opened either with OpenRegistryKey function or it can be one of HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS.
keyName Name of the sub-key to open. Names are not case sensitive.
result Reference to variable which receives handle to the key opened.
access Access rights requested. Default value is read-only access. More about access rights can be found in MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_key_security_and_access_rights.asp
Returns:
true on success, false otherwise.

bool hwdet::CloseRegistryKey ( const HKEY  hkey  ) 

Close registry key.

Close registry key.

Parameters:
hkey Handle to the key to close.
Returns:
true on success, false otherwise.

bool hwdet::EnumerateSubKeys ( const HKEY  hkey,
std::vector< String > &  result 
)

Build list of all subkeys of specified key.

Get list of names of all sub keys of given key.

Parameters:
hkey Handle to already opened registry key. This can be key opened either with OpenRegistryKey function or it can be one of HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS.
result Reference to the vector of string which will receive names of sub keys of given key. All data contained in vector before executing this function will be erased.
Returns:
true on success, false otherwise.

bool hwdet::EnumerateValues ( const HKEY  hkey,
std::vector< String > &  result 
)

Build list of all values of specified key.

Get list of names of all values of specified key.

Parameters:
hkey Handle to already opened registry key. This can be key opened either with OpenRegistryKey function or it can be one of HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS.
result Reference to the vector which receives names of values of specified key. All data contained in vector prior executing this function will be removed.
Returns:
true on success, false otherwise.

String hwdet::RegistryValueToString ( BYTE *  data,
DWORD  type,
DWORD  dataLength 
)

Convert array of BYTEs to the string based on the type of data contained in array.

Parameters:
data Pointer to block of memory which contains data returned by registry data query functions.
type Type of the data in the array. Following types are supported: REG_BINARY, REG_DWORD, REG_EXPAND_SZ, REG_MULTI_SZ, REG_NONE, REG_QWORD, REG_SZ.
dataLength Length of the memory block with the data.
Returns:
String representation of the buffer. REG_SZ, REG_EXPAND, REG_DWORD, REG_QWORD values are converted to strings directly. No expansion of env. variables is done for REG_EXPAND values. REG_BINARY values are converted to the string containing hexadecimal represantation of each byte. REG_MULTI_SZ variables are converted to one long string with each sub-string on the separate line. Note that buffer containing REG_MULTI_SZ value is modified during execution of the function.

bool hwdet::GetSubKeyValueMap ( const HKEY  hkey,
const String subKeyName,
std::map< String, String > &  result 
)

Build map containing all values of specified key as strings.

Build map containing all values of sub key of given key. Sort key of resulting map is value name.

Parameters:
hkey Handle to already opened registry key. This can be key opened either with OpenRegistryKey function or it can be one of HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS.
subKeyName Name of sub-key to retrieve values from.
result Reference to map which will receive names and data for all values in the specified key. Format of the data string for specific value depends on the type of data stored in value. REG_SZ, REG_EXPAND, REG_DWORD, REG_QWORD values are converted to strings directly. No expansion of environment variables is done for REG_EXPAND values. REG_BINARY values are converted to the string containing hexadecimal represantation of each byte. REG_MULTI_SZ variables are converted to one long string with each sub-string on the separate line. All data contained in map prior executing this function will be erased.
Returns:
true on success, false otherwise.

bool hwdet::GetValueAsString ( const HKEY  hkey,
const String valueName,
String result 
)

Get specified value as a string.

Get specified value and convert it to string.

Parameters:
hkey Handle to already opened registry key. This can be key opened either with OpenRegistryKey function or it can be one of HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS.
valueName Name of value to retrieve.
result Reference to string variable which receives requested value. Format of the result depends on the type of data stored in value. REG_SZ, REG_EXPAND, REG_DWORD, REG_QWORD values are converted to strings directly. No expansion of env. variables is done for REG_EXPAND values. REG_BINARY values are converted to the string containing hexadecimal represantation of each byte. REG_MULTI_SZ variables are converted to one long string with each sub-string on the separate line.
Returns:
true on success, false otherwise.

String hwdet::LeadToN ( int  number,
size_t  length = 2,
Char  lead_char = TXT('0') 
)

Convert number to string with specified length.

Convert number to string and add leading characters so that resulting string has at least given length.

Parameters:
number Number to convert.
length Requested length of resulting string. If number has more digits than requested length, no characters are added.
lead_char Character which should be added to the begining of the string.
Returns:
String with converted number.

String hwdet::VariantToString ( const VARIANT &  var  ) 

Convert variant to string.

Convert value stored in variant to string representation.

Parameters:
var Variant to convert
Returns:
Textual representation of variant value. Returns "unknown" when variant is empty or value is undefined or has unsupported type
Note:
It does not support date, time, array types.

unsigned __int64 hwdet::VariantToUInt ( const VARIANT &  var  ) 

Convert variant to 64-bit unsigned int.

Converts variant to 64 bit unsigned integer. Floating point values are not rounded, just integer part is returned. For string variants it will try to convert it using _atoi64()

Parameters:
var Variant to convert.
Returns:
Integer representation of value in variant. 0 if variant was empty or contained undefined value or value with unsupported type or error occured during conversion from string variants.
Note:
Function does not support date/time/array variants.

CheckedResult< String > hwdet::GetValueAsString ( IWbemClassObject *  object,
const LPCWSTR  property_name 
)

Retrieve value as string.

Get value of property with given name and convert it to string. All types values stored in VARIANTs can be converted to string.

Parameters:
object Object from which value should be retrieved.
property_name Name of property.
Returns:
CheckedResult class containing requested value converted to string and report about operation success/failure.

CheckedResult< unsigned __int64 > hwdet::GetValueAsUInt ( IWbemClassObject *  object,
const LPCWSTR  property_name 
)

Retrieve value as integer.

Get value of property with given name and convert it to integer. This method will attempt to convert all value types to int, but for strings it should not be used.

Parameters:
object Object from which property value should be retrieved.
property_name Name of property.
Returns:
CheckedResult class containing requested value converted to unsigned 64 bit integer and report about operation success/failure.

template<typename T>
String hwdet::ConvertToXMLString ( const T &  value  )  [inline]

Convert given value to the string.

Parameters:
value Value to convert.
Returns:
String representing given value.

String hwdet::ConvertToXMLString ( const String value  )  [inline]

Convert string to XML-friendly version (all special chars are escaped).

Parameters:
value String to convert.
Returns:
XML-friendly version of the input string.


Variable Documentation

std::ostream& hwdet::Cout = std::cout

ACSII standard output stream.

std::ostream& hwdet::Cerr = std::cerr

ASCII standard input stream.

std::istream& hwdet::Cin = std::cin

ASCII standard input stream.

std::ostream& hwdet::Cout

ACSII standard output stream.

std::ostream& hwdet::Cerr

ASCII standard input stream.

std::istream& hwdet::Cin

ASCII standard input stream.

const Char hwdet::DefaultEncoding[] = TXT("US-ASCII")

Default encoding of the output.


Generated on Tue Dec 19 17:43:52 2006 for Detector for Windows by  doxygen 1.4.7