// MustBool returns request form as bool with default
8257
func (p *Params) MustBool(key string, defaults ...bool) bool {
	r, err := strconv.ParseBool(p.Get(key))
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return r
}
1013496
func optionalBool(arg []bool, defaultValue bool) bool {
	if len(arg) == 0 {
		return defaultValue
	}
	return arg[0]
}
625353
func (c *ConfigParser) Getbool(section, option string) (val bool, err error) {
	sv, err := c.Get(section, option)
	if err != nil {
		return val, err
	}

	val, ok := booleanStates[strings.ToLower(sv)]
	if !ok {
		return val, errors.New(fmt.Sprintf("No boolean: %s", sv))
	}

	return val, err
}
94643
func (ctx *Context) ParamBool(key string, defaults ...bool) bool {
	return ctx.Params().MustBool(key, defaults...)
}
217493
func (v *Value) ToBool() (val bool, ok bool) {
	switch v.vType {
	case typeBool:
		return v.value.(bool), true
	}
	return false, false
}
814317
func (node *Node) GetBool(key string) bool {
	b, _ := strconv.ParseBool(node.Values.Get(key))
	return b
}
1069314
func (ns *Namespace) ModBool(a, b interface{}) (bool, error) {
	res, err := ns.Mod(a, b)
	if err != nil {
		return false, err
	}

	return res == int64(0), nil
}
230571
func queryBool(q url.Values, key string) bool {
	if _, ok := q[key]; !ok {
		return false
	}

	return q.Get(key) != "false"
}
644037
func NewBool(into *bool, v bool) *BoolValue {
	*into = v
	return (*BoolValue)(into)
}
715447
func (c *IniConfigContainer) DefaultBool(key string, defaultval bool) bool {
	v, err := c.Bool(key)
	if err != nil {
		return defaultval
	}
	return v
}
613922
func (s *stack) PopBool() (bool, error) {
	so, err := s.PopByteArray()
	if err != nil {
		return false, err
	}

	return asBool(so), nil
}
1137547
func (c *SQLiteContext) ResultBool(b bool) {
	if b {
		c.ResultInt(1)
	} else {
		c.ResultInt(0)
	}
}
948885
func (env *Env) GetBool(key string) (value bool) {
	s := strings.ToLower(strings.Trim(env.Get(key), " \t"))
	if s == "" || s == "0" || s == "no" || s == "false" || s == "none" {
		return false
	}
	return true
}
56054
func (d *defaulter) AsBool(v Valuer, dv bool) bool {
	value, err := v.Value()
	if err != nil {
		d.logValuerError(err)
		return dv
	}
	bvalue, err := strconv.ParseBool(value)
	if err != nil {
		d.logFormatError("bool", err)
		return dv
	}
	return bvalue
}
1247583
func GetBool(key string, defaultValue bool) bool {
	b, err := factory.GetValue(key).ToBool()
	if err != nil {
		return defaultValue
	}
	return b
}
518869
func (ctx *Context) FormBool(key string, defaults ...bool) bool {
	return (*Forms)(ctx.req).MustBool(key, defaults...)
}
841099
func (c *ConfigFile) MustBool(section, key string, defaultVal ...bool) bool {
	val, err := c.Bool(section, key)
	if len(defaultVal) > 0 && err != nil {
		return defaultVal[0]
	}
	return val
}