// NewStringValue takes any interface and returns Value.
332238
func NewStringValue(v interface{}) Value {
	switch t := v.(type) {
	case string:
		return String(t)
	case []byte:
		return String(t)
	case bool:
		return String(fmt.Sprintf("%v", t))
	case int:
		return String(strconv.FormatInt(int64(t), 10))
	case int8:
		return String(strconv.FormatInt(int64(t), 10))
	case int16:
		return String(strconv.FormatInt(int64(t), 10))
	case int32:
		return String(strconv.FormatInt(int64(t), 10))
	case int64:
		return String(strconv.FormatInt(t, 10))
	case uint:
		return String(strconv.FormatUint(uint64(t), 10))
	case uint8: // byte is an alias for uint8
		return String(strconv.FormatUint(uint64(t), 10))
	case uint16:
		return String(strconv.FormatUint(uint64(t), 10))
	case uint32:
		return String(strconv.FormatUint(uint64(t), 10))
	case float32:
		return String(strconv.FormatFloat(float64(t), 'f', -1, 64))
	case float64:
		return String(strconv.FormatFloat(t, 'f', -1, 64))
	case time.Time:
		return String(t.String())
	case time.Duration:
		return String(t.String())
	default:
		panic(fmt.Errorf("%v(%T) is not supported yet", v, v))
	}
}
21718
func NewString(name string) *String {
	v := new(String)
	Publish(name, v)
	return v
}
367765
func ValueFromString(vt string) ValueType {
	switch vt {
	case "nil", "null":
		return NilType
	case "error":
		return ErrorType
	case "unknown":
		return UnknownType
	case "value":
		return ValueInterfaceType
	case "number":
		return NumberType
	case "int":
		return IntType
	case "bool":
		return BoolType
	case "time":
		return TimeType
	case "[]byte":
		return ByteSliceType
	case "string":
		return StringType
	case "[]string":
		return StringsType
	case "map[string]value":
		return MapValueType
	case "map[string]int":
		return MapIntType
	case "map[string]string":
		return MapStringType
	case "map[string]number":
		return MapNumberType
	case "map[string]bool":
		return MapBoolType
	case "map[string]time":
		return MapTimeType
	case "[]value":
		return SliceValueType
	case "struct":
		return StructType
	case "json":
		return JsonType
	default:
		return UnknownType
	}
}
724510
func (m *Mrb) StringValue(s string) *MrbValue {
	cs := C.CString(s)
	defer C.free(unsafe.Pointer(cs))
	return newValue(m.state, C.mrb_str_new_cstr(m.state, cs))
}
1204828
func BytesValue(val string) (*wrappers.BytesValue, error) {
	parsedVal, err := Bytes(val)
	return &wrappers.BytesValue{Value: parsedVal}, err
}
780768
func ToValue(v interface{}) Value {
	switch ReflectTypeOf(v) {
	case TIME:
		return NewTimeValue(v)
	default:
		return NewStringValue(v)
	}
}
585513
func NewStringTree(v string, duplicates bool) StringTree {
	return &stringTree{
		container: newNodeContainer(justValue{v}, duplicates),
	}
}
975041
func newStringEqualsFunc(key Key, values ValueSet) (Function, error) {
	valueStrings, err := valuesToStringSlice(stringEquals, values)
	if err != nil {
		return nil, err
	}

	return NewStringEqualsFunc(key, valueStrings...)
}
356841
func newStringLikeFunc(key Key, values ValueSet) (Function, error) {
	valueStrings, err := valuesToStringSlice(stringLike, values)
	if err != nil {
		return nil, err
	}

	return NewStringLikeFunc(key, valueStrings...)
}
1005435
func NewStringFlag(fl cli.StringFlag) *StringFlag {
	return &StringFlag{StringFlag: fl, set: nil}
}
783589
func NewStaticDataValue(name string, data interface{}) *StaticDataSource {
	row := []driver.Value{data}
	ds := NewStaticDataSource(name, 0, [][]driver.Value{row}, []string{name})
	return ds
}
690544
func (b *builtinStringAnyValueSig) evalString(row chunk.Row) (string, bool, error) {
	return b.args[0].EvalString(b.ctx, row)
}
1176188
func StringValue(item interface{}) (value string, ok bool) {
	value, ok = item.(string)
	if ok {
		return value, ok
	}
	intValue, ok := item.(int)
	if ok {
		return strconv.Itoa(intValue), true
	}
	return "", false
}
1217095
func NewStringSlice(val []string, p *[]string) *StringSliceValue {
	*p = val
	return (*StringSliceValue)(p)
}
830208
func (b *recordBuffer) WriteStringValues(s ...string) {
	var t []byte
	t = strconv.AppendQuote(t, strings.Join(s, ` `))
	_, _ = b.Write(t)
	b.writeSpace()
}
370899
func (s *TypedAttributeValue) SetStringValue(v string) *TypedAttributeValue {
	s.StringValue = &v
	return s
}
588088
func NewString(name string, description string, metadata *types.MetricMetadata, fields ...field.Field) String {
	if metadata == nil {
		metadata = &types.MetricMetadata{}
	}
	m := &stringMetric{metric{
		MetricInfo: types.MetricInfo{
			Name:        name,
			Description: description,
			Fields:      fields,
			ValueType:   types.StringType,
		},
		MetricMetadata: *metadata,
	}}
	registry.Add(m)
	return m
}