Blender V4.5
blender::StringRefBase Class Reference

#include <BLI_string_ref.hh>

Inherited by blender::StringRef, and blender::StringRefNull.

Public Member Functions

void copy_utf8_truncated (char *dst, int64_t dst_size) const
void copy_bytes_truncated (char *dst, int64_t dst_size) const

Static Public Attributes

static constexpr int64_t not_found = -1

Protected Attributes

const char * data_
int64_t size_

#StringRefBase Inline Methods

constexpr StringRefBase (const char *data, int64_t size)
constexpr int64_t size () const
constexpr bool is_empty () const
constexpr const char * data () const
constexpr operator Span< char > () const
 operator std::string () const
constexpr operator std::string_view () const
constexpr const char * begin () const
constexpr const char * end () const
constexpr IndexRange index_range () const
template<size_t N>
void copy_utf8_truncated (char(&dst)[N]) const
template<size_t N>
void copy_bytes_truncated (char(&dst)[N]) const
void copy_unsafe (char *dst) const
constexpr bool startswith (StringRef prefix) const
constexpr bool endswith (StringRef suffix) const
constexpr StringRef substr (int64_t start, int64_t size) const
constexpr const char & front () const
constexpr const char & back () const
constexpr int64_t find (char c, int64_t pos=0) const
constexpr int64_t find (StringRef str, int64_t pos=0) const
constexpr int64_t rfind (char c, int64_t pos=INT64_MAX) const
constexpr int64_t rfind (StringRef str, int64_t pos=INT64_MAX) const
constexpr int64_t find_first_of (StringRef chars, int64_t pos=0) const
constexpr int64_t find_first_of (char c, int64_t pos=0) const
constexpr int64_t find_last_of (StringRef chars, int64_t pos=INT64_MAX) const
constexpr int64_t find_last_of (char c, int64_t pos=INT64_MAX) const
constexpr int64_t find_first_not_of (StringRef chars, int64_t pos=0) const
constexpr int64_t find_first_not_of (char c, int64_t pos=0) const
constexpr int64_t find_last_not_of (StringRef chars, int64_t pos=INT64_MAX) const
constexpr int64_t find_last_not_of (char c, int64_t pos=INT64_MAX) const
constexpr StringRef trim () const
constexpr StringRef trim (StringRef characters_to_remove) const
constexpr StringRef trim (char character_to_remove) const

Detailed Description

A common base class for StringRef and StringRefNull. This should never be used in other files. It only exists to avoid some code duplication.

Definition at line 48 of file BLI_string_ref.hh.

Constructor & Destructor Documentation

◆ StringRefBase()

Member Function Documentation

◆ back()

const char & blender::StringRefBase::back ( ) const
constexpr

Get the last char in the string. This invokes undefined behavior when the string is empty.

Definition at line 309 of file BLI_string_ref.hh.

References BLI_assert, data_, and size_.

Referenced by ui_tooltip_period_needed().

◆ begin()

◆ copy_bytes_truncated() [1/2]

void blender::StringRefBase::copy_bytes_truncated ( char * dst,
int64_t dst_size ) const

Copy the string into a char array. The copied string will be null-terminated. If it does not fit, it will be truncated.

Note
copy_utf8_truncated should be used UTF8 strings, this should be used for strings which are allowed to contain arbitrary byte sequences without a known encoding such as file-paths.

Definition at line 47 of file string_ref.cc.

References BLI_assert, copy_unsafe(), data_, and size_.

Referenced by copy_bytes_truncated(), eval_template(), and blender::tests::TEST().

◆ copy_bytes_truncated() [2/2]

template<size_t N>
void blender::StringRefBase::copy_bytes_truncated ( char(&) dst[N]) const
inline

Definition at line 246 of file BLI_string_ref.hh.

References copy_bytes_truncated(), and N.

◆ copy_unsafe()

void blender::StringRefBase::copy_unsafe ( char * dst) const
inline

