// MinLength will add an error to the Validator if data.Values[field]
// is shorter than length (if data.Values[field] has less than
// length characters), not counting leading or trailing
// whitespace.
542422
func (v *Validator) MinLength(field string, length int) *ValidationResult {
	val := v.data.Get(field)
	trimmed := strings.TrimSpace(val)
	if len(trimmed) < length {
		return v.addMinLengthError(field, length)
	} else {
		return validationOk
	}
}
243494
func (v *EntryBuffer) GetLength() uint {
	panic_if_version_older_auto(2, 18, 0)
	return uint(C._gtk_entry_buffer_get_length(v.GEntryBuffer))
}
1061063
func MinValidator(param string, v reflect.Value) (ValidationResult, error) {
	switch v.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		pInt, err := strconv.ParseInt(param, 0, 64)
		if err != nil {
			return 0, ErrInvalidConfigValue
		}
		if v.Int() < pInt {
			return ValidationNG, nil
		}
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		pUint, err := strconv.ParseUint(param, 0, 64)
		if err != nil {
			return 0, ErrInvalidConfigValue
		}
		if v.Uint() < pUint {
			return ValidationNG, nil
		}
	case reflect.Float32, reflect.Float64:
		pFloat, err := strconv.ParseFloat(param, 64)
		if err != nil {
			return 0, ErrInvalidConfigValue
		}
		if v.Float() < pFloat {
			return ValidationNG, nil
		}
	default:
		return 0, ErrValidateUnsupportedType
	}

	return ValidationOK, nil
}
1248168
func RandomLength(length int, lang string) (string, error) {
	return RandomLengthDelim(length, " ", lang)
}
192570
func (t *ETagConfig) SetMinBodyLength(length int) *ETagConfig {
	t.MinBodyLength = length
	return t
}
804149
func (o *ElapseParams) bindLength(rawData []string, hasKey bool, formats strfmt.Registry) error {
	var raw string
	if len(rawData) > 0 {
		raw = rawData[len(rawData)-1]
	}

	// Required: true
	// Parameter is provided by construction from the route

	value, err := swag.ConvertInt64(raw)
	if err != nil {
		return errors.InvalidType("length", "path", "int64", raw)
	}
	o.Length = value

	if err := o.validateLength(formats); err != nil {
		return err
	}

	return nil
}
1209447
func (g *LineString) Length() float64 {
	return length1(g.flatCoords, 0, len(g.flatCoords), g.stride)
}
1147274
func (s *StringAttributeConstraintsType) SetMinLength(v string) *StringAttributeConstraintsType {
	s.MinLength = &v
	return s
}
668174
func (q *MoreLikeThisQuery) MinWordLength(minWordLength int) *MoreLikeThisQuery {
	q.minWordLength = &minWordLength
	return q
}
917022
func metadataLength(typ byte) int {
	switch typ {
	case TypeDecimal, TypeTiny, TypeShort, TypeLong, TypeNull, TypeTimestamp, TypeLongLong, TypeInt24, TypeDate, TypeTime, TypeDateTime, TypeYear, TypeNewDate:
		// No data here.
		return 0

	case TypeFloat, TypeDouble, TypeTimestamp2, TypeDateTime2, TypeTime2, TypeJSON, TypeTinyBlob, TypeMediumBlob, TypeLongBlob, TypeBlob, TypeGeometry:
		// One byte.
		return 1

	case TypeNewDecimal, TypeEnum, TypeSet, TypeString:
		// Two bytes, Big Endian because of crazy encoding.
		return 2

	case TypeVarchar, TypeBit, TypeVarString:
		// Two bytes, Little Endian
		return 2

	default:
		// Unknown type. This is used in tests only, so panic.
		panic(vterrors.Errorf(vtrpc.Code_INTERNAL, "metadataLength: unhandled data type: %v", typ))
	}
}
479899
func MinStringValid(value string, basekey string, mm messages.MessageMap, min int) error {
	if len(value) < min {
		mm.Add(basekey, InvalidMinLength)
		return nil
	}
	return nil
}
668106
func Minimum(path, in string, data, min float64, exclusive bool) *errors.Validation {
	if (!exclusive && data < min) || (exclusive && data <= min) {
		return errors.ExceedsMinimum(path, in, min, exclusive)
	}
	return nil
}
807039
func KeyLength(key interface{}) int {
	if key == nil {
		return 0
	}
	if ecdsaKey, ok := key.(*ecdsa.PublicKey); ok {
		return ecdsaKey.Curve.Params().BitSize
	} else if rsaKey, ok := key.(*rsa.PublicKey); ok {
		return rsaKey.N.BitLen()
	}

	return 0
}
747892
func (m *Match) matchLength(cap int) int {
	i := m.matches[cap][m.matchcount[cap]*2-1]
	if i >= 0 {
		return i
	}

	return m.matches[cap][-3-i]
}
1231729
func (rd *RAMDirectory) FileLength(name string) (length int64, err error) {
	rd.EnsureOpen()
	rd.fileMapLock.RLock()
	defer rd.fileMapLock.RUnlock()
	if file, ok := rd.fileMap[name]; ok {
		return file.Length(), nil
	}
	return 0, os.ErrNotExist
}
371647
func (o *ElapseParams) validateLength(formats strfmt.Registry) error {

	if err := validate.MinimumInt("length", "path", int64(o.Length), 2, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("length", "path", int64(o.Length), 30, false); err != nil {
		return err
	}

	return nil
}
419956
func (q *MatchQuery) PrefixLength(length int) *MatchQuery {
	q.options["prefix_length"] = length
	return q
}