// safeAddByteString is no-alloc equivalent of safeAddString(string(s)) for s []byte.
769258
func (enc *ltsvEncoder) safeAddByteString(s []byte) {
	for i := 0; i < len(s); {
		if enc.tryAddRuneSelf(s[i]) {
			i++
			continue
		}
		r, size := utf8.DecodeRune(s[i:])
		if enc.tryAddRuneError(r, size) {
			i++
			continue
		}
		enc.buf.Write(s[i : i+size])
		i += size
	}
}
731784
func (i *ID) DecodeFromString(s string) error {
	return i.Decode([]byte(s))
}
1309712
func safeArrayGetElementString(safearray *SafeArray, index int32) (str string, err error) {
	var element *int16
	err = convertHresultToError(
		procSafeArrayGetElement.Call(
			uintptr(unsafe.Pointer(safearray)),
			uintptr(unsafe.Pointer(&index)),
			uintptr(unsafe.Pointer(&element))))
	str = BstrToString(*(**uint16)(unsafe.Pointer(&element)))
	SysFreeString(element)
	return
}
687251
func StringToBytes(s string) []byte {
	return *(*[]byte)(unsafe.Pointer(
		&struct {
			string
			Cap int
		}{s, len(s)},
	))
}
153853
func (p *Buffer) DecodeStringBytes() (s string, err error) {
	buf, err := p.DecodeRawBytes(false)
	if err != nil {
		return
	}
	return string(buf), nil
}
211943
func safeSort(in []string) []string {
	if sort.StringsAreSorted(in) {
		return in
	}
	out := make([]string, len(in))
	copy(out, in)
	sort.Strings(out)
	return out
}
281532
func SealedDataToString(sealedData SealedData) (string, error) {
	b, err := json.Marshal(sealedData)
	if err != nil {
		return "", err
	}

	return base64.URLEncoding.EncodeToString(b), nil
}
1307173
func (k *PublicKey) AuthorizedString() string {
	return fmt.Sprintf(_TPL_PUBLICK_KEY, setting.AppPath, k.ID, setting.CustomConf, k.Content)
}
878338
func escapedStringToEncodedBytes(escapedString string) (string, error) {
	var buffer bytes.Buffer
	i := 0
	for i < len(escapedString) {
		currentRune, currentWidth := utf8.DecodeRuneInString(escapedString[i:])
		if currentRune == utf8.RuneError {
			return "", NewError(ErrorFilterCompile, fmt.Errorf("ldap: error reading rune at position %d", i))
		}

		// Check for escaped hex characters and convert them to their literal value for transport.
		if currentRune == '\\' {
			// http://tools.ietf.org/search/rfc4515
			// \ (%x5C) is not a valid character unless it is followed by two HEX characters due to not
			// being a member of UTF1SUBSET.
			if i+2 > len(escapedString) {
				return "", NewError(ErrorFilterCompile, errors.New("ldap: missing characters for escape in filter"))
			}
			escByte, decodeErr := hexpac.DecodeString(escapedString[i+1 : i+3])
			if decodeErr != nil {
				return "", NewError(ErrorFilterCompile, errors.New("ldap: invalid characters for escape in filter"))
			}
			buffer.WriteByte(escByte[0])
			i += 2 // +1 from end of loop, so 3 total for \xx.
		} else {
			buffer.WriteRune(currentRune)
		}

		i += currentWidth
	}
	return buffer.String(), nil
}
599838
func (a *API) AttachString(str string) {
	json.Unmarshal([]byte(str), a)

	if !a.initialized {
		a.Setup()
	}
}
479266
func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int32, error) {
	return int32(0), NewError(E_NOTIMPL)
}
909261
func StringByte(s string) []byte {
	sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
	bh := reflect.SliceHeader{
		Data: sh.Data,
		Len:  sh.Len,
		Cap:  sh.Len,
	}
	return *(*[]byte)(unsafe.Pointer(&bh))
}
1309705
func safeArrayDestroyData(safearray *SafeArray) (err error) {
	err = convertHresultToError(procSafeArrayDestroyData.Call(uintptr(unsafe.Pointer(safearray))))
	return
}
876355
func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error {
	return NewError(E_NOTIMPL)
}
1261473
func (f *BloomFilter) AddString(data string) *BloomFilter {
	return f.Add([]byte(data))
}
47392
func (d *Context) SafeToString(index int) string {
	if s := C._duk_safe_to_string(d.duk_context, C.duk_idx_t(index)); s != nil {
		return C.GoString(s)
	}
	return ""
}
191646
func (d *DiskEditValue) AddSSHKeyByString(key string) {
	if d.SSHKeys == nil {
		d.SSHKeys = []*SSHKey{}
	}
	d.SSHKeys = append(d.SSHKeys, &SSHKey{PublicKey: key})
}