mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +00:00
a bit of documentation for the DataDefinition class
git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@518 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
@@ -7,6 +7,12 @@
|
|||||||
|
|
||||||
namespace isc { namespace data {
|
namespace isc { namespace data {
|
||||||
|
|
||||||
|
///
|
||||||
|
/// A standard DataDefinition exception that is thrown when a
|
||||||
|
/// .spec file could not be parsed.
|
||||||
|
///
|
||||||
|
/// TODO: use jinmei's exception class as a base and not c_str in
|
||||||
|
/// what() there
|
||||||
class DataDefinitionError : public std::exception {
|
class DataDefinitionError : public std::exception {
|
||||||
public:
|
public:
|
||||||
DataDefinitionError(std::string m = "Data definition is invalid") : msg(m) {}
|
DataDefinitionError(std::string m = "Data definition is invalid") : msg(m) {}
|
||||||
@@ -16,9 +22,19 @@ namespace isc { namespace data {
|
|||||||
std::string msg;
|
std::string msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
/// The \c DataDefinition class holds a data specification.
|
||||||
|
/// Each module should have a .spec file containing the specification
|
||||||
|
/// for configuration and commands for that module.
|
||||||
|
/// This class holds that specification, and provides a function to
|
||||||
|
/// validate a set of data, to see whether it conforms to the given
|
||||||
|
/// specification
|
||||||
class DataDefinition {
|
class DataDefinition {
|
||||||
public:
|
public:
|
||||||
explicit DataDefinition() {};
|
explicit DataDefinition() {};
|
||||||
|
/// Create a \c DataDefinition instance with the given data as
|
||||||
|
/// the specification
|
||||||
|
/// \param e The Element containing the data specification
|
||||||
explicit DataDefinition(ElementPtr e) : definition(e) {};
|
explicit DataDefinition(ElementPtr e) : definition(e) {};
|
||||||
// todo: make check default false, or leave out option completely and always check?
|
// todo: make check default false, or leave out option completely and always check?
|
||||||
explicit DataDefinition(std::istream& in, const bool check = true)
|
explicit DataDefinition(std::istream& in, const bool check = true)
|
||||||
|
Reference in New Issue
Block a user