aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Nodes/TextNodes.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-04-19 14:00:47 -0700
committerrtk0c <[email protected]>2021-04-19 14:00:47 -0700
commit1e09caaa2980fe901453b4b90985967a51157887 (patch)
treedf61974f9a5efa9a6732bd6d7b1ec1e6d1af182a /core/src/Model/Workflow/Nodes/TextNodes.hpp
parentb00b306de1140cb7b759ed0f639e8210fd7dffa6 (diff)
Split workflow into multiple files, fix unity build
Diffstat (limited to 'core/src/Model/Workflow/Nodes/TextNodes.hpp')
-rw-r--r--core/src/Model/Workflow/Nodes/TextNodes.hpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/core/src/Model/Workflow/Nodes/TextNodes.hpp b/core/src/Model/Workflow/Nodes/TextNodes.hpp
new file mode 100644
index 0000000..278db32
--- /dev/null
+++ b/core/src/Model/Workflow/Nodes/TextNodes.hpp
@@ -0,0 +1,50 @@
+#pragma once
+
+#include "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 ArgumentType;
+ 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);
+}; \ No newline at end of file