Copy the string into a buffer. The buffer has to be one byte larger than the size of the string, because the copied string will be null-terminated. Only use this when you are absolutely sure that the buffer is large enough.

Definition at line 233 of file BLI_string_ref.hh.

References data_, and size_.

Referenced by copy_attr_name(), copy_bytes_truncated(), and copy_utf8_truncated().

◆ copy_utf8_truncated() [1/2]

void blender::StringRefBase::copy_utf8_truncated ( char * dst,
int64_t dst_size ) const

Copy the string into a char array. The copied string will be null-terminated. If it does not fit, it will be truncated while keeping it valid UTF8 (assuming the StringRef itself is valid UTF8).

Definition at line 28 of file string_ref.cc.

References BLI_assert, BLI_str_utf8_invalid_byte(), BLI_strncpy_utf8_rlen_unterminated(), copy_unsafe(), data_, and size_.

Referenced by blender::gpu::GPUSource::add_function(), blender::bke::greasepencil::assign_to_vertex_group(), blender::bke::greasepencil::assign_to_vertex_group_from_mask(), BKE_asset_metadata_catalog_id_set(), BKE_attribute_rename(), BKE_object_defgroup_new(), copy_utf8_truncated(), blender::geometry::copy_vertex_group_name(), customData_add_layer__internal(), CustomData_set_layer_name(), CustomData_validate_layer_name(), blender::bke::greasepencil::ensure_vertex_group(), blender::bke::bake::file_name_to_frame(), IDP_New(), IDP_NewIDPArray(), IDP_NewStringMaxSize(), blender::ed::asset::index::init_indexer_entry_from_value(), blender::bke::greasepencil::convert::legacy_object_modifier_influence(), blender::ed::greasepencil::lookup_or_add_deform_group_index(), blender::bke::forward_compat::make_socket(), blender::bke::make_socket(), blender::bke::node_add_node(), blender::bke::node_modify_socket_type(), blender::bke::node_tree_add_tree_do(), ntree_update_reroute_nodes(), blender::gpu::Shader::print_log(), blender::draw::compositor_engine::Context::set_info_message(), blender::tests::TEST(), UI_autocomplete_update_name(), ui_layout_heading_set(), and UI_search_item_add().

◆ copy_utf8_truncated() [2/2]

template<size_t N>
void blender::StringRefBase::copy_utf8_truncated ( char(&) dst[N]) const
inline

Definition at line 241 of file BLI_string_ref.hh.

References copy_utf8_truncated(), and N.

◆ data()

const char * blender::StringRefBase::data ( ) const
constexpr

Return a pointer to the start of the string.

Definition at line 194 of file BLI_string_ref.hh.

References data_.

Referenced by add_render_result_meta_data(), blender::ed::space_node::animation_basepath_change_new(), blender::bke::asset_blendfile_path_for_save(), blender::asset_system::asset_definition_default_file_path_from_dir(), BKE_fcurve_rnapath_set(), BKE_panel_layout_panel_state_ensure(), blender::animrig::Channelbag::channel_group_create(), blender::nodes::node_composite_image_cc::ImageOperation::compute_output(), blender::animrig::create_fcurve_for_channel(), cryptomatte_determine_identifier(), blender::string_search::damerau_levenshtein_distance(), blender::ed::object::dash_modifier_segment_add_exec(), data_transfer_mesh_attributes_transfer_active_color_string(), data_transfer_mesh_attributes_transfer_default_color_string(), do_versions_after_linking_440(), blender::string_search::extract_normalized_words(), blender::ed::spreadsheet::GeometryDataSource::foreach_default_column_ids(), blender::string_search::get_fuzzy_match_errors(), GPU_vertformat_safe_attr_name(), blender::ed::asset::index::init_indexer_entry_from_value(), blender::bke::greasepencil::LayerMask::LayerMask(), legacy_socket_move_to_interface(), blender::bke::node_interface::make_panel(), blender::bke::node_interface::make_socket(), blender::string_search::match_word_initials(), blender::io::obj::MTLParser::MTLParser(), blender::asset_system::utils::normalize_directory_path(), blender::ed::object::bake_simulation::PathStringEquality::operator()(), blender::ed::object::bake_simulation::PathStringHash::operator()(), blender::operator<<(), blender::io::obj::parse_keyword(), blender::io::ply::parse_keyword(), blender::deg::RootPChanMap::print_debug(), blender::ed::sculpt_paint::greasepencil::process_stroke_weights(), pyrna_struct_getattro(), blender::ed::vse::sequencer_add_effect_strip_exec(), blender::ed::vse::sequencer_reassign_inputs_exec(), blender::bke::greasepencil::Layer::set_parent_bone_name(), blender::io::usd::set_string_prop(), blender::bke::greasepencil::Layer::set_view_layer_name(), blender::ed::spreadsheet::spreadsheet_filter_panel_draw_header(), blender::nodes::node_fn_find_in_string_cc::string_find(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), StringRefBase(), blender::bke::greasepencil::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::ed::object::time_modifier_segment_add_exec(), UI_but_placeholder_set(), ui_draw_preview_item_stateless(), ui_item_name_add_colon(), ui_item_name_add_colon(), UI_panel_drawname_set(), versioning_fix_socket_subtype_idnames(), and blender::io::obj::OBJWriter::write_mtllib_name().

◆ end()

◆ endswith()

◆ find() [1/2]

◆ find() [2/2]

int64_t blender::StringRefBase::find ( StringRef str,
int64_t pos = 0 ) const
constexpr

Definition at line 330 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), pos, and str.

◆ find_first_not_of() [1/2]

int64_t blender::StringRefBase::find_first_not_of ( char c,
int64_t pos = 0 ) const
constexpr

Definition at line 378 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), and pos.

◆ find_first_not_of() [2/2]

int64_t blender::StringRefBase::find_first_not_of ( StringRef chars,
int64_t pos = 0 ) const
constexpr

◆ find_first_of() [1/2]

int64_t blender::StringRefBase::find_first_of ( char c,
int64_t pos = 0 ) const
constexpr

Definition at line 354 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), and pos.

◆ find_first_of() [2/2]

◆ find_last_not_of() [1/2]

int64_t blender::StringRefBase::find_last_not_of ( char c,
int64_t pos = INT64_MAX ) const
constexpr

Definition at line 390 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), and pos.

◆ find_last_not_of() [2/2]

int64_t blender::StringRefBase::find_last_not_of ( StringRef chars,
int64_t pos = INT64_MAX ) const
constexpr

Definition at line 384 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), and pos.

Referenced by trim().

◆ find_last_of() [1/2]

int64_t blender::StringRefBase::find_last_of ( char c,
int64_t pos = INT64_MAX ) const
constexpr

Definition at line 366 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), and pos.

◆ find_last_of() [2/2]

int64_t blender::StringRefBase::find_last_of ( StringRef chars,
int64_t pos = INT64_MAX ) const
constexpr

◆ front()

const char & blender::StringRefBase::front ( ) const
constexpr

Get the first char in the string. This invokes undefined behavior when the string is empty.

Definition at line 300 of file BLI_string_ref.hh.

References BLI_assert, data_, and size_.

Referenced by blender::bke::cryptomatte::manifest::from_manifest().

◆ index_range()

IndexRange blender::StringRefBase::index_range ( ) const
constexpr

Definition at line 228 of file BLI_string_ref.hh.

References size_.

◆ is_empty()

bool blender::StringRefBase::is_empty ( ) const
constexpr

Definition at line 186 of file BLI_string_ref.hh.

References size_.

Referenced by blender::animrig::legacy::action_fcurves_remove(), blender::ui::BasicTreeViewItem::add_label(), blender::nodes::DeclarationListBuilder::add_socket(), blender::ed::object::bake_simulation::bake_simulation_get_path_users(), BKE_attribute_calc_unique_name(), BKE_attribute_find(), BKE_attribute_remove(), BKE_attribute_rename(), BKE_attribute_search(), BKE_defgroup_listbase_name_find(), BKE_main_namemap_remove_id(), BKE_object_defgroup_find_name(), BKE_paint_brush_type_default_reference(), BLT_is_default_context(), blender::ed::spreadsheet::GreasePencilLayerViewItem::build_row(), blender::ed::spreadsheet::InstanceReferenceViewItem::build_row(), calculate_selection_fcurve_bounds(), blender::ocio::cleanup_description(), colormanage_compatible_look(), blender::gpu::ShaderCompiler::compile(), blender::io::usd::USDMaterialReader::convert_usd_primvar_reader_float2(), blender::io::usd::USDMaterialReader::convert_usd_transform_2d(), blender::io::usd::USDMaterialReader::convert_usd_uv_texture(), copy_dupli_context(), blender::ed::asset::shelf::create_activate_operator_params(), blender::ed::space_node::create_description_inspection_string(), blender::io::obj::create_geometry(), blender::nodes::FormatStringItemsAccessor::custom_initial_name(), customData_add_layer__internal(), CustomData_validate_layer_name(), blender::nodes::draw_bake_data_block_list_item(), blender::nodes::draw_common_bake_settings(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell(), ED_armature_bone_rename(), blender::nodes::GeoNodeExecParams::ensure_absolute_path(), blender::draw::ensure_attributes(), exr_channels_in_multi_part_file(), blender::animrig::Channelbag::fcurve_create_many(), blender::animrig::fcurve_matches_collection_path(), filelist_readjob_all_asset_library(), blender::gpu::shader::ShaderCreateInfo::finalize(), blender::nodes::node_fn_format_string_cc::FormatInputsLookup::find_next_input_index(), blender::nodes::find_output_attributes_to_store(), blender::io::usd::USDMaterialReader::follow_connection(), blender::nodes::node_fn_format_string_cc::format_strings(), blender::gpu::GLShader::fragment_interface_declare(), blender::gpu::VKShader::fragment_interface_declare(), blender::bke::cryptomatte::manifest::from_manifest(), blender::io::ply::generate_vertex_map(), blender::animrig::generic_slot_for_autoassign(), blender::asset_system::AssetLibraryService::get_asset_library(), blender::bke::FileHandlerType::get_default_filename(), blender::io::usd::NodePlacementContext::get_key(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), get_uv_attribute(), blender::gpu::shader::gpu_shader_dependency_get_builtins(), blender::nodes::node_shader_math_cc::gpu_shader_get_name(), GPU_shader_preprocess_source(), blender::draw::gpencil::grease_pencil_layer_cache_add(), blender::io::csv::import_csv_as_pointcloud(), blender::gpu::VKShader::init(), blender::gpu::tests::ShaderSpecializationConst::init_shader(), blender::ed::object::bake_simulation::initialize_modifier_bake_directory_if_necessary(), is_colorspace_same_as_display(), blender::gpu::shader::is_vulkan_compatible_interface(), blender::io::ply::load_plydata(), blender::asset_system::AssetLibraryService::lookup_on_disk_library(), blender::bke::node_interface::make_panel(), blender::io::usd::make_safe_name(), blender::bke::node_interface::make_socket(), blender::draw::mesh_cd_calc_used_gpu_layers(), blender::nodes::node_geo_combine_bundle_cc::node_geo_exec(), blender::nodes::node_geo_separate_bundle_cc::node_geo_exec(), blender::bke::node_socket_short_label(), blender::asset_system::utils::normalize_directory_path(), blender::ed::outliner::outliner_draw_get_warning_tree_element(), blender::ed::outliner::outliner_draw_get_warning_tree_element_subtree(), blender::ed::outliner::outliner_draw_overrides_rna_buts(), blender::ed::outliner::outliner_draw_warning_column(), paint_brush_set_default_reference(), blender::io::obj::OBJParser::parse(), blender::io::obj::MTLParser::parse_and_store(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_file(), parse_format_specifier(), blender::gpu::MTLLogParser::parse_line(), pchan_duplicate_map(), pgettext(), blender::gpu::MSLGeneratorInterface::prepare_from_createinfo(), blender::gpu::print_interface(), print_interface(), blender::gpu::Shader::print_log(), uiLayout::prop(), pyrna_struct_getattro(), blender::nodes::node_fn_replace_string_cc::replace_all(), rna_path_from_ptr_to_property_index_ex(), rna_prepend_real_ID_path(), blender::ed::vse::sequencer_add_effect_strip_exec(), blender::ed::vse::sequencer_reassign_inputs_exec(), blender::bke::greasepencil::Layer::set_parent_bone_name(), blender::bke::greasepencil::Layer::set_view_layer_name(), blender::animrig::Action::slot_add_for_id(), blender::ed::spreadsheet::spreadsheet_filter_panel_draw(), blender::ed::spreadsheet::spreadsheet_filter_panel_draw_header(), blender::io::obj::OBJMesh::store_uv_coords_and_indices(), blender::nodes::node_fn_find_in_string_cc::string_count(), blender::nodes::node_fn_find_in_string_cc::string_find(), blender::ui::template_asset_shelf_popover(), blender::io::TEST(), blender::io::TEST(), ui_block_view_find_matching_in_old_block_impl(), ui_block_view_persistent_state_restore(), ui_but_event_property_operator_string(), UI_but_placeholder_set(), UI_but_string_get_tooltip(), ui_draw_preview_item_stateless(), ui_item_array(), ui_item_menu(), ui_item_rna_size(), ui_item_with_label(), UI_popup_block_template_confirm_op(), ui_popup_menu_create_block(), ui_text_icon_width_ex(), ui_tooltip_period_needed(), uiItemEnumR_string_prop(), uiItemL_(), uilist_item_tooltip_func(), uiTemplateStatusInfo(), unique_layer_group_name(), blender::nodes::materialx::NodeGraph::unique_node_name(), unique_node_name(), blender::bke::pbvh::pixels::update_pixels(), blender::nodes::FormatStringItemsAccessor::validate_name(), blender::fn::multi_function::ProcedureDotExport::variable_to_string(), version_node_socket_id_delim(), blender::gpu::GLShader::vertex_interface_declare(), blender::gpu::VKShader::vertex_interface_declare(), blender::ed::asset::visit_library_catalogs_catalog_for_search(), wm_drag_draw_tooltip(), WM_gizmogrouptype_find(), WM_gizmotype_find(), WM_menutype_find(), WM_operator_name_call_ptr_with_depends_on_cursor(), WM_paneltype_find(), WM_uilisttype_find(), and blender::io::obj::OBJWriter::write_vertex_coords().

◆ operator Span< char >()

blender::StringRefBase::operator Span< char > ( ) const
constexpr

Definition at line 199 of file BLI_string_ref.hh.

References data_, and size_.

◆ operator std::string()

blender::StringRefBase::operator std::string ( ) const
inline

Implicitly convert to std::string. This is convenient in most cases, but you have to be a bit careful not to convert to std::string accidentally.

Definition at line 208 of file BLI_string_ref.hh.

References data_, and size_.

◆ operator std::string_view()

blender::StringRefBase::operator std::string_view ( ) const
constexpr

Definition at line 213 of file BLI_string_ref.hh.

References data_, and size_.

◆ rfind() [1/2]

◆ rfind() [2/2]

int64_t blender::StringRefBase::rfind ( StringRef str,
int64_t pos = INT64_MAX ) const
constexpr

Definition at line 342 of file BLI_string_ref.hh.

References BLI_assert, blender::index_or_npos_to_int64(), pos, and str.

◆ size()

int64_t blender::StringRefBase::size ( ) const
constexpr

Return the (byte-)length of the referenced string, without any null-terminator.

Definition at line 181 of file BLI_string_ref.hh.

References size_.

Referenced by UniqueName_Map::add_name(), blender::ed::space_node::animation_basepath_change_new(), blender::bke::asset_blendfile_path_for_save(), blender::bke::cryptomatte::BKE_cryptomatte_extract_layer_name(), BKE_fcurve_rnapath_set(), BKE_main_global_namemap_contain_name(), BKE_main_namemap_contain_name(), BKE_panel_layout_panel_state_ensure(), BKE_uv_map_edge_select_name_get(), BKE_uv_map_pin_name_get(), BKE_uv_map_vert_select_name_get(), BLI_string_replace(), BLI_string_split_name_number(), blender::gpu::shader::ShaderCreateInfo::compilation_constant(), copy_attr_name(), blender::gpu::ShaderInterface::copy_input_name(), blender::animrig::create_fcurve_for_channel(), cryptomatte_determine_identifier(), blender::string_search::damerau_levenshtein_distance(), data_transfer_mesh_attributes_transfer_active_color_string(), data_transfer_mesh_attributes_transfer_default_color_string(), blender::nodes::draw_property_for_socket(), blender::StringRef::drop_known_prefix(), blender::StringRef::drop_known_suffix(), blender::animrig::fcurve_matches_collection_path(), fileentry_uiname(), blender::nodes::node_fn_format_string_cc::FormatInputsLookup::find_next_input_index(), blender::string_search::get_best_word_index_that_startswith(), blender::string_search::get_fuzzy_match_errors(), blender::gpu::GLShaderInterface::GLShaderInterface(), GPU_vertformat_safe_attr_name(), icon_source_edit_cb(), id_name_final_build(), blender::gpu::shader::ShaderCreateInfo::image(), blender::bke::greasepencil::LayerMask::LayerMask(), blender::bke::node_interface::make_panel(), blender::io::usd::make_safe_name(), blender::bke::node_interface::make_socket(), blender::string_search::match_word_initials(), next_token(), blender::asset_system::utils::normalize_directory_path(), blender::asset_system::utils::normalize_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), blender::operator<<(), parse_format_specifier(), blender::io::obj::parse_keyword(), blender::io::ply::parse_keyword(), parse_template(), blender::gpu::shader::ShaderCreateInfo::push_constant(), pyrna_struct_getattro(), blender::bke::cryptomatte::manifest::quoted_string_len_(), UniqueName_Map::remove_full_name(), blender::gpu::shader::ShaderCreateInfo::sampler(), blender::ed::curves::selection_attribute_writer_by_name(), blender::io::usd::set_id_props_from_prim(), blender::bke::greasepencil::Layer::set_parent_bone_name(), blender::io::usd::set_string_prop(), blender::bke::greasepencil::Layer::set_view_layer_name(), blender::animrig::Action::slot_display_name_define(), blender::gpu::shader::ShaderCreateInfo::specialization_constant(), blender::gpu::shader::ShaderCreateInfo::storage_buf(), blender::nodes::node_fn_find_in_string_cc::string_count(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), StringRefBase(), blender::StringRefNull::StringRefNull(), blender::StringRefNull::StringRefNull(), svg_replace_color_attributes(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), UI_autocomplete_update_name(), ui_block_add_view_impl(), UI_but_placeholder_set(), ui_but_tip_len_only_first_line(), ui_draw_preview_item_stateless(), ui_item_name_add_colon(), ui_item_name_add_colon(), UI_panel_drawname_set(), ui_tooltip_data_from_button_or_extra_icon(), uiTemplateStatusInfo(), blender::gpu::shader::ShaderCreateInfo::uniform_buf(), version_node_socket_id_delim(), and blender::gpu::shader::ShaderCreateInfo::vertex_in().

◆ startswith()

bool blender::StringRefBase::startswith ( StringRef prefix) const
constexpr

Return true when the string starts with the given prefix.

Definition at line 254 of file BLI_string_ref.hh.

References data_, i, and size_.

Referenced by blender::bke::allow_procedural_attribute_access(), blender::bke::attribute_name_is_anonymous(), blender::deg::DepsgraphRelationBuilder::build_driver_variables(), CustomData_name_maxncpy_calc(), blender::deg::data_path_maybe_shared(), do_versions_after_linking_440(), blender::StringRef::drop_known_prefix(), exr_channels_in_multi_part_file(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_hash(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_manifest(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_names(), blender::io::usd::USDMaterialReader::follow_connection(), blender::io::obj::geom_update_smooth_group(), blender::string_search::get_best_word_index_that_startswith(), blender::nodes::node_fn_match_string_cc::get_multi_function(), blender::bke::get_tag_modified_function(), blender::nodes::group_input_insert_link(), blender::nodes::group_output_insert_link(), blender::asset_system::AssetCatalogPath::is_contained_in(), keymap_update_brushes_handle_add_item(), MOD_lineart_gpencil_generate_v3(), blender::nodes::node_geo_remove_attribute_cc::node_geo_exec(), blender::ed::space_node::node_get_extra_info(), blender::io::obj::parse_texture_map(), blender::io::obj::parse_texture_option(), blender::asset_system::AssetCatalogDefinitionFile::parse_version_line(), blender::tests::TEST(), ui_but_event_property_operator_string(), ui_tooltip_data_from_button_or_extra_icon(), blender::bke::cryptomatte::tests::validate_cryptomatte_session_from_stamp_data(), version_bonecollection_anim(), version_node_socket_id_delim(), blender::bke::bake::DiskBlobWriter::write_as_stream(), and blender::bke::bake::MemoryBlobWriter::write_as_stream().

◆ substr()

StringRef blender::StringRefBase::substr ( int64_t start,
int64_t size = INT64_MAX ) const
constexpr

Return a new StringRef containing only a sub-string of the original string. This invokes undefined if the start or max_size is negative.

Definition at line 288 of file BLI_string_ref.hh.

References BLI_assert, data_, INT64_MAX, and size_.

Referenced by blender::bke::cryptomatte::BKE_cryptomatte_extract_layer_name(), BKE_path_template_error_to_string(), BLI_string_split_name_number(), copy_attr_name(), blender::ocio::GPUShaderBinder::create_gpu_shader(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_hash(), blender::string_search::extract_normalized_words(), blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert(), blender::ed::animation::flip_names(), blender::nodes::node_fn_format_string_cc::format_strings(), blender::bke::cryptomatte::manifest::from_manifest(), blender::animrig::generic_slot_for_autoassign(), blender::ed::asset::index::init_indexer_entry_from_value(), blender::locale::MessageKey::MessageKey(), next_token(), blender::nodes::node_geo_remove_attribute_cc::node_geo_exec(), blender::asset_system::utils::normalize_path(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_line(), parse_format_specifier(), blender::asset_system::AssetCatalogDefinitionFile::parse_version_line(), blender::gpu::Shader::print_log(), blender::gpu::tests::print_test_line(), blender::asset_system::AssetCatalogPath::rebase(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_exploded_path(), blender::io::usd::set_id_props_from_prim(), blender::ocio::split_view_specific_look(), blender::asset_system::tests::TEST(), blender::tests::TEST(), trim(), ui_but_drawstr_without_sep_char(), ui_tooltip_data_from_button_or_extra_icon(), and unescape().

◆ trim() [1/3]

◆ trim() [2/3]

StringRef blender::StringRefBase::trim ( char character_to_remove) const
constexpr

Return a new StringRef that does not contain leading and trailing white-space.

Definition at line 404 of file BLI_string_ref.hh.

References trim().

◆ trim() [3/3]

StringRef blender::StringRefBase::trim ( StringRef characters_to_remove) const
constexpr

Return a new StringRef that removes all the leading and trailing characters that occur in characters_to_remove.

Definition at line 413 of file BLI_string_ref.hh.

References BLI_assert_msg, find_first_not_of(), find_last_not_of(), not_found, and substr().

Member Data Documentation

◆ data_

◆ not_found

int64_t blender::StringRefBase::not_found = -1
staticconstexpr

◆ size_


The documentation for this class was generated from the following files: