Files
Upsilon/apps/code/script_template.h
Léa Saviot d1c8bbdaf7 [apps/code] The console marks imported script for the var box
After lauching the console, if we fetch a script we mark it as fetched.
When the variable box displays variables from imported scripts, it scans
all the variables from the scripts marked as fetched.
2020-06-04 14:50:06 +02:00

27 lines
808 B
C++

#ifndef CODE_SCRIPT_TEMPLATE_H
#define CODE_SCRIPT_TEMPLATE_H
#include "script.h"
namespace Code {
class ScriptTemplate {
public:
constexpr ScriptTemplate(const char * name, const char * value) : m_name(name), m_value(value) {}
static const ScriptTemplate * Empty();
static const ScriptTemplate * Squares();
static const ScriptTemplate * Mandelbrot();
static const ScriptTemplate * Polynomial();
static const ScriptTemplate * Parabola();
const char * name() const { return m_name; }
const char * content() const { return m_value + Script::InformationSize(); }
const char * value() const { return m_value; }
private:
const char * m_name;
const char * m_value; // holds the 'importation status' and 'current importation status' flags concatenated with the script content
};
}
#endif