From 7fe47a9d5b1727a61dc724523b530762f6d6ba19 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 30 Jun 2022 21:38:53 -0700 Subject: Restructure project --- app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp (limited to 'app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp') 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 + +#include +#include +#include +#include + +class TextFormatterNode : public WorkflowNode +{ +public: + enum ArgumentType + { + NumericArgument, + TextArgument, + DateTimeArgument, + }; + +private: + class Impl; + + struct Argument + { + ArgumentType Type; + int PinIdx; + }; + using Element = std::variant; + + std::vector 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); +}; -- cgit v1.2.3-70-g09d2