Documentation
¶
Overview ¶
package util implements some utility functions for parsing/converting gir files TODO: Maybe some of this can more easily be done with regexes?
But using regexes introduces 2 problems :^)
Index ¶
- func ConstructorName(name string, outer string) string
- func ConvertArgs(a []string) string
- func ConvertArgsComma(a []string) string
- func DashToCamel(s string) string
- func NormalizeNamespace(ns string, gotype string, strip bool) string
- func RemoveSnakePrefix(s string, prefix string) string
- func ReplaceExtension(filename string, ext string) string
- func SnakeToCamel(s string) string
- func TranslateFilename(filename string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructorName ¶
ConstructorName returns a Go friendly constructor name given the raw constructor name `name` and the class/record name `outer`
func ConvertArgs ¶
func ConvertArgsComma ¶
func NormalizeNamespace ¶
NormalizeNamespace converts a type to one that always includes a lowercase namespace if no namespace is found, it adds `ns`, unless if strip is True then namespaces always equaling `ns` will be removed
func RemoveSnakePrefix ¶
RemoveSnakePrefix removes `prefix` from string `s` if that prefix ise separated with a _ it removes lowercase or all u
func ReplaceExtension ¶
ReplaceExtension replaces an extension from filename with ext the extension is found by splitting on "." and taking the last part
func SnakeToCamel ¶
SnakeToCamel converts hello_world to HelloWorld
func TranslateFilename ¶
TranslateFilename translates a file path by renaming the file to a go suitable file
Types ¶
This section is empty.