1 #ifndef AVR_DEVICESETTINGS_H
2 #define AVR_DEVICESETTINGS_H
11 class ParseException
: public util::Exception
{
13 ParseException() : Exception("Parse Exception") {}
14 ParseException(const char * msg
) : Exception(msg
) {}
15 ParseException(const std::string
& msg
) : Exception(msg
) {}
24 * @brief Helper for reading Hardware modules from XML
26 * The HardwareSettings class allows reading Hardware settings
27 * from the xml file without exposing the xml related
30 class HardwareSettings
{
32 HardwareSettings(XmlHandle
& doc
, _xmlNode
*node
);
35 int intParam(const char *name
, int base
= 10) const;
36 int intParamDef(const char *name
, int def
= 0, int base
= 10) const;
37 std::string
strParam(const char *name
) const;
40 bool getBinding(std::string
& name
, std::string
& binding
);
43 _xmlNode
*findParam(const char *name
, bool required
= true) const;
55 * @brief Reading device settings from xml files
57 * This class allows reading device settings from xml files.
59 class DeviceSettings
{
61 static void listAll(unsigned int lineLength
= 80);
62 static void load(Device
*dev
, const char *devicename
);
65 static void parseMemory(Device
*dev
, _xmlNode
*memory
);
66 static void parseRegisters(Device
*dev
, _xmlNode
*registers
);
67 static void parseInterrupts(Device
*dev
, _xmlNode
*interrupts
);
68 static void parseHardware(Device
*dev
, XmlHandle
& doc
, _xmlNode
*hardware
);
69 static void parsePackages(Device
*dev
, const char *pkgname
, _xmlNode
*hardware
);
70 static void parsePackage(Device
*dev
, _xmlNode
*hardware
);
74 #endif /*AVR_DEVICESETTINGS_H*/