Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ISmbiosXml.h

Go to the documentation of this file.
00001 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
00002 /*
00003  * Copyright (C) 2005 Dell Inc.
00004  *  by Michael Brown <Michael_E_Brown@dell.com>
00005  * Licensed under the Open Software License version 2.1 
00006  * 
00007  * Alternatively, you can redistribute it and/or modify 
00008  * it under the terms of the GNU General Public License as published 
00009  * by the Free Software Foundation; either version 2 of the License, 
00010  * or (at your option) any later version.
00011 
00012  * This program is distributed in the hope that it will be useful, but 
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of 
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
00015  * See the GNU General Public License for more details.
00016  */
00017 
00018 
00019 #ifndef ISMBIOSXML_H
00020 #define ISMBIOSXML_H
00021 
00022 // make this define so that the automatic linking stuff
00023 // does its magic
00024 #define LIBSMBIOS_NEED_SMBIOSXML
00025 
00026 // compat header should always be first header
00027 #include "smbios/compat.h"
00028 
00029 #include "smbios/ISmbios.h"
00030 
00031 // abi_prefix should be last header included before declarations
00032 #include "smbios/config/abi_prefix.hpp"
00033 
00034 namespace smbios
00035 {
00036     class SmbiosXmlFactory: public virtual SmbiosFactory
00037     {
00038     public:
00039         static SmbiosFactory *getFactory();
00040         virtual ~SmbiosXmlFactory() throw();
00041     };
00042 
00043     template <class R> 
00044     R &getData(const ISmbiosItem &item, const std::string field, R &out)
00045     {
00046         getData_FromItem(field, &out, sizeof(R));
00047         return out;
00048     }
00049 
00050     u8 getU8_FromItem(const ISmbiosItem &item, std::string field);
00051     u16 getU16_FromItem(const ISmbiosItem &item, std::string field);
00052     u32 getU32_FromItem(const ISmbiosItem &item, std::string field);
00053     u64 getU64_FromItem(const ISmbiosItem &item, std::string field);
00054     const char *getString_FromItem(const ISmbiosItem &item, std::string field);
00055     void *getBits_FromItem(const ISmbiosItem &item, std::string field, std::string bitField, void *out);
00056 
00057     // helper... not really convenient to use directly
00058     void getData_FromItem(std::string field, void *out, size_t sz);
00059 
00060     // not implemented yet.
00061     std::ostream & toXmlString(const ISmbiosTable &, std::ostream &);
00062 }
00063 
00064 // always should be last thing in header file
00065 #include "smbios/config/abi_suffix.hpp"
00066 
00067 #endif /* ISMBIOSXML_H */
00068 

Generated on Wed Apr 11 16:25:10 2007 for SMBIOS Library by doxygen 1.3.5