nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches

Language keywords, variable name validation, process environment, and diagnostics. More...

#include <memory_resource>
#include <string>
#include <vector>
#include <nk/value/value.hpp>
#include <nk/value/span.hpp>
#include <nk/fs/branding.hpp>

Go to the source code of this file.

Functions

std::string nk::builtin::nk::envVarName (const char *suffix)
std::string nk::builtin::nk::envGet (const char *name)
void nk::builtin::nk::envSet (const char *name, const std::string &value)
void nk::builtin::setenv (const std::string &name, const std::string &value="")
 Sets or clears an operating system environment variable (setenv(name, value)).
std::string nk::builtin::getenv (const std::string &name)
 Reads an operating system environment variable as a C++ string (getenv(name)).
Value nk::builtin::getenv (const Value &name, std::pmr::memory_resource *mr=nullptr)
 Reads an environment variable returning a character row Value (val = getenv(name)).
bool nk::builtin::iskeyword (const std::string &name)
 Tests whether a string is a reserved MATLAB language keyword (iskeyword(s)).
const std::vector< std::string > & nk::builtin::keywords ()
 Lists all reserved MATLAB keywords as a C++ vector.
Value nk::builtin::iskeyword (Span< const Value > args, std::pmr::memory_resource *mr=nullptr)
 MATLAB-compatible overload for iskeyword.
bool nk::builtin::isvarname (const std::string &name)
 Tests whether a string is a valid MATLAB variable name (isvarname(s)).
Value nk::builtin::isvarname (const Value &name, std::pmr::memory_resource *mr=nullptr)
 MATLAB-compatible overload for isvarname.
Value nk::builtin::isvarname (Span< const Value > args, std::pmr::memory_resource *mr=nullptr)
 Span-based MATLAB-compatible overload for isvarname.

Variables

constexpr const char * nk::builtin::nk::kEnvPrefix = "NK"

Detailed Description

Language keywords, variable name validation, process environment, and diagnostics.

Provides clean, engine-free C++ API for environment variable access, keyword inspection, and variable name validation.

Definition in file lang.hpp.

Function Documentation

◆ envGet()

std::string nk::builtin::nk::envGet ( const char * name)
inline

Definition at line 41 of file lang.hpp.

◆ envSet()

void nk::builtin::nk::envSet ( const char * name,
const std::string & value )
inline

Definition at line 56 of file lang.hpp.

◆ envVarName()

std::string nk::builtin::nk::envVarName ( const char * suffix)
inline

Definition at line 33 of file lang.hpp.

Variable Documentation

◆ kEnvPrefix

const char* nk::builtin::nk::kEnvPrefix = "NK"
inlineconstexpr

Definition at line 31 of file lang.hpp.