Documentation
¶
Index ¶
- func FieldDecl(info Field) []string
- func FieldDeclType(info Field) string
- func FieldName(info Field) string
- func PrimitiveUnmarshaller(typeName string, field Field) []string
- type Constant
- type ConstantVisitor
- type CppGenerator
- func (cg *CppGenerator) ArrayUnmarshaller(typeName string, field Field) []string
- func (cg *CppGenerator) BinaryConstants() []string
- func (cg *CppGenerator) Class(name string, fields []Field) []string
- func (cg *CppGenerator) Decoder(interfaceName string, types map[string]bool) []string
- func (cg *CppGenerator) Header() []string
- func (cg *CppGenerator) IdentUnmarshaller(typeName string, field Field) []string
- func (cg *CppGenerator) Implementation() []string
- func (cg *CppGenerator) Marshaller(name string, fields []Field) []string
- func (cg *CppGenerator) MoveConstructor(name string, fields []Field) []string
- func (cg *CppGenerator) PrimitiveMarshaller(typeName string, field Field) []string
- func (cg *CppGenerator) Unmarshaller(name string, fields []Field) []string
- type Field
- type FieldType
- type FieldVisitor
- type FuncReceiverWalker
- type TypeVisitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldDeclType ¶
FieldDeclType returns a string that represents the C++ type for this field.
func PrimitiveUnmarshaller ¶
PrimitiveUnmarshaller generates code that unmarshals primitive types like int.
Types ¶
type ConstantVisitor ¶
type ConstantVisitor struct {
Constants []Constant
}
ConstantVisitor stores a list of constants from the file.
type CppGenerator ¶
type CppGenerator struct { Constants []Constant Types map[string][]Field Interfaces map[string]bool FormTypes map[string]bool TermTypes map[string]bool }
CppGenerator generates C++ code from the Go auth types.
func ParseAuthAst ¶
func ParseAuthAst(binaryFile, astFile string) *CppGenerator
func (*CppGenerator) ArrayUnmarshaller ¶
func (cg *CppGenerator) ArrayUnmarshaller(typeName string, field Field) []string
ArrayUnmarshaller generates code that unmarshals an Array.
func (*CppGenerator) BinaryConstants ¶
func (cg *CppGenerator) BinaryConstants() []string
Constants creates lines that define the constants for auth serialization and deserialization.
func (*CppGenerator) Decoder ¶
func (cg *CppGenerator) Decoder(interfaceName string, types map[string]bool) []string
Decoder generates code that deserializes bytes that might be any subclass of a given interface class.
func (*CppGenerator) Header ¶
func (cg *CppGenerator) Header() []string
Header creates the header file for the C++ code.
func (*CppGenerator) IdentUnmarshaller ¶
func (cg *CppGenerator) IdentUnmarshaller(typeName string, field Field) []string
IdentUnmarshaller generates code that unmarshals an ast.Ident.
func (*CppGenerator) Implementation ¶
func (cg *CppGenerator) Implementation() []string
Implementation generates the C++ implementation file for the auth classes.
func (*CppGenerator) Marshaller ¶
func (cg *CppGenerator) Marshaller(name string, fields []Field) []string
Marshaller generates serialization code for the given auth type.
func (*CppGenerator) MoveConstructor ¶
func (cg *CppGenerator) MoveConstructor(name string, fields []Field) []string
MoveConstructor generates a constructor that moves all of the member variables through rvalue parameters.
func (*CppGenerator) PrimitiveMarshaller ¶
func (cg *CppGenerator) PrimitiveMarshaller(typeName string, field Field) []string
PrimitiveMarshaller generates serialization code for primitive types like int.
func (*CppGenerator) Unmarshaller ¶
func (cg *CppGenerator) Unmarshaller(name string, fields []Field) []string
Unmarshaller generates code that unmarshals bytes to a given class.
type FieldVisitor ¶
type FieldVisitor struct { ConcreteTypes map[string][]Field InterfaceTypes map[string]bool Name string }
FieldVisitor visits all the fields of a struct found by TypeVisitor and records them.
type FuncReceiverWalker ¶
type FuncReceiverWalker struct {
// contains filtered or unexported fields
}
FuncReceiverWalker holds information about the receiver types in the AST.
type TypeVisitor ¶
TypeVisitor visits ast.Nodes and finds all the types that need code generation.