Paula Script
paula.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "defs.h"
4 #include "args.h"
5 
6 namespace paula
7 {
8  class IInputStream;
9 
10  // user interface
11 
12  constexpr const char * PAULA_VERSION = "0.1";
13 
14  void printVersion();
15 
19  [[nodiscard]] const Error * run(const char*);
20 
24  [[nodiscard]] const Error * run(IInputStream&);
25 
29  void runSafe(const char*);
30 
34  void runSafe(IInputStream&);
35 
39  Var get(const char * varName);
40 
44  const Error * addCallback(const char* name, const Error* (*_action)(Args&));
45 }
paula::PAULA_VERSION
constexpr const char * PAULA_VERSION
Definition: paula.h:12
paula::IInputStream
Base class for input streams.
Definition: stream.h:111
paula::Var
Access Paula script variable data.
Definition: args.h:17
paula::printVersion
void printVersion()
args.h
paula::addCallback
const Error * addCallback(const char *name, const Error *(*_action)(Args &))
Add a callback to call from a Paula script.
paula::runSafe
void runSafe(const char *)
Run a script. If an error occurs, print the error.
paula::get
Var get(const char *varName)
Get a variable by name. Return 'empty' if the variable is not found.
paula
Definition: paula.h:6
paula::Args
Access callback arguments (e.g. value of "a" in "f(a)"). Set return value of the callback function,...
Definition: args.h:78
paula::run
const Error * run(const char *)
Run a script and return error, or NO_ERROR, if everything went well.