//
// GetBoolVar returns the value of the variable as boolean
//
353644
func (cmd *Cmd) GetBoolVar(name string) (val bool) {
	sval, _ := cmd.context.GetVar(name)
	val, _ = strconv.ParseBool(sval)
	return
}
634705
func ParseBool(val interface{}) (value bool, err error) {
	if val != nil {
		switch v := val.(type) {
		case bool:
			return v, nil
		case string:
			switch v {
			case "1", "t", "T", "true", "TRUE", "True", "YES", "yes", "Yes", "Y", "y", "ON", "on", "On":
				return true, nil
			case "0", "f", "F", "false", "FALSE", "False", "NO", "no", "No", "N", "n", "OFF", "off", "Off":
				return false, nil
			}
		case int8, int32, int64:
			strV := fmt.Sprintf("%s", v)
			if strV == "1" {
				return true, nil
			} else if strV == "0" {
				return false, nil
			}
		case float64:
			if v == 1 {
				return true, nil
			} else if v == 0 {
				return false, nil
			}
		}
		return false, fmt.Errorf("parsing %q: invalid syntax", val)
	}
	return false, fmt.Errorf("parsing <nil>: invalid syntax")
}
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
}
1204857
func (cmd *CLI) DefineBoolFlagVar(p *bool, name string, value bool, usage string) {
	cmd.DefineFlag(values.NewBool(value, p), name, usage)
}
1234670
func (ctx *Context) GetVar(k string) (string, bool) {
	for i := len(ctx.scopes) - 1; i >= 0; i-- {
		if v, ok := ctx.scopes[i][k]; ok {
			return v, true
		}
	}

	return "", false
}
1049157
func (r *Store) GetBoolDefault(key string, def bool) bool {
	if v, err := r.GetBool(key); err == nil {
		return v
	}

	return def
}
1186348
func (ini *INI) SectionGetBool(section, key string) (bool, bool) {
    v, ok := ini.SectionGet(section, key)
    if ok {
        switch v {
        case "1", "t", "T", "true", "TRUE", "True", "on", "ON", "On", "yes", "YES", "Yes":
            return true, true
        case "0", "f", "F", "false", "FALSE", "False", "off", "OFF", "Off", "no", "NO", "No":
            return false, true
        }
    }

    return false, false
}
1173503
func (e *Expect) Boolean(value bool) *Boolean {
	return NewBoolean(e.config.Reporter, value)
}
808503
func Bool(b bool) NullBool {
	return NullBool{
		sql.NullBool{
			Bool:  b,
			Valid: true,
		},
	}
}
1330152
func (cmd *Cmd) GetVar(k string) (string, bool) {
	return cmd.context.GetVar(k)
}
1334292
func (getter Getter) GetVar(name string) (Value, bool) {
	if getter == nil {
		return nilValue, false
	}
	v, ok := getter[name]
	return v, ok
}
1302036
func ParseBool(value string, defaultValue bool) (bool, error) {
	value = strings.ToLower(strings.Trim(value, " "))
	if value == "" {
		return defaultValue, nil
	}

	return strconv.ParseBool(value)
}
1136099
func (m Metadata) GetBool(key string) (*bool, error) {
	val, ok := m[key]
	if !ok {
		return nil, ErrMetadataNonexistantKey
	}
	if val.Type != MetadataValueTypeBool {
		return nil, ErrMetadataUnexpectedValueType
	}
	out, _ := val.Value.(bool)
	return &out, nil
}
1240259
func (v *Pong) GetBoop() (o string) {
	if v != nil {
		o = v.Boop
	}
	return
}
740666
func (c *Config) ReadBool(id string) (bool, error) {
	val, ok := c.Options[id]
	if !ok {
		return false, fmt.Errorf("Specified config is missing from options")
	}
	bval, err := strconv.ParseBool(val)
	if err != nil {
		return false, fmt.Errorf("Failed to parse %s as bool: %s", val, err)
	}
	return bval, nil
}
514781
func (n *NullBool) ParseBoolValue(val *bool) {
	if val == nil {
		n.IsSet = false
		n.Value = false
		return
	}

	n.Value = *val
	n.IsSet = true
}
426525
func (g *Graph) GetBool(path string) (bool, error) {

	if len(path) == 0 {
		return g.Bool(), nil
	}

	i := g.Get(path)
	if i == nil {
		return false, errors.New("not found")
	}
	if i.Len() == 0 {
		return false, errors.New("Get() design error: not subnodes")
	}
	j, ok := _boolf(i.Out[0].This)
	if !ok {
		return false, errors.New("not a boolean")
	}
	return j, nil
}