// SetBool stores the key/value pair to the default section of this INI,
// creating it if it wasn't already present.
555719
func (ini *INI) SetBool(key string, value bool) {
    ini.SectionSetBool(DefaultSection, key, value)
}
613922
func (s *stack) PopBool() (bool, error) {
	so, err := s.PopByteArray()
	if err != nil {
		return false, err
	}

	return asBool(so), nil
}
8325
func ToBool(s string) (b bool) {
	if len(s) == 0 {
		log.Fatal("ERROR: variable empty, cannot convert to boolean")
	}
	switch s {
	case "false":
		b = false
	case "true":
		b = true
	}
	return b
}
877281
func (d Data) GetBool(key string) bool {
	if !d.KeyExists(key) || len(d.Values[key]) == 0 {
		return false
	}
	str := d.Get(key)
	if result, err := strconv.ParseBool(str); err != nil {
		panic(err)
	} else {
		return result
	}
}
674570
func ParseBool(b string) *bool {
	var truth bool
	switch b {
	case "enabled":
		truth = true
	case "disabled":
		truth = false
	default:
		return nil
	}
	return &truth
}
702606
func (me *DefaultAdapter) LiteralBool(buf *SqlBuilder, b bool) error {
	if buf.IsPrepared {
		return me.PlaceHolderSql(buf, b)
	}
	if b {
		buf.Write(me.True)
	} else {
		buf.Write(me.False)
	}
	return nil
}
915682
func IsBoolOptionSet(options map[string]string, key string) bool {
	if options != nil {
		if value, ok := options[key]; ok {
			if b, err := strconv.ParseBool(value); err == nil {
				return b
			}
		}
	}

	return false
}
864525
func setBoolVal(field bool, ctx runtimeFlagsContext, flagName string, inverse ...bool) bool {
	// check to see if a value was set (either on the command-line or via the associated
	// environment variable, if any); if so, use that as value for the input field
	val := ctx.Bool(flagName)
	if ctx.IsSet(flagName) || val {
		field = val
		if len(inverse) > 0 {
			field = !field
		}
	}
	return field
}
849590
func ToBool(in interface{}) (bool, error) {
	switch val := in.(type) {
	case string:
		sval, err := strconv.ParseBool(val)
		if err != nil {
			return false, ErrBadType
		}
		return sval, nil
	default:
		value, err := cast.ToBoolE(val)
		if err != nil {
			return false, ErrBadType
		}
		return value, nil
	}
}
468792
func DefaultBool(obj interface{}, defaultValue bool) bool {
	returnValue, ok := obj.(bool)
	if ok {
		return returnValue
	}

	returnValue, err := strconv.ParseBool(fmt.Sprint(obj))
	if err != nil {
		return defaultValue
	}

	return returnValue
}
393141
func (c *ConfigFile) SetValue(section, key, value string) bool {
	// Blank section name represents DEFAULT section.
	if len(section) == 0 {
		section = DEFAULT_SECTION
	}
	if len(key) == 0 {
		return false
	}

	if c.BlockMode {
		c.lock.Lock()
		defer c.lock.Unlock()
	}

	// Check if section exists.
	if _, ok := c.data[section]; !ok {
		// Execute add operation.
		c.data[section] = make(map[string]string)
		// Append section to list.
		c.sectionList = append(c.sectionList, section)
	}

	// Check if key exists.
	_, ok := c.data[section][key]
	c.data[section][key] = value
	if !ok {
		// If not exists, append to key list.
		c.keyList[section] = append(c.keyList[section], key)
	}
	return !ok
}
485982
func (k *Key) MustBool(defaultVal ...bool) bool {
	val, err := k.Bool()
	if len(defaultVal) > 0 && err != nil {
		k.value = strconv.FormatBool(defaultVal[0])
		return defaultVal[0]
	}
	return val
}
1302036
func ParseBool(value string, defaultValue bool) (bool, error) {
	value = strings.ToLower(strings.Trim(value, " "))
	if value == "" {
		return defaultValue, nil
	}

	return strconv.ParseBool(value)
}
645095
func NewValueBool(v bool) Value {
	n := uint64(0)
	if v {
		n = 1
	}
	return Value{
		typ:     TBool,
		tnumber: n,
	}
}
824135
func (c *IniConfigContainer) Bool(key string) (bool, error) {
	return ParseBool(c.getdata(key))
}
253896
func (s Sparse) SetBool(i int, b bool) {
	if b {
		s.Set(i)
		return
	}
	s.Unset(i)
}
1172717
func (enc *Encoder) WriteBool(val bool) error {
	if val {
		return enc.writeUnsigned(1)
	}
	return enc.writeUnsigned(0)
}