mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-11 05:57:05 +03:00
big merge
This commit is contained in:
25
components/spotify/cspot/cpp-reflection/util.go
Normal file
25
components/spotify/cspot/cpp-reflection/util.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user