bindings

package
v0.0.0-...-cbd58c3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bindings implements CMake-style variable bindings. https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapping

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

Mapping is a stack of map[string]string for CMake variables.

func New

func New() *Mapping

New returns a new, empty, variable stack.

func (*Mapping) Depth

func (m *Mapping) Depth() int

Depth returns the current mapping depth starting from 0.

func (*Mapping) Get

func (m *Mapping) Get(key string) string

Get looks from the current scope up to find the nearest value for key. If they key is absent, returns the empty string. This matches the semantics of CMake variable lookup.

func (*Mapping) GetCache

func (m *Mapping) GetCache(key string) string

GetCache returns the associated value from the variable cache or an empty string if not found.

func (*Mapping) GetEnv

func (m *Mapping) GetEnv(key string) string

GetEnv returns the corresponding environment variable or the empty string (not implemented).

func (*Mapping) Pop

func (m *Mapping) Pop()

Pop removes the most recently pushed scope.

func (*Mapping) Push

func (m *Mapping) Push()

Push pushes a new variable binding scope.

func (*Mapping) Set

func (m *Mapping) Set(key, value string)

Set sets a key to a particular value in the current scope. Setting a key to the empty string is equivalent to deleting it, in accordance with CMake semantics.

func (*Mapping) SetCache

func (m *Mapping) SetCache(key, value string)

SetCache sets a key to a particular value in CACHE scope. Setting a key to the empty string is equivalent to deleting it, in accordance with CMake semantics.

func (*Mapping) SetParent

func (m *Mapping) SetParent(key, value string)

SetParent sets a key to a particular value in the parent scope. Setting a key to the empty string is equivalent to deleting it, in accordance with CMake semantics.

func (*Mapping) Values

func (m *Mapping) Values() map[string]string

Values returns the currently set values as a map[string]string. Keys set to the empty string will be omitted from the final map.

Jump to

Keyboard shortcuts

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