Integrating latest 47acbe8

This commit is contained in:
alexpete
2021-03-25 13:57:57 -07:00
parent 448c549698
commit 75dc720198
10312 changed files with 2711566 additions and 671451 deletions
@@ -13,6 +13,7 @@
#include "Contains.h"
#include <AzFramework/StringFunc/StringFunc.h>
#include <ScriptCanvas/Utils/VersionConverters.h>
namespace ScriptCanvas
{
@@ -20,6 +21,42 @@ namespace ScriptCanvas
{
namespace String
{
void Contains::OnInit()
{
// Version Conversion Code for a slot renaming.
Slot* slot = GetSlotByName("Ignore Case");
if (slot)
{
RenameSlot((*slot), "Case Sensitive");
ModifiableDatumView datumView;
ModifyUnderlyingSlotDatum(slot->GetId(), datumView);
if (datumView.IsValid() && datumView.IsType(ScriptCanvas::Data::Type::Boolean()))
{
const bool* datumValue = datumView.GetAs<ScriptCanvas::Data::BooleanType>();
Datum newDatum = Datum(!(*datumValue));
datumView.AssignToDatum(newDatum);
}
}
////
}
void Contains::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const
{
auto newDataOutSlots = replacementNode->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataOut);
auto oldDataOutSlots = this->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataOut);
if (newDataOutSlots.size() == oldDataOutSlots.size())
{
for (size_t index = 0; index < newDataOutSlots.size(); index++)
{
outSlotIdMap.emplace(oldDataOutSlots[index]->GetId(), AZStd::vector<SlotId>{ newDataOutSlots[index]->GetId() });
}
}
}
void Contains::OnInputSignal(const SlotId&)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Contains::OnInputSignal");
@@ -12,7 +12,6 @@
#pragma once
#include <ScriptCanvas/CodeGen/CodeGen.h>
#include <ScriptCanvas/Core/Node.h>
#include <ScriptCanvas/Internal/Nodes/StringFormatted.h>
@@ -24,54 +23,19 @@ namespace ScriptCanvas
{
namespace String
{
//! Checks if the specified substring exists in the provided string
//! Deprecated: see String class reflection of method "Contains String"
class Contains
: public Node
{
public:
ScriptCanvas_Node(Contains,
ScriptCanvas_Node::Name("Contains String", "Checks if a string contains an instance of a specified string, if true, it returns the index to the first instance matched.")
ScriptCanvas_Node::Uuid("{8481E892-DE37-4CCF-86AA-E4770DE90643}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::Version(0)
);
SCRIPTCANVAS_NODE(Contains);
void OnInit() override;
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
protected:
// Inputs
ScriptCanvas_In(ScriptCanvas_In::Name("In", "Input signal"));
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Source", "The string to search in.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Pattern", "The substring to search for.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(bool,
ScriptCanvas_Property::Name("Search From End", "Start the match checking from the end of a string.")
ScriptCanvas_Property::Input
);
ScriptCanvas_PropertyWithDefaults(bool, true,
ScriptCanvas_Property::Name("Case Sensitive", "Take into account the case of the string when searching.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Out(ScriptCanvas_Out::Name("True", "The string contains the provided pattern."));
ScriptCanvas_Out(ScriptCanvas_Out::Name("False", "The string did not contain the provided pattern."));
ScriptCanvas_Property(int,
ScriptCanvas_Property::Name("Index", "The first index at which the substring was found.")
ScriptCanvas_Property::Output,
ScriptCanvas_Property::OutputStorageSpec
);
void OnInputSignal(const SlotId& slotId) override;
};
@@ -12,7 +12,6 @@
#pragma once
#include <ScriptCanvas/CodeGen/CodeGen.h>
#include <ScriptCanvas/Core/Node.h>
#include <ScriptCanvas/Internal/Nodes/StringFormatted.h>
@@ -29,27 +28,13 @@ namespace ScriptCanvas
class Format
: public Internal::StringFormatted
{
public:
ScriptCanvas_Node(Format,
ScriptCanvas_Node::Name("Build String", "Formats and creates a string from the provided text.\nAny word within {} will create a data pin on this node.")
ScriptCanvas_Node::Uuid("{B16259BA-9CF6-4143-B09B-5A0F3B4585E6}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::DynamicSlotOrdering(true)
ScriptCanvas_Node::Version(0)
);
protected:
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("String", "The resulting string.")
ScriptCanvas_Property::Output
ScriptCanvas_Property::OutputStorageSpec
ScriptCanvas_Property::DisplayGroup("PrintDisplayGroup")
);
SCRIPTCANVAS_NODE(Format);
void OnInputSignal(const SlotId& slotId) override;
};
}
}
}
}
@@ -12,7 +12,6 @@
#pragma once
#include <ScriptCanvas/CodeGen/CodeGen.h>
#include <ScriptCanvas/Core/Node.h>
#include <ScriptCanvas/Internal/Nodes/StringFormatted.h>
@@ -29,18 +28,10 @@ namespace ScriptCanvas
class Print
: public Internal::StringFormatted
{
public:
ScriptCanvas_Node(Print,
ScriptCanvas_Node::Name("Print", "Formats and prints the provided text in the debug console.\nAny word within {} will create a data pin on this node.")
ScriptCanvas_Node::Uuid("{E1940FB4-83FE-4594-9AFF-375FF7603338}")
ScriptCanvas_Node::Category("Utilities/Debug")
ScriptCanvas_Node::EditAttributes(AZ::Edit::Attributes::CategoryStyle(".string"), ScriptCanvas::Attributes::Node::TitlePaletteOverride("StringNodeTitlePalette"))
ScriptCanvas_Node::DynamicSlotOrdering(true)
ScriptCanvas_Node::Version(0)
);
protected:
SCRIPTCANVAS_NODE(Print);
void OnInputSignal(const SlotId&) override;
};
@@ -20,6 +20,42 @@ namespace ScriptCanvas
{
namespace String
{
void Replace::OnInit()
{
// Version Conversion Code for a slot renaming.
Slot* slot = GetSlotByName("Ignore Case");
if (slot)
{
RenameSlot((*slot), "Case Sensitive");
ModifiableDatumView datumView;
ModifyUnderlyingSlotDatum(slot->GetId(), datumView);
if (datumView.IsValid() && datumView.IsType(ScriptCanvas::Data::Type::Boolean()))
{
const bool* datumValue = datumView.GetAs<ScriptCanvas::Data::BooleanType>();
Datum newDatum = Datum(!(*datumValue));
datumView.AssignToDatum(newDatum);
}
}
////
}
void Replace::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const
{
auto newDataOutSlots = replacementNode->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataOut);
auto oldDataOutSlots = this->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataOut);
if (newDataOutSlots.size() == oldDataOutSlots.size())
{
for (size_t index = 0; index < newDataOutSlots.size(); index++)
{
outSlotIdMap.emplace(oldDataOutSlots[index]->GetId(), AZStd::vector<SlotId>{ newDataOutSlots[index]->GetId() });
}
}
}
void Replace::OnInputSignal(const SlotId&)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Replace::OnInputSignal");
@@ -12,7 +12,6 @@
#pragma once
#include <ScriptCanvas/CodeGen/CodeGen.h>
#include <ScriptCanvas/Core/Node.h>
#include <ScriptCanvas/Internal/Nodes/StringFormatted.h>
@@ -24,54 +23,19 @@ namespace ScriptCanvas
{
namespace String
{
//! A String formatting class that produces a data output based on the specified string format and
//! input values.
//! Deprecated: see String class reflection of "Replace String"
class Replace
: public Node
{
public:
ScriptCanvas_Node(Replace,
ScriptCanvas_Node::Name("Replace String", "Allows replacing a substring from a given string.")
ScriptCanvas_Node::Uuid("{197D0BAA-FCAF-4922-872B-3A95BEA574B2}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::Version(0)
);
SCRIPTCANVAS_NODE(Replace);
void OnInit() override;
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
protected:
// Inputs
ScriptCanvas_In(ScriptCanvas_In::Name("In", "Input signal"));
// Outputs
ScriptCanvas_Out(ScriptCanvas_Out::Name("Out", ""));
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Source", "The string to search in.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Replace", "The substring to search for.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("With", "The string to replace the substring with.")
ScriptCanvas_Property::Input
);
ScriptCanvas_PropertyWithDefaults(bool, true,
ScriptCanvas_Property::Name("Case Sensitive", "Take into account the case of the string when searching.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Result", "The resulting string.")
ScriptCanvas_Property::Output
ScriptCanvas_Property::OutputStorageSpec
);
void OnInputSignal(const SlotId& slotId) override;
};
@@ -1,4 +1,4 @@
/*
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
@@ -40,8 +40,13 @@ namespace ScriptCanvas
;
}
}
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(reflection))
{
SCRIPT_CANVAS_GENERICS_TO_VM(StringNodes::Registrar, String, behaviorContext, StringNodes::k_categoryName);
}
Nodes::Internal::StringFormatted::Reflect(reflection);
StringMethods::Reflect(reflection);
}
void String::InitNodeRegistry(NodeRegistry& nodeRegistry)
@@ -1,4 +1,4 @@
/*
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
@@ -21,3 +21,4 @@
#include "Contains.h"
#include "Utilities.h"
#include "StringGenerics.h"
#include "StringMethods.h"
@@ -1,4 +1,4 @@
/*
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
@@ -18,19 +18,21 @@ namespace ScriptCanvas
{
namespace StringNodes
{
static const char* k_categoryName = "String";
AZ_INLINE Data::StringType ToLower(Data::StringType sourceString)
{
AZStd::to_lower(sourceString.begin(), sourceString.end());
return sourceString;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToLower, "String", "{FC5FA07E-C65D-470A-BEFA-714EF8103866}", "Makes all the characters in the string lower case", "Source");
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToLower, k_categoryName, "{FC5FA07E-C65D-470A-BEFA-714EF8103866}", "Makes all the characters in the string lower case", "Source");
AZ_INLINE Data::StringType ToUpper(Data::StringType sourceString)
{
AZStd::to_upper(sourceString.begin(), sourceString.end());
return sourceString;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToUpper, "String", "{323951D4-9BB1-47C9-BD2C-2DD2B750217F}", "Makes all the characters in the string upper case", "Source");
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToUpper, k_categoryName, "{323951D4-9BB1-47C9-BD2C-2DD2B750217F}", "Makes all the characters in the string upper case", "Source");
AZ_INLINE Data::StringType Substring(Data::StringType sourceString, AZ::u32 index, AZ::u32 length)
{
@@ -43,7 +45,7 @@ namespace ScriptCanvas
return sourceString.substr(index, length);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Substring, "String", "{031BCDFC-5DA4-4EA0-A310-1FA9165E5BE5}", "Returns a sub string from a given string", "Source", "From", "Length");
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Substring, k_categoryName, "{031BCDFC-5DA4-4EA0-A310-1FA9165E5BE5}", "Returns a sub string from a given string", "Source", "From", "Length");
using Registrar = RegistrarGeneric
<
@@ -0,0 +1,136 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/ScriptCanvas/ScriptCanvasAttributes.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include "StringMethods.h"
#include <ScriptCanvas/Core/Attributes.h>
#define LUA_BACKEND
namespace ScriptCanvas
{
bool StringMethods::EndsWith(const AZStd::string& sourceString, const AZStd::string& patternString, bool caseSensitive)
{
return AzFramework::StringFunc::EndsWith(sourceString.c_str(), patternString.c_str(), caseSensitive);
}
size_t StringMethods::Find(const AZStd::string& sourceString, const AZStd::string& patternString, bool searchFromEnd, bool caseSensitive)
{
#if defined(LUA_BACKEND)
AZ_Warning("ScriptCanvas", sourceString.size() <= k_LuaNpos && patternString.size() <= k_LuaNpos,
"Source or Pattern string is too long, lua may lose precision on the position value.");
size_t findPosition = AzFramework::StringFunc::Find(sourceString.c_str(), patternString.c_str(), 0, searchFromEnd, caseSensitive);
return findPosition > k_LuaNpos ? k_LuaNpos : findPosition;
#else
return AzFramework::StringFunc::Find(sourceString.c_str(), patternString.c_str(), 0, searchFromEnd, caseSensitive);
#endif
}
bool StringMethods::IsValidFindPosition(size_t findPosition)
{
#if defined(LUA_BACKEND)
return findPosition != k_LuaNpos;
#else
return findPosition != AZStd::string::npos;
#endif
}
AZStd::string StringMethods::Join(const AZStd::vector<AZStd::string>& sourceArray, const AZStd::string& separatorString)
{
AZStd::string result;
size_t index = 0;
const size_t length = sourceArray.size();
for (auto string : sourceArray)
{
if (index < length - 1)
{
result.append(AZStd::string::format("%s%s", string.c_str(), separatorString.c_str()));
}
else
{
result.append(string);
}
++index;
}
return result;
}
AZStd::string StringMethods::Replace(AZStd::string& sourceString, const AZStd::string& replaceString, const AZStd::string& withString, bool caseSensitive)
{
AzFramework::StringFunc::Replace(sourceString, replaceString.c_str(), withString.c_str(), caseSensitive);
return sourceString;
}
AZStd::vector<AZStd::string> StringMethods::Split(const AZStd::string& sourceString, const AZStd::string& delimiterString)
{
AZStd::vector<AZStd::string> stringArray;
AzFramework::StringFunc::Tokenize(sourceString.c_str(), stringArray, delimiterString.c_str(), false, false);
return stringArray;
}
bool StringMethods::StartsWith(const AZStd::string& sourceString, const AZStd::string& patternString, bool caseSensitive)
{
return AzFramework::StringFunc::StartsWith(sourceString.c_str(), patternString.c_str(), caseSensitive);
}
void StringMethods::Reflect(AZ::ReflectContext* context)
{
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<StringMethods>()
->Version(0)
;
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
{
editContext->Class<StringMethods>("String", "")
->ClassElement(AZ::Edit::ClassElements::EditorData, "");
}
}
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
AZ::BranchOnResultInfo booleanResultInfo;
AZ::BranchOnResultInfo nonBooleanResultInfo;
nonBooleanResultInfo.m_returnResultInBranches = true;
nonBooleanResultInfo.m_nonBooleanResultCheckName = "Is Valid Find Position";
behaviorContext->Class<StringMethods>("String")
->Method("Is Valid Find Position", &IsValidFindPosition)
->Method("Contains String", &Find,
{ { {"Source", "The string to search in."}, {"Pattern", "The substring to search for."}, {"Search From End", "Start the match checking from the end of a string."}, { "Case Sensitive", "Take into account the case of the string when searching." } } })
->Attribute(AZ::ScriptCanvasAttributes::BranchOnResult, nonBooleanResultInfo)
->Method("Starts With", &StartsWith,
{ { {"Source", "The string to search in."}, {"Pattern", "The substring to search for."}, {"Case Sensitive", "Take into account the case of the string when searching."} } })
->Attribute(AZ::ScriptCanvasAttributes::BranchOnResult, booleanResultInfo)
->Method("Ends With", &EndsWith,
{ { {"Source", "The string to search in."}, {"Pattern", "The substring to search for."}, {"Case Sensitive", "Take into account the case of the string when searching."} } })
->Attribute(AZ::ScriptCanvasAttributes::BranchOnResult, booleanResultInfo)
->Method("Split", &Split,
{ { {"Source", "The string to search in."}, {"Delimiters", "The characters that can be used as delimiters."} } })
->Method("Join", &Join,
{ { {"String Array", "The array of strings to join."}, {"Separator", "Will use this string when concatenating the strings from the array."} } })
->Method("Replace String", &Replace,
{ { {"Source", "The string to search in."}, {"Replace", "The substring to search for."}, {"With", "The string to replace the substring with."}, {"Case Sensitive", "Take into account the case of the string when searching."} } });
}
}
}
@@ -0,0 +1,44 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
class ReflectContext;
}
namespace ScriptCanvas
{
class StringMethods
{
public:
static const size_t k_LuaNpos = UINT_MAX;
AZ_TYPE_INFO(StringMethods, "{4A70FD56-10A8-460E-B822-3EF03F1EF7A0}");
static bool EndsWith(const AZStd::string& sourceString, const AZStd::string& patternString, bool caseSensitive);
static size_t Find(const AZStd::string& sourceString, const AZStd::string& patternString, bool searchFromEnd, bool caseSensitive);
static bool IsValidFindPosition(size_t findPosition);
static AZStd::string Join(const AZStd::vector<AZStd::string>& sourceArray, const AZStd::string& separatorString);
static AZStd::string Replace(AZStd::string& sourceString, const AZStd::string& replaceString, const AZStd::string& withString, bool caseSensitive);
static AZStd::vector<AZStd::string> Split(const AZStd::string& sourceString, const AZStd::string& delimiterString);
static bool StartsWith(const AZStd::string& sourceString, const AZStd::string& patternString, bool caseSensitive);
static void Reflect(AZ::ReflectContext* context);
};
}
@@ -23,6 +23,19 @@ namespace ScriptCanvas
const char* Split::k_defaultDelimiter = " ";
const char* Join::k_defaultSeparator = " ";
void ReplaceStringUtilityNodeOutputSlot(const Node* oldNode, const Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap)
{
auto newDataOutSlots = replacementNode->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataOut);
auto oldDataOutSlots = oldNode->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataOut);
if (newDataOutSlots.size() == oldDataOutSlots.size())
{
for (size_t index = 0; index < newDataOutSlots.size(); index++)
{
outSlotIdMap.emplace(oldDataOutSlots[index]->GetId(), AZStd::vector<SlotId>{ newDataOutSlots[index]->GetId() });
}
}
}
void StartsWith::OnInputSignal(const SlotId&)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::StartsWith::OnInputSignal");
@@ -61,7 +74,12 @@ namespace ScriptCanvas
}
}
void Split::OnInputSignal([[maybe_unused]] const SlotId& slotId)
void Split::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const
{
ReplaceStringUtilityNodeOutputSlot(this, replacementNode, outSlotIdMap);
}
void Split::OnInputSignal(const SlotId&)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Split::OnInputSignal");
@@ -82,7 +100,12 @@ namespace ScriptCanvas
SignalOutput(GetSlotId("Out"));
}
void Join::OnInputSignal([[maybe_unused]] const SlotId& slotId)
void Join::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const
{
ReplaceStringUtilityNodeOutputSlot(this, replacementNode, outSlotIdMap);
}
void Join::OnInputSignal(const SlotId&)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Join::OnInputSignal");
@@ -12,7 +12,6 @@
#pragma once
#include <ScriptCanvas/CodeGen/CodeGen.h>
#include <ScriptCanvas/Core/Node.h>
#include <ScriptCanvas/Internal/Nodes/StringFormatted.h>
@@ -24,165 +23,61 @@ namespace ScriptCanvas
{
namespace String
{
//! Checks if a string starts with a given string, outputs True or False
//! Deprecated: see class String's reflection of method "Starts With"
class StartsWith
: public Node
{
public:
ScriptCanvas_Node(StartsWith,
ScriptCanvas_Node::Name("Starts With", ".")
ScriptCanvas_Node::Uuid("{60EB479A-CF31-4734-B2E5-422828A54A46}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::Version(0)
);
SCRIPTCANVAS_NODE(StartsWith);
protected:
// Inputs
ScriptCanvas_In(ScriptCanvas_In::Name("In", "Input signal"));
// Outputs
ScriptCanvas_Out(ScriptCanvas_Out::Name("True", ""));
ScriptCanvas_Out(ScriptCanvas_Out::Name("False", ""));
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Source", "The string to search in.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Pattern", "The pattern to evaluate.")
ScriptCanvas_Property::Input
);
ScriptCanvas_PropertyWithDefaults(bool, false,
ScriptCanvas_Property::Name("Case Sensitive", "Take into account the case of the string when searching.")
ScriptCanvas_Property::Input
);
void OnInputSignal(const SlotId& slotId) override;
};
//! Checks if a string starts with a given string, outputs True or False
//! Deprecated: see class String's reflection of method "Ends With"
class EndsWith
: public Node
{
public:
ScriptCanvas_Node(EndsWith,
ScriptCanvas_Node::Name("Ends With", ".")
ScriptCanvas_Node::Uuid("{6C1CECA6-C155-4ED5-96BC-1D4F11C7A0FE}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::Version(0)
);
SCRIPTCANVAS_NODE(EndsWith);
protected:
// Inputs
ScriptCanvas_In(ScriptCanvas_In::Name("In", "Input signal"));
// Outputs
ScriptCanvas_Out(ScriptCanvas_Out::Name("True", ""));
ScriptCanvas_Out(ScriptCanvas_Out::Name("False", ""));
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Source", "The string to search in.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Pattern", "The pattern to evaulate.")
ScriptCanvas_Property::Input
);
ScriptCanvas_PropertyWithDefaults(bool, false,
ScriptCanvas_Property::Name("Case Sensitive", "Take into account the case of the string when searching.")
ScriptCanvas_Property::Input
);
void OnInputSignal(const SlotId& slotId) override;
};
//! Splits a string into an array of strings using the specified delimiter (empty space by default).
//! Returns an array of strings always, if the string cannot be split, the string will be the first
//! element of the returned array
//! Deprecated: see class String's reflection of method "Ends With"
class Split
: public Node
{
public:
ScriptCanvas_Node(Split,
ScriptCanvas_Node::Name("Split", ".")
ScriptCanvas_Node::Uuid("{327EFC0F-F71E-4028-BAF9-C4223B933FB6}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::Version(0)
);
SCRIPTCANVAS_NODE(Split);
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
protected:
// Inputs
ScriptCanvas_In(ScriptCanvas_In::Name("In", "Input signal"));
// Outputs
ScriptCanvas_Out(ScriptCanvas_Out::Name("Out", ""));
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("Source", "The string to search in.")
ScriptCanvas_Property::Input
);
static const char* k_defaultDelimiter;
ScriptCanvas_PropertyWithDefaults(AZStd::string, k_defaultDelimiter,
ScriptCanvas_Property::Name("Delimiters", "The characters that can be used as delimiters.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::vector<AZStd::string>,
ScriptCanvas_Property::Name("String Array", "A container of all the strings.")
ScriptCanvas_Property::Output
ScriptCanvas_Property::OutputStorageSpec
);
void OnInputSignal(const SlotId& slotId) override;
};
//! Given an array of strings, this will join the elements in the array and return a single string
//! Deprecated: see class String's reflection of method "Join"
class Join
: public Node
{
public:
ScriptCanvas_Node(Join,
ScriptCanvas_Node::Name("Join", ".")
ScriptCanvas_Node::Uuid("{121E5B89-5A8A-4477-A3B7-078B0F1B36FD}")
ScriptCanvas_Node::Category("String")
ScriptCanvas_Node::Version(0)
);
SCRIPTCANVAS_NODE(Join);
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
protected:
// Inputs
ScriptCanvas_In(ScriptCanvas_In::Name("In", "Input signal"));
// Outputs
ScriptCanvas_Out(ScriptCanvas_Out::Name("Out", ""));
ScriptCanvas_Property(AZStd::vector<AZStd::string>,
ScriptCanvas_Property::Name("String Array", "The array of strings to join.")
ScriptCanvas_Property::Input
);
static const char* k_defaultSeparator;
ScriptCanvas_PropertyWithDefaults(AZStd::string, k_defaultSeparator,
ScriptCanvas_Property::Name("Separator", "Will use this string when concatenating the strings from the array.")
ScriptCanvas_Property::Input
);
ScriptCanvas_Property(AZStd::string,
ScriptCanvas_Property::Name("String", "The joined string.")
ScriptCanvas_Property::Output
ScriptCanvas_Property::OutputStorageSpec
);
void OnInputSignal(const SlotId& slotId) override;