23 .description(
"Path to a text file");
35 counter.
add(this->text.size());
41 const std::optional<std::string> path =
params.ensure_absolute_path(
42 params.extract_input<std::string>(
"Path"));
44 params.set_default_remaining_outputs();
50 auto cached_value = std::make_unique<LoadTextCache>();
55 const std::string message = fmt::format(fmt::runtime(
TIP_(
"Cannot open file: {}")),
62 cached_value->warnings.append(
66 cached_value->text = std::string(
static_cast<char *
>(buffer), buffer_len);
74 params.set_output(
"String", cached_value->text);
File and directory operations.
void * BLI_file_read_text_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size)
#define BLI_SCOPED_DEFER(function_to_defer)
ptrdiff_t BLI_str_utf8_invalid_byte(const char *str, size_t str_len) ATTR_NONNULL(1)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void add(const int64_t bytes)
std::optional< std::string > path_filter
void count_memory(MemoryCounter &counter) const override
Vector< geo_eval_log::NodeWarning > warnings
void MEM_freeN(void *vmemh)
void node_register_type(bNodeType &ntype)
std::shared_ptr< const T > get_loaded(const GenericKey &loader_key, Span< StringRefNull > file_paths, FunctionRef< std::unique_ptr< T >()> load_fn)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare