Files
squeezelite-esp32/components/spotify/cspot/cpp-reflection/util.go
Philippe G 898998efb0 big merge
2021-12-18 21:04:23 -08:00

26 lines
562 B
Go

package main
import (
"path/filepath"
"strings"
)
func AddIncludeForType(t GeneratableType, gen *CppGenerator) {
switch v := t.(type) {
case *ClassType:
gen.AddLocalInclude(v.ProtoName + ".h")
case *EnumType:
gen.AddLocalInclude(v.ProtoName + ".h")
case *VectorType:
gen.AddLibraryInclude("vector")
AddIncludeForType(v.InnerType, gen)
case *OptionalType:
gen.AddLibraryInclude("optional")
AddIncludeForType(v.InnerType, gen)
}
}
func StripExtenstion(filename string) string {
return strings.TrimSuffix(filename, filepath.Ext(filename))
}