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