22 N_(
"Find the first occurrence of the string")},
27 N_(
"Find the last occurrence of the string")},
46 const int pos = from_end ? text.
rfind(token) : text.
find(token, 0);
58 const int match_len = token.
size();
69 static auto token_position_count =
70 mf::build::SI3_SO2<std::string, std::string, MenuValue, int, int>(
72 [](
const std::string &text,
73 const std::string &token,
89 ntype.
ui_name =
"Find in String";
91 "Find the number of times a given string occurs in another string and the position of the "
#define NODE_CLASS_CONVERTER
#define FN_NODE_FIND_IN_STRING
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr int64_t rfind(char c, int64_t pos=INT64_MAX) const
static constexpr int64_t not_found
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr int64_t find(char c, int64_t pos=0) const
constexpr const char * data() const
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
static const EnumPropertyItem mode_items[]
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_register()
static int string_count(const StringRef text, const StringRef token)
static int string_find(const StringRef text, const StringRef token, const bool from_end)
static void node_declare(NodeDeclarationBuilder &b)
size_t BLI_strnlen_utf8_ex(const char *strc, size_t strc_maxlen, size_t *r_len_bytes) 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
NodeDeclareFunction declare