A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::flow::Constant Struct Reference

A literal or folded literal expression, including nested lists and objects. More...

#include <cpp/a11/flow/syntax.h>

Public Types

enum class  Kind {
  kNull , kBool , kInteger , kDouble ,
  kString , kBytes , kRegex , kDuration ,
  kList , kObject
}

Public Member Functions

double AsDouble () const
 The number this holds, whichever way it was written.

Static Public Member Functions

static Constant Null ()
static Constant Bool (bool value)
static Constant Integer (long long value)
static Constant Double (double value)
static Constant String (std::string value)
static Constant Bytes (std::string value)
static Constant Regex (std::string value)
static Constant Duration (absl::Duration value)

Public Attributes

Kind kind = Kind::kNull
bool boolean = false
long long integer = 0
double number = 0.0
std::string text
absl::Duration duration
std::vector< Constant > items
std::vector< std::pair< std::string, Constant > > pairs

Detailed Description

A literal or folded literal expression, including nested lists and objects.

Integer and floating-point values remain distinct.

Member Enumeration Documentation

◆ Kind

Enumerator
kNull 
kBool 
kInteger 
kDouble 
kString 
kBytes 
kRegex 
kDuration 
kList 
kObject 

Member Function Documentation

◆ AsDouble()

double a11::flow::syntax::Constant::AsDouble ( ) const
nodiscard

The number this holds, whichever way it was written.

◆ Bool()

◆ Bytes()

Constant a11::flow::syntax::Constant::Bytes ( std::string value)
static

◆ Double()

◆ Duration()

Constant a11::flow::syntax::Constant::Duration ( absl::Duration value)
static

◆ Integer()

◆ Null()

◆ Regex()

Constant a11::flow::syntax::Constant::Regex ( std::string value)
static

◆ String()

Constant a11::flow::syntax::Constant::String ( std::string value)
static

Member Data Documentation

◆ boolean

◆ duration

◆ integer

◆ items

◆ kind

◆ number

◆ pairs

std::vector<std::pair<std::string, Constant> > a11::flow::syntax::Constant::pairs

◆ text


The documentation for this struct was generated from the following files: