#include <SmbiosXmlImpl_xerces.h>
Inheritance diagram for SmbiosItemXml:
Public Types | |
enum | { FIELD_LEN_BYTE = 1, FIELD_LEN_WORD = 2, FIELD_LEN_DWORD = 4, FIELD_LEN_QWORD = 8 } |
Public Member Functions | |
SmbiosItemXml (const SmbiosItem &source) | |
SmbiosItemXml (const smbiosLowlevel::smbios_structure_header *header=0) | |
virtual std::ostream & | streamify (std::ostream &cout) const |
void | setXmlFilePath (const std::string newFile, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc) |
virtual u8 | getU8 (const std::string field) const |
virtual u16 | getU16 (const std::string field) const |
virtual u32 | getU32 (const std::string field) const |
virtual u64 | getU64 (const std::string field) const |
virtual u32 | getBitfield (const std::string field, const std::string bitField) const |
virtual const char * | getString (const std::string field) const |
virtual std::auto_ptr< const ISmbiosItem > | clone () const |
virtual std::auto_ptr< ISmbiosItem > | clone () |
u8 | getType () const |
u8 | getLength () const |
u16 | getHandle () const |
virtual u8 | getU8 (unsigned int offset) const |
virtual u16 | getU16 (unsigned int offset) const |
virtual u32 | getU32 (unsigned int offset) const |
virtual u64 | getU64 (unsigned int offset) const |
virtual u32 | getBitfield (unsigned int offset, unsigned int fieldLen, unsigned int lsb, unsigned int msb) const |
virtual const char * | getString (unsigned int header_offset) const |
virtual const u8 * | getBufferCopy (size_t &length) const |
virtual const size_t | getBufferSize () const |
Returns the buffer size of the item. | |
virtual void | fixup (const SmbiosWorkaroundTable *workaround) const |
virtual const char * | getStringByStringNumber (u8) const |
Protected Member Functions | |
std::string | getTypeAsString () const |
Protected Attributes | |
std::string | xmlFile |
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | doc |
const smbiosLowlevel::smbios_structure_header * | header |
size_t | header_size |
Definition at line 34 of file SmbiosXmlImpl_xerces.h.
|
|
|
Definition at line 37 of file SmbiosXmlImpl_xerces.h. |
|
Definition at line 41 of file SmbiosXmlImpl_xerces.h. |
|
Implements ISmbiosItem. Definition at line 201 of file SmbiosItem.cpp. References SmbiosItem::SmbiosItem(). |
|
Implements ISmbiosItem. Definition at line 196 of file SmbiosItem.cpp. References SmbiosItem::SmbiosItem(). |
|
Definition at line 385 of file SmbiosItem.cpp. References SmbiosWorkaroundTable::fixupItem(), SmbiosItem::header, and SmbiosItem::header_size. |
|
Returns the bitfield specified by the offset into the item.
<FIELD offset="12h" name="BIOS Characteristics Extension Byte 1" length="BYTE" usage="BITFIELD"> <MAPPING> <BITS lsb="0" name="ACPI supported"/> <BITS lsb="1" name="USB Legacy is supported"/> <BITS lsb="2" name="AGP is supported"/> <BITS lsb="3" name="I20 boot is supported"/> <BITS lsb="4" name="LS-120 boot is supported"/> <BITS lsb="5" name="ATAPI ZIP Drive boot is supported"/> <BITS lsb="6" name="1394 boot is supported"/> <BITS lsb="7" name="Smart Battery is supported"/> </MAPPING> </FIELD> In this example, a call to getBitfield with an lsb of 2 and no msb would return the value of the "AGP is supported" bit as the lowest bit of the u32 return value. Implements ISmbiosItem. Definition at line 318 of file SmbiosItem.cpp. References smbios::checkItemBounds(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length. |
|
Returns the bitfield denoted by bitField. Caller must be aware of the size of the bitfield. Bitfield will be returned in the lowest bits of the u32 return value.
Reimplemented from SmbiosItem. |
|
Implements ISmbiosItem. Definition at line 371 of file SmbiosItem.cpp. References SmbiosItem::header, and SmbiosItem::header_size. |
|
Returns the buffer size of the item.
Implements ISmbiosItem. Definition at line 380 of file SmbiosItem.cpp. References SmbiosItem::header_size. |
|
Returns the Handle field of the SMBIOS Item. This field is standard for all SMBIOS tables and is defined in the SMBIOS standard.
Implements ISmbiosItem. Definition at line 216 of file SmbiosItem.cpp. References smbios_structure_header::handle, and SmbiosItem::header. |
|
Returns the Length field of the SMBIOS Item. This field is standard for all SMBIOS tables and is defined in the SMBIOS standard.
Implements ISmbiosItem. Definition at line 211 of file SmbiosItem.cpp. References SmbiosItem::header, and smbios_structure_header::length. Referenced by SmbiosItem::getString(). |
|
Returns the string at header_offset. Offset is given as the field value for that particular string. The string should almost always be retrieved with the getString(const std::string field) method instead.
Implements ISmbiosItem. Definition at line 174 of file SmbiosItem.cpp. References _, SmbiosItem::getLength(), SmbiosItem::getStringByStringNumber(), and SmbiosItem::header. |
|
XML Enhanced access to string fields. Returns the string for the field field. Field must be of length "BYTE" and of usage "STRING". Type is checked against XML file. Other than that, this method is identical to getString(unsigned int):
Reimplemented from SmbiosItem. |
|
Not likely to be useful to regular client code. It is public mainly to help in writing Unit Tests. Clients should normally use getString(). Implements ISmbiosItem. Definition at line 116 of file SmbiosItem.cpp. References _, smbios::force_u64_to_u32(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length. Referenced by SmbiosItem::getString(). |
|
Returns the Type field of the SMBIOS Item. This field is standard for all SMBIOS tables and is defined in the SMBIOS standard.
Implements ISmbiosItem. Definition at line 206 of file SmbiosItem.cpp. References SmbiosItem::header, and smbios_structure_header::type. Referenced by SmbiosItemXml::streamify(). |
|
|
|
Set of accessor functions: getU8(), getU16(), getU32(), and getU64() Returns a (byte|word|dword|qword) field from the Item. The offset specified is an int representing the a valid offset within the table. Method will return a u8/u16/u32/u64 (depending on function called). These methods all check the offset parameter for out of bounds conditions. They will throw exceptions on attempts to access data outside the length of the present item.
Implements ISmbiosItem. Definition at line 282 of file SmbiosItem.cpp. References smbios::checkItemBounds(), smbios::getData(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length. |
|
Returns a byte field from the Item. This function takes a string that represents a FIELD element from the smbios XML definition. The implementation will look up the offset in XML and call getU8( int ) with the correct offset. The implementation will also validate in the XML that the FIELD is actually of length U8, and will throw an exception if the data field is the wrong length Sample XML: <STRUCTURE type="2" description="Base Board Information"> <FIELD offset="0h" name="Type" length="BYTE" usage="STRUCTURE_TYPE"/> <FIELD offset="1h" name="Length" length="BYTE" usage="SIZE"/> <FIELD offset="2h" name="Handle" length="WORD" usage="HANDLE"/> <FIELD offset="4h" name="Manufacturer" length="BYTE" usage="STRING"/> <FIELD offset="5h" name="Product" length="BYTE" usage="STRING"/> <FIELD offset="6h" name="Version" length="BYTE" usage="STRING"/> <FIELD offset="7h" name="Serial Number" length="BYTE" usage="STRING"/> </STRUCTURE>
Reimplemented from SmbiosItem. |
|
Set of accessor functions: getU8(), getU16(), getU32(), and getU64() Returns a (byte|word|dword|qword) field from the Item. The offset specified is an int representing the a valid offset within the table. Method will return a u8/u16/u32/u64 (depending on function called). These methods all check the offset parameter for out of bounds conditions. They will throw exceptions on attempts to access data outside the length of the present item.
Implements ISmbiosItem. Definition at line 291 of file SmbiosItem.cpp. References smbios::checkItemBounds(), smbios::getData(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length. |
|
Returns a byte field from the Item. This function takes a string that represents a FIELD element from the smbios XML definition. The implementation will look up the offset in XML and call getU8( int ) with the correct offset. The implementation will also validate in the XML that the FIELD is actually of length U8, and will throw an exception if the data field is the wrong length Sample XML: <STRUCTURE type="2" description="Base Board Information"> <FIELD offset="0h" name="Type" length="BYTE" usage="STRUCTURE_TYPE"/> <FIELD offset="1h" name="Length" length="BYTE" usage="SIZE"/> <FIELD offset="2h" name="Handle" length="WORD" usage="HANDLE"/> <FIELD offset="4h" name="Manufacturer" length="BYTE" usage="STRING"/> <FIELD offset="5h" name="Product" length="BYTE" usage="STRING"/> <FIELD offset="6h" name="Version" length="BYTE" usage="STRING"/> <FIELD offset="7h" name="Serial Number" length="BYTE" usage="STRING"/> </STRUCTURE>
Reimplemented from SmbiosItem. |
|
Set of accessor functions: getU8(), getU16(), getU32(), and getU64() Returns a (byte|word|dword|qword) field from the Item. The offset specified is an int representing the a valid offset within the table. Method will return a u8/u16/u32/u64 (depending on function called). These methods all check the offset parameter for out of bounds conditions. They will throw exceptions on attempts to access data outside the length of the present item.
Implements ISmbiosItem. Definition at line 299 of file SmbiosItem.cpp. References smbios::checkItemBounds(), smbios::getData(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length. |
|
Returns a byte field from the Item. This function takes a string that represents a FIELD element from the smbios XML definition. The implementation will look up the offset in XML and call getU8( int ) with the correct offset. The implementation will also validate in the XML that the FIELD is actually of length U8, and will throw an exception if the data field is the wrong length Sample XML: <STRUCTURE type="2" description="Base Board Information"> <FIELD offset="0h" name="Type" length="BYTE" usage="STRUCTURE_TYPE"/> <FIELD offset="1h" name="Length" length="BYTE" usage="SIZE"/> <FIELD offset="2h" name="Handle" length="WORD" usage="HANDLE"/> <FIELD offset="4h" name="Manufacturer" length="BYTE" usage="STRING"/> <FIELD offset="5h" name="Product" length="BYTE" usage="STRING"/> <FIELD offset="6h" name="Version" length="BYTE" usage="STRING"/> <FIELD offset="7h" name="Serial Number" length="BYTE" usage="STRING"/> </STRUCTURE>
Reimplemented from SmbiosItem. |
|
Set of accessor functions: getU8(), getU16(), getU32(), and getU64() Returns a (byte|word|dword|qword) field from the Item. The offset specified is an int representing the a valid offset within the table. Method will return a u8/u16/u32/u64 (depending on function called). These methods all check the offset parameter for out of bounds conditions. They will throw exceptions on attempts to access data outside the length of the present item.
Implements ISmbiosItem. Definition at line 275 of file SmbiosItem.cpp. References smbios::checkItemBounds(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length. |
|
Returns a byte field from the Item. This function takes a string that represents a FIELD element from the smbios XML definition. The implementation will look up the offset in XML and call getU8( int ) with the correct offset. The implementation will also validate in the XML that the FIELD is actually of length U8, and will throw an exception if the data field is the wrong length Sample XML: <STRUCTURE type="2" description="Base Board Information"> <FIELD offset="0h" name="Type" length="BYTE" usage="STRUCTURE_TYPE"/> <FIELD offset="1h" name="Length" length="BYTE" usage="SIZE"/> <FIELD offset="2h" name="Handle" length="WORD" usage="HANDLE"/> <FIELD offset="4h" name="Manufacturer" length="BYTE" usage="STRING"/> <FIELD offset="5h" name="Product" length="BYTE" usage="STRING"/> <FIELD offset="6h" name="Version" length="BYTE" usage="STRING"/> <FIELD offset="7h" name="Serial Number" length="BYTE" usage="STRING"/> </STRUCTURE>
Reimplemented from SmbiosItem. |
|
Definition at line 357 of file SmbiosXml_xerces.cpp. References SmbiosItemXml::doc, and SmbiosItemXml::xmlFile. |
|
Used by 'stdostream &smbios::operator <<( std::ostream &, ISmbiosItem&)' to print out the item info. Not particularly useful for clients. Use operator<< instead. Reimplemented from SmbiosItem. Definition at line 522 of file SmbiosXml_xerces.cpp. References SmbiosItemXml::doc, xmlutils::findElement(), xmlutils::findElementWithNumericAttr(), smbios::getStringForType(), SmbiosItem::getType(), SmbiosItem::header, smbios::printStructureField(), xmlutils::safeGetAttribute(), SmbiosItem::streamify(), and X. |
|
Definition at line 66 of file SmbiosXmlImpl_xerces.h. Referenced by SmbiosItemXml::setXmlFilePath(), and SmbiosItemXml::streamify(). |
|
|
Definition at line 212 of file SmbiosImpl.h. Referenced by SmbiosItem::fixup(), SmbiosItem::getBitfield(), SmbiosItem::getBufferCopy(), SmbiosItem::getBufferSize(), SmbiosItem::getStringByStringNumber(), SmbiosItem::getU16(), SmbiosItem::getU32(), SmbiosItem::getU64(), SmbiosItem::getU8(), and SmbiosItem::SmbiosItem(). |
|
Definition at line 65 of file SmbiosXmlImpl_xerces.h. Referenced by SmbiosItemXml::setXmlFilePath(). |