util

package
v0.0.0-...-51f7e66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructorName

func ConstructorName(name string, outer string) string

ConstructorName returns a Go friendly constructor name given the raw constructor name `name` and the class/record name `outer`

func ConvertArgs

func ConvertArgs(a []string) string

func ConvertArgsComma

func ConvertArgsComma(a []string) string

func DashToCamel

func DashToCamel(s string) string

DashToCamel converts hello-world to HelloWorld

func NormalizeNamespace

func NormalizeNamespace(ns string, gotype string, strip bool) string

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

func RemoveSnakePrefix(s string, prefix string) string

RemoveSnakePrefix removes `prefix` from string `s` if that prefix ise separated with a _ it removes lowercase or all u

func ReplaceExtension

func ReplaceExtension(filename string, ext string) string

ReplaceExtension replaces an extension from filename with ext the extension is found by splitting on "." and taking the last part

func SnakeToCamel

func SnakeToCamel(s string) string

SnakeToCamel converts hello_world to HelloWorld

func TranslateFilename

func TranslateFilename(filename string) string

TranslateFilename translates a file path by renaming the file to a go suitable file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL