15 b.use_custom_socket_order();
16 b.allow_any_socket_order();
18 b.add_output<
decl::String>(
"String"_ustr).align_with_previous();
19 b.add_input<
decl::String>(
"Find"_ustr).description(
"The string to find in the input string");
20 b.add_input<
decl::String>(
"Replace"_ustr).description(
"The string to replace each match with");
31 std::string new_str{new_str_ptr};
32 MEM_delete(new_str_ptr);
38 static auto substring_fn = mf::build::SI3_SO<std::string, std::string, std::string, std::string>(
39 "Replace", [](
const std::string &
str,
const std::string &find,
const std::string &replace) {
50 ntype.
ui_name =
"Replace String";
51 ntype.
ui_description =
"Replace a given string segment with another";
#define NODE_CLASS_CONVERTER
#define FN_NODE_REPLACE_STRING
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr const char * c_str() const
constexpr bool is_empty() const
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
static void node_declare(NodeDeclarationBuilder &b)
static std::string replace_all(const StringRefNull str, const StringRefNull from, const StringRefNull to)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_register()
char * BLI_string_replaceN(const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
NodeDeclareFunction declare