Initialize all members.
This commit is contained in:
parent
f8978538f0
commit
39fd50c4dd
1 changed files with 6 additions and 4 deletions
|
@ -37,15 +37,17 @@ namespace schema_validation{
|
|||
* @end{parent}{name="wml_schema/tag/"}
|
||||
*/
|
||||
|
||||
class_key::class_key(const config & cfg){
|
||||
name_ = cfg["name"].str();
|
||||
type_ = cfg["type"].str();
|
||||
class_key::class_key(const config & cfg)
|
||||
: name_(cfg["name"].str())
|
||||
, type_(cfg["type"].str())
|
||||
, default_()
|
||||
, mandatory_(false)
|
||||
{
|
||||
if (cfg.has_attribute("mandatory")){
|
||||
mandatory_ = cfg["mandatory"].to_bool();
|
||||
}else{
|
||||
if (cfg.has_attribute("default")){
|
||||
default_= cfg["default"].str();
|
||||
mandatory_ = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue