nixd
Loading...
Searching...
No Matches
nixt Namespace Reference

Functions

void initEval ()
 
std::optional< nix::Value > getField (nix::EvalState &State, nix::Value &V, std::string_view Field)
 
std::optional< std::string_view > getFieldString (nix::EvalState &State, nix::Value &V, std::string_view Field)
 
bool checkField (nix::EvalState &State, nix::Value &V, std::string_view Field, std::string_view Pred)
 Check if value V is an attrset, has the field, and equals to Pred.
 
bool checkType (nix::EvalState &State, nix::Value &V, std::string_view Pred)
 Check if value is an attrset, and it's "_type" equals to Pred.
 
bool isOption (nix::EvalState &State, nix::Value &V)
 
bool isDerivation (nix::EvalState &State, nix::Value &V)
 
std::string attrPathStr (nix::EvalState &State, nix::Value &V, const std::string &AttrPath)
 
std::vector< nix::Symbol > toSymbols (nix::SymbolTable &STable, const std::vector< std::string > &Names)
 Transform a vector of string into a vector of nix symbols.
 
std::vector< nix::Symbol > toSymbols (nix::SymbolTable &STable, const std::vector< std::string_view > &Names)
 Transform a vector of string into a vector of nix symbols.
 
nix::Value & selectAttr (nix::EvalState &State, nix::Value &V, nix::Symbol Attr)
 Select attribute Attr.
 
nix::Value & selectOption (nix::EvalState &State, nix::Value &V, nix::Symbol Attr)
 
nix::Value & selectAttrPath (nix::EvalState &State, nix::Value &V, std::vector< nix::Symbol >::const_iterator Begin, std::vector< nix::Symbol >::const_iterator End)
 Given an attrpath in nix::Value V, select it.
 
nix::Value selectOptions (nix::EvalState &State, nix::Value &V, std::vector< nix::Symbol >::const_iterator Begin, std::vector< nix::Symbol >::const_iterator End)
 Select the option declaration list, V, dive into "submodules".
 
nix::Value selectOptions (nix::EvalState &State, nix::Value &V, const std::vector< nix::Symbol > &AttrPath)
 
nix::Value & selectSymbols (nix::EvalState &State, nix::Value &V, const std::vector< nix::Symbol > &AttrPath)
 Given an attrpath in nix::Value V, select it.
 
nix::Value & selectStrings (nix::EvalState &State, nix::Value &V, const std::vector< std::string > &AttrPath)
 Given an attrpath in nix::Value V, select it.
 
nix::Value & selectStringViews (nix::EvalState &State, nix::Value &V, const std::vector< std::string_view > &AttrPath)
 Given an attrpath in nix::Value V, select it.
 

Function Documentation

◆ attrPathStr()

std::string nixt::attrPathStr ( nix::EvalState & State,
nix::Value & V,
const std::string & AttrPath )

Definition at line 54 of file Value.cpp.

◆ checkField()

bool nixt::checkField ( nix::EvalState & State,
nix::Value & V,
std::string_view Field,
std::string_view Pred )

Check if value V is an attrset, has the field, and equals to Pred.

Definition at line 36 of file Value.cpp.

References getFieldString().

Referenced by checkType(), isDerivation(), and selectOptions().

◆ checkType()

bool nixt::checkType ( nix::EvalState & State,
nix::Value & V,
std::string_view Pred )

Check if value is an attrset, and it's "_type" equals to Pred.

Definition at line 41 of file Value.cpp.

References checkField().

Referenced by isOption().

◆ getField()

std::optional< nix::Value > nixt::getField ( nix::EvalState & State,
nix::Value & V,
std::string_view Field )

Definition at line 10 of file Value.cpp.

Referenced by getFieldString().

◆ getFieldString()

std::optional< std::string_view > nixt::getFieldString ( nix::EvalState & State,
nix::Value & V,
std::string_view Field )

Definition at line 23 of file Value.cpp.

References getField().

Referenced by checkField().

◆ initEval()

void nixt::initEval ( )
inline

Definition at line 15 of file InitEval.h.

Referenced by main().

◆ isDerivation()

bool nixt::isDerivation ( nix::EvalState & State,
nix::Value & V )

Definition at line 50 of file Value.cpp.

References checkField().

◆ isOption()

bool nixt::isOption ( nix::EvalState & State,
nix::Value & V )

Definition at line 46 of file Value.cpp.

References checkType().

Referenced by nixd::AttrSetProvider::onOptionComplete(), and selectOptions().

◆ selectAttr()

nix::Value & nixt::selectAttr ( nix::EvalState & State,
nix::Value & V,
nix::Symbol Attr )

Select attribute Attr.

Definition at line 84 of file Value.cpp.

Referenced by selectAttrPath(), and selectOptions().

◆ selectAttrPath()

nix::Value & nixt::selectAttrPath ( nix::EvalState & State,
nix::Value & V,
std::vector< nix::Symbol >::const_iterator Begin,
std::vector< nix::Symbol >::const_iterator End )

Given an attrpath in nix::Value V, select it.

Definition at line 102 of file Value.cpp.

References selectAttr(), and selectAttrPath().

Referenced by selectAttrPath(), and selectSymbols().

◆ selectOption()

nix::Value & nixt::selectOption ( nix::EvalState & State,
nix::Value & V,
nix::Symbol Attr )

◆ selectOptions() [1/2]

nix::Value nixt::selectOptions ( nix::EvalState & State,
nix::Value & V,
const std::vector< nix::Symbol > & AttrPath )
inline

Definition at line 49 of file Value.h.

References selectOptions().

◆ selectOptions() [2/2]

nix::Value nixt::selectOptions ( nix::EvalState & State,
nix::Value & V,
std::vector< nix::Symbol >::const_iterator Begin,
std::vector< nix::Symbol >::const_iterator End )

Select the option declaration list, V, dive into "submodules".

Definition at line 159 of file Value.cpp.

References checkField(), isOption(), selectAttr(), and selectOptions().

Referenced by nixd::AttrSetProvider::onOptionComplete(), nixd::AttrSetProvider::onOptionInfo(), selectOptions(), and selectOptions().

◆ selectStrings()

nix::Value & nixt::selectStrings ( nix::EvalState & State,
nix::Value & V,
const std::vector< std::string > & AttrPath )
inline

Given an attrpath in nix::Value V, select it.

Definition at line 61 of file Value.h.

References selectSymbols(), and toSymbols().

Referenced by nixd::AttrSetProvider::onAttrPathComplete(), and nixd::AttrSetProvider::onAttrPathInfo().

◆ selectStringViews()

nix::Value & nixt::selectStringViews ( nix::EvalState & State,
nix::Value & V,
const std::vector< std::string_view > & AttrPath )
inline

Given an attrpath in nix::Value V, select it.

Definition at line 68 of file Value.h.

References selectSymbols(), and toSymbols().

◆ selectSymbols()

nix::Value & nixt::selectSymbols ( nix::EvalState & State,
nix::Value & V,
const std::vector< nix::Symbol > & AttrPath )
inline

Given an attrpath in nix::Value V, select it.

Definition at line 55 of file Value.h.

References selectAttrPath().

Referenced by selectStrings(), and selectStringViews().

◆ toSymbols() [1/2]

std::vector< nix::Symbol > nixt::toSymbols ( nix::SymbolTable & STable,
const std::vector< std::string > & Names )

Transform a vector of string into a vector of nix symbols.

Definition at line 63 of file Value.cpp.

Referenced by nixd::AttrSetProvider::onOptionComplete(), nixd::AttrSetProvider::onOptionInfo(), selectStrings(), and selectStringViews().

◆ toSymbols() [2/2]

std::vector< nix::Symbol > nixt::toSymbols ( nix::SymbolTable & STable,
const std::vector< std::string_view > & Names )

Transform a vector of string into a vector of nix symbols.

Definition at line 74 of file Value.cpp.