// StringFromCLSID returns GUID formated string from GUID object.
970147
func StringFromCLSID(clsid *GUID) (str string, err error) {
	var p *uint16
	hr, _, _ := procStringFromCLSID.Call(uintptr(unsafe.Pointer(clsid)), uintptr(unsafe.Pointer(&p)))
	if hr != 0 {
		err = NewError(hr)
	}
	str = LpOleStrToString(p)
	return
}
907140
func (rule *Rule) String() string {
	result := ""

	if rule.Kind == QualifiedRule {
		for i, sel := range rule.Selectors {
			if i != 0 {
				result += ", "
			}
			result += sel
		}
	} else {
		// AtRule
		result += fmt.Sprintf("%s", rule.Name)

		if rule.Prelude != "" {
			if result != "" {
				result += " "
			}
			result += fmt.Sprintf("%s", rule.Prelude)
		}
	}

	if (len(rule.Declarations) == 0) && (len(rule.Rules) == 0) {
		result += ";"
	} else {
		result += " {\n"

		if rule.EmbedsRules() {
			for _, subRule := range rule.Rules {
				result += fmt.Sprintf("%s%s\n", rule.indent(), subRule.String())
			}
		} else {
			for _, decl := range rule.Declarations {
				result += fmt.Sprintf("%s%s\n", rule.indent(), decl.String())
			}
		}

		result += fmt.Sprintf("%s}", rule.indentEndBlock())
	}

	return result
}
1257691
func (d DestinationKeyspaceIDs) String() string {
	var buffer bytes.Buffer
	buffer.WriteString("DestinationKeyspaceIDs(")
	for i, ksid := range d {
		if i > 0 {
			buffer.WriteByte(',')
		}
		buffer.WriteString(hex.EncodeToString(ksid))
	}
	buffer.WriteByte(')')
	return buffer.String()
}
817426
func (u *Unit) ValueFromString(str string) (*Value, error) {
	s := &Value{unit: u}

	if err := s.Set(str); err != nil {
		return nil, err
	}
	return s, nil
}
248483
func (id PluginID) String() string {
	return fmt.Sprintf("%q (%v)", id.Name, id.PluginType)
}
171164
func MaybeFromString(str string) UUID {
	u, err := FromString(str)
	if err != nil {
		return zero
	}

	return u
}
394381
func ClassFromString(s string) (Class, error) {
	switch s {
	case "all":
		return All, nil
	case "success":
		return Success, nil
	case "denial":
		return Denial, nil
	case "error":
		return Error, nil
	}
	return All, fmt.Errorf("invalid Class: %s", s)
}
703256
func StringToGuid(guid string) (res [16]byte, err error) {
	byteOrder := [...]int{3, 2, 1, 0, -1, 5, 4, -1, 7, 6, -1, 8, 9, -1, 10, 11, 12, 13, 14, 15}
	if len(guid) != 36 {
		err = fmt.Errorf("BAD guid string length.")
		return
	}
	guidByteNum := 0
	for i := 0; i < len(guid); i += 2 {
		if byteOrder[guidByteNum] == -1 {
			if guid[i] == '-' {
				i++
				guidByteNum++
				if i >= len(guid)+1 {
					err = fmt.Errorf("BAD guid format minus")
					return
				}
			} else {
				err = fmt.Errorf("BAD guid char in minus pos")
				return
			}
		}

		sub := guid[i : i+2]
		var bt byte
		for pos, ch := range sub {
			var shift uint
			if pos == 0 {
				shift = 4
			} else {
				shift = 0
			}
			switch ch {
			case '0':
				bt |= 0 << shift
			case '1':
				bt |= 1 << shift
			case '2':
				bt |= 2 << shift
			case '3':
				bt |= 3 << shift
			case '4':
				bt |= 4 << shift
			case '5':
				bt |= 5 << shift
			case '6':
				bt |= 6 << shift
			case '7':
				bt |= 7 << shift
			case '8':
				bt |= 8 << shift
			case '9':
				bt |= 9 << shift
			case 'A', 'a':
				bt |= 10 << shift
			case 'B', 'b':
				bt |= 11 << shift
			case 'C', 'c':
				bt |= 12 << shift
			case 'D', 'd':
				bt |= 13 << shift
			case 'E', 'e':
				bt |= 14 << shift
			case 'F', 'f':
				bt |= 15 << shift
			default:
				err = fmt.Errorf("BAD guid char at pos %d: '%c'", i+pos, ch)
				return
			}
		}
		res[byteOrder[guidByteNum]] = bt
		guidByteNum++
	}
	return res, nil
}
693551
func (udh *UDH) String() string {
	return udh.IEI.String() + "," + udh.IELength.String() + "," + udh.IEData.String()
}
1093867
func (intstr *IntOrString) String() string {
	if intstr.Type == String {
		return intstr.StrVal
	}
	return strconv.Itoa(intstr.IntValue())
}
1034149
func SpanIDFromString(s string) (SpanID, error) {
	if len(s) > 16 {
		return SpanID(0), fmt.Errorf("SpanID cannot be longer than 16 hex characters: %s", s)
	}
	id, err := strconv.ParseUint(s, 16, 64)
	if err != nil {
		return SpanID(0), err
	}
	return SpanID(id), nil
}
16588
func LevelFromString(levelStr string) Level {
	// We don't care about case. Accept both "INFO" and "info".
	levelStr = strings.ToLower(strings.TrimSpace(levelStr))
	switch levelStr {
	case "trace":
		return Trace
	case "debug":
		return Debug
	case "info":
		return Info
	case "warn":
		return Warn
	case "error":
		return Error
	default:
		return NoLevel
	}
}
1146318
func (id TLFID) EqString(other fmt.Stringer) bool {
	return hex.EncodeToString(id) == other.String()
}
1336692
func (gtidSet MariadbGTIDSet) String() string {
	s := make([]string, len(gtidSet))
	for i, gtid := range gtidSet {
		s[i] = gtid.String()
	}
	return strings.Join(s, ",")
}
906907
func (v UserId) String() string {
	x := (int64)(v)
	return fmt.Sprint(x)
}
660856
func StringToCFString(s string) (C.CFStringRef, error) {
	if !utf8.ValidString(s) {
		return nil, errors.New("Invalid UTF-8 string")
	}
	if uint64(len(s)) > math.MaxUint32 {
		return nil, errors.New("String is too large")
	}

	bytes := []byte(s)
	var p *C.UInt8
	if len(bytes) > 0 {
		p = (*C.UInt8)(&bytes[0])
	}
	return C.CFStringCreateWithBytes(nil, p, C.CFIndex(len(s)), C.kCFStringEncodingUTF8, C.false), nil
}
797641
func (v Version) String() string {
	return fmt.Sprintf("%d.%d", v.Scalar, v.PID)
}