MCPcopy Create free account
hub / github.com/cogentcore/core / StringDoc

Method StringDoc

vgpu/vars.go:178–201  ·  view source on GitHub ↗

StringDoc returns info on variables

()

Source from the content-addressed store, hash-verified

176
177// StringDoc returns info on variables
178func (vs *Vars) StringDoc() string {
179 ispc := 4
180 var sb strings.Builder
181 ns := vs.NSets()
182 for si := vs.StartSet(); si < ns; si++ {
183 st := vs.SetMap[si]
184 if st == nil {
185 continue
186 }
187 sb.WriteString(fmt.Sprintf("Set: %d\n", st.Set))
188
189 for ri := Vertex; ri < VarRolesN; ri++ {
190 rl, has := st.RoleMap[ri]
191 if !has || len(rl) == 0 {
192 continue
193 }
194 sb.WriteString(fmt.Sprintf("%sRole: %s\n", indent.Spaces(1, ispc), ri.String()))
195 for _, vr := range rl {
196 sb.WriteString(fmt.Sprintf("%sVar: %s\n", indent.Spaces(2, ispc), vr.String()))
197 }
198 }
199 }
200 return sb.String()
201}
202
203// NSets returns the number of regular non-VertexSet sets
204func (vs *Vars) NSets() int {

Callers 1

ConfigMethod · 0.80

Calls 5

NSetsMethod · 0.95
StartSetMethod · 0.95
SpacesFunction · 0.92
WriteStringMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected