28 N_(
"Convert all characters to uppercase")},
33 N_(
"Convert all characters to lowercase")},
40 b.use_custom_socket_order();
41 b.allow_any_socket_order();
43 b.add_output<
decl::String>(
"String"_ustr).align_with_previous();
59 for (
size_t i = 0; i < len_chars; i++) {
60 const char32_t c = utf32[i];
73 return std::string(
out.data());
84 if (item->name !=
nullptr && item->identifier[0] !=
'\0') {
85 const int value = item->value;
87 bNode &node = params.add_node(
"FunctionNodeSetStringCase"_ustr);
88 bke::node_find_socket(node, SOCK_IN,
"Case"_ustr)
89 ->default_value_typed<bNodeSocketValueMenu>()
91 params.update_and_connect_available_socket(node,
"String"_ustr);
106 static auto fn = mf::build::SI2_SO<std::string, MenuValue, std::string>(
107 "String Case", [](
const std::string &s,
MenuValue mode) -> std::string {
118 ntype.
ui_name =
"Set String Case";
#define NODE_CLASS_CONVERTER
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeTree & node_tree() const
const bNodeSocket & other_socket() const
eNodeSocketInOut in_out() const
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
bNode & add_node(UString idname)
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static const EnumPropertyItem case_items[]
static void node_declare(NodeDeclarationBuilder &b)
static std::string apply_string_case(const std::string &s, const Case mode)
static void node_register()
static void node_gather_link_search_ops(GatherLinkSearchOpParams ¶ms)
size_t BLI_str_utf8_as_utf32(char32_t *__restrict dst_w, const char *__restrict src_c, size_t dst_w_maxncpy) ATTR_NONNULL(1
size_t size_t BLI_str_utf32_as_utf8(char *__restrict dst, const char32_t *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char32_t BLI_str_utf32_char_to_lower(char32_t wc)
size_t BLI_strlen_utf8_ex(const char *strc, size_t *r_len_bytes) ATTR_NONNULL(1
char32_t BLI_str_utf32_char_to_upper(char32_t wc)
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bke::bNodeTreeType * typeinfo
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
std::string ui_description
NodeMultiFunctionBuildFunction build_multi_function
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare