flag

package
v0.0.0-...-472ff39 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	// Returns flags consumed by this module, listed by itself
	FlagsIn() Flags

	// Returns flags consumed by this module, including any flags provided by its upstream providers.
	FlagsInTransitive(blueprint.BaseModuleContext) Flags
}

type Flag

type Flag struct {
	// contains filtered or unexported fields
}

func FromDefineOwned

func FromDefineOwned(raw string, owner blueprint.Module, tag Type) Flag

func FromGeneratedIncludePath

func FromGeneratedIncludePath(path string, owner blueprint.Module, tag Type) Flag

func FromIncludePath

func FromIncludePath(path string, tag Type) Flag

func FromIncludePathOwned

func FromIncludePathOwned(path string, owner blueprint.Module, tag Type) Flag

func FromString

func FromString(raw string, tag Type) Flag

func FromStringOwned

func FromStringOwned(raw string, owner blueprint.Module, tag Type) Flag

func (Flag) IsNotType

func (f Flag) IsNotType(t Type) bool

func (Flag) IsType

func (f Flag) IsType(t Type) bool

Checks if flag matches the given mask exactly. Returns true if all the tags match.

func (Flag) MatchesType

func (f Flag) MatchesType(t Type) bool

Check if a flag loosely matches the given type. This will return true if at least one of the tags matches.

func (Flag) Raw

func (f Flag) Raw() string

func (Flag) ToString

func (f Flag) ToString() string

Construct the final string flag at runtime.

func (Flag) Type

func (f Flag) Type() Type

type FlagParserTable

type FlagParserTable []FlagParserTableEntry

type FlagParserTableEntry

type FlagParserTableEntry struct {
	PropertyName string
	Tag          Type
	Factory      func(string, blueprint.Module, Type) Flag
}

type Flags

type Flags []Flag

Array of files as a helper for struct attribute collections TODO: add the possibility to tag a group of files.

func ParseFromProperties

func ParseFromProperties(owner blueprint.Module, luts FlagParserTable, s interface{}) (ret Flags)

Helper method to scrape many properties from a module struct.

func ReferenceFlagsInTransitive

func ReferenceFlagsInTransitive(ctx blueprint.BaseModuleContext) (ret Flags)

Basic common implementation, certain targets may wish to customize this.

func (Flags) AppendIfUnique

func (fs Flags) AppendIfUnique(f Flag) Flags

func (Flags) Contains

func (fs Flags) Contains(query Flag) bool

func (Flags) Filtered

func (fs Flags) Filtered(predicate func(Flag) bool) (ret Flags)

func (Flags) ForEach

func (fs Flags) ForEach(functor func(Flag))

func (Flags) ForEachIf

func (fs Flags) ForEachIf(predicate func(Flag) bool, functor func(Flag))

func (Flags) GroupByType

func (fs Flags) GroupByType(mask Type) (out Flags)

Sorts the given collection by it's type masked by given mask. For example if mask is flag.TypeCC | flag.TypeInclude, the buckets would be: TypeUnset TypeCC TypeInclude TypeCC | TypeInclude

func (Flags) Iterate

func (fs Flags) Iterate() <-chan Flag

func (Flags) IteratePredicate

func (fs Flags) IteratePredicate(predicate func(Flag) bool) <-chan Flag

func (Flags) Merge

func (fs Flags) Merge(other Flags) Flags

func (Flags) ToStringSlice

func (fs Flags) ToStringSlice() (ret []string)

type Provider

type Provider interface {
	// Returns flags provided by this module to any consumer.
	FlagsOut() Flags
}

type ReExporter

type ReExporter interface {
	Provider

	/* This interface is required for targets which reexport libs */
	FlagsOutTargets() []string
}

type Type

type Type uint32
const (
	// Flag types
	TypeUnset Type = 0
	TypeAsm   Type = 1 << iota
	TypeC
	TypeCpp
	TypeCC
	TypeLinker
	TypeTransitiveLinker // Only for strict targets to comply with Bazel
	TypeLinkLibrary
	TypeInclude
	TypeIncludeLocal // Helper flag to mark local include dirs
	TypeIncludeGenerated
	TypeIncludeSystem

	TypeExported // Applied to direct downstream dep **only**
	TypeTransitive

	// Masks
	TypeCompilable = TypeAsm | TypeC | TypeCpp
)

Flags have an associated contextual information which is useful to filter based on use. TypeConly does not exist as it is equivalent to ((type & TypeCompilable) == TypeC)

Jump to

Keyboard shortcuts

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