/*
 * @require jade.js
 */
jade.Config=function(a,b){if(b){this.prefix=b}this.values=a?a:{}
};jade.Config.prototype.prefix=null;jade.Config.prototype.values=null;jade.Config.prototype.getAbsoluteKey=function(a){if(a==null){throw new Error("key must be set")
}a=a.toString();if(this.prefix){a=this.prefix+"."+a}return a};jade.Config.prototype.getValue=function(b,a){var c;
c=this.values[this.getAbsoluteKey(b)];if(c==null){c=a}if(c==null){throw new Error("No value found for config key "+b)
}return c};jade.Config.prototype.getInt=function(b,a){var c;c=this.getValue(b,a);
return parseInt(c,10)};jade.Config.prototype.getFloat=function(b,a){var c;c=this.getValue(b,a);
return parseFloat(c)};jade.Config.prototype.getString=function(b,a){var c;c=this.getValue(b,a);
return""+c};jade.Config.prototype.getBoolean=function(b,a){var c;c=this.getValue(b,a);
if((""+c).toLowerCase()=="true"){return true}if(typeof(c)=="string"){return false
}return !!c};jade.Config.prototype.setValue=function(a,b){if(a==null){throw new Error("key must be set")
}this.values[this.getAbsoluteKey(a)]=b};jade.Config.prototype.setValues=function(a){var b,c;
for((b) in a){c=a[b];if(c!=null){this.values[this.getAbsoluteKey(b)]=c}}};jade.Config.prototype.removeValue=function(b){var a,c;
a=this.values;c=this.getAbsoluteKey(b);delete a[c]};jade.Config.prototype.hasValue=function(a){return this.values[this.getAbsoluteKey(a)]!=null
};jade.Config.prototype.getSubConfig=function(a){return new jade.Config(this.values,this.getAbsoluteKey(a))
};jade.Config.prototype.clear=function(){var b,c,a;c=this.prefix?(this.prefix+"."):null;
a=this.values;for((b) in a){if(!c||b.indexOf(c)==0){delete a[(b)]}}};jade.config=new jade.Config();
