aboutsummaryrefslogtreecommitdiff
path: root/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp')
-rw-r--r--app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp b/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp
new file mode 100644
index 0000000..4689931
--- /dev/null
+++ b/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp
@@ -0,0 +1,53 @@
+#pragma once
+
+#include <Cplt/Model/Workflow/Workflow.hpp>
+
+#include <cstddef>
+#include <memory>
+#include <variant>
+#include <vector>
+
+class TextFormatterNode : public WorkflowNode
+{
+public:
+ enum ArgumentType
+ {
+ NumericArgument,
+ TextArgument,
+ DateTimeArgument,
+ };
+
+private:
+ class Impl;
+
+ struct Argument
+ {
+ ArgumentType Type;
+ int PinIdx;
+ };
+ using Element = std::variant<std::string, Argument>;
+
+ std::vector<Element> mElements;
+ int mMinOutputChars;
+
+public:
+ static BaseValue::Kind ArgumentTypeToValueKind(ArgumentType arg);
+ static bool IsInstance(const WorkflowNode* node);
+ TextFormatterNode();
+
+ int GetElementCount() const;
+ const Element& GetElement(int idx) const;
+
+ void SetElement(int idx, std::string text);
+ void SetElement(int idx, ArgumentType argument);
+ void InsertElement(int idx, std::string text);
+ void InsertElement(int idx, ArgumentType argument);
+ void AppendElement(std::string text);
+ void AppendElement(ArgumentType argument);
+ void RemoveElement(int idx);
+
+ virtual void Evaluate(WorkflowEvaluationContext& ctx) override;
+
+private:
+ void PreRemoveElement(int idx);
+};