MCPcopy Index your code
hub / github.com/rclone/rclone / String

Method String

lib/encoder/encoder.go:165–182  ·  view source on GitHub ↗

String converts the MultiEncoder into text

()

Source from the content-addressed store, hash-verified

163
164// String converts the MultiEncoder into text
165func (mask MultiEncoder) String() string {
166 // See if there is an exact translation - if so return that
167 if name, ok := encodingToName[mask]; ok {
168 return name
169 }
170 var out []string
171 // Otherwise decompose bit by bit
172 for bit := MultiEncoder(1); bit != 0; bit *= 2 {
173 if (mask & bit) != 0 {
174 if name, ok := encodingToName[bit]; ok {
175 out = append(out, name)
176 } else {
177 out = append(out, fmt.Sprintf("0x%X", uint(bit)))
178 }
179 }
180 }
181 return strings.Join(out, ",")
182}
183
184// Set converts a string into a MultiEncoder
185func (mask *MultiEncoder) Set(in string) error {

Callers

nothing calls this directly

Calls 2

MultiEncoderTypeAlias · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected