|
Blender V5.0
|
#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 |
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.
|
constexprprotected |
Definition at line 173 of file BLI_string_ref.hh.
References data(), data_, size(), and size_.
Referenced by blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRef::StringRef(), blender::StringRefNull::StringRefNull(), blender::StringRefNull::StringRefNull(), and blender::StringRefNull::StringRefNull().
|
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().
|
constexpr |
Definition at line 218 of file BLI_string_ref.hh.
References data_.
Referenced by BLI_string_split_name_number(), blender::io::drop_whitespace(), blender::nodes::node_fn_format_string_cc::FormatInputsLookup::find_next_input_index(), blender::string_search::get_fuzzy_match_errors(), blender::io::obj::MTLParser::parse_and_store(), blender::io::parse_float(), blender::io::parse_int(), blender::gpu::GPUSource::print_error(), blender::io::read_next_line(), blender::gpu::GPULogParser::source_line_get(), and blender::StringRef::StringRef().
| 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.
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().
|
inline |
Definition at line 246 of file BLI_string_ref.hh.
References copy_bytes_truncated(), and N.
|
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.
Referenced by blender::bke::path_templates::VariableMap::add_path_up_to_file(), copy_bytes_truncated(), and copy_utf8_truncated().
| 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 BKE_asset_metadata_catalog_id_set(), BKE_attribute_rename(), copy_utf8_truncated(), blender::geometry::copy_vertex_group_name(), blender::bke::bake::file_name_to_frame(), blender::ed::asset::index::init_indexer_entry_from_value(), blender::bke::greasepencil::convert::legacy_object_modifier_influence(), 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(), and blender::tests::TEST().
|
inline |
Definition at line 241 of file BLI_string_ref.hh.
References copy_utf8_truncated(), and N.
|
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::nodes::node_composite_image_cc::ImageOperation::compute_output(), blender::animrig::create_fcurve_for_channel(), blender::string_search::damerau_levenshtein_distance(), data_transfer_mesh_attributes_transfer_active_color_string(), data_transfer_mesh_attributes_transfer_default_color_string(), do_versions_after_linking_440(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_multi_layer(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_single_layer_multi_view_exr(), blender::string_search::extract_normalized_words(), blender::ed::spreadsheet::GeometryDataSource::foreach_default_column_ids(), blender::string_search::get_fuzzy_match_errors(), blender::bke::id_hash::get_id_shallow_hash(), blender::draw::compositor_engine::Context::get_input(), blender::render::Context::get_input(), GPU_vertformat_safe_attr_name(), blender::ed::asset::index::init_indexer_entry_from_value(), 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::ed::space_node::node_swap_group_asset_invoke(), 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(), UI_but_placeholder_set(), versioning_fix_socket_subtype_idnames(), WM_msg_publish_remote_io(), WM_msg_subscribe_remote_io(), and blender::io::obj::OBJWriter::write_mtllib_name().
|
constexpr |
Definition at line 223 of file BLI_string_ref.hh.
Referenced by blender::bke::path_templates::VariableMap::add_path_up_to_file(), BLI_string_split_name_number(), blender::io::drop_whitespace(), blender::nodes::node_fn_format_string_cc::FormatInputsLookup::find_next_input_index(), blender::string_search::get_fuzzy_match_errors(), blender::io::obj::MTLParser::parse_and_store(), blender::io::parse_float(), blender::io::parse_int(), blender::gpu::GPUSource::print_error(), blender::io::read_next_line(), and blender::gpu::GPULogParser::source_line_get().
|
constexpr |
Return true when the string ends with the given suffix.
Definition at line 270 of file BLI_string_ref.hh.
References data_, i, and size_.
Referenced by blender::nodes::Bundle::add_path_override(), blender::eevee::Cryptomatte::begin_sync(), blo_do_versions_440(), create_mirrored_name(), blender::deg::data_path_maybe_shared(), blender::StringRef::drop_known_suffix(), exr_channels_in_multi_part_file(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_manifest(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_names(), blender::bke::bake::find_sorted_meta_files(), blender::ed::space_node::gather_socket_link_operations(), IMB_colormanagement_space_to_icc_profile(), blender::ed::object::is_smooth_by_angle_modifier(), blender::asset_system::AssetRepresentation::library_relative_identifier(), blender::gpu::match_renderer(), blender::nodes::node_fn_match_string_cc::node_build_multi_function(), blender::ed::animation::pastebuf_match_path_property(), blender::gpu::Shader::print_log(), blender::nodes::node_geo_remove_attribute_cc::remove_attributes_recursive(), save_set_filepath(), blender::tests::TEST(), version_mesh_crease_generic(), and wm_file_write_check_with_report_on_failure().
The behavior of those functions matches the standard library implementation of std::string_view.
Definition at line 324 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
Referenced by blender::gpu::GPUSource::add_function(), blender::gpu::GPULogParser::at_any(), colormanage_find_matching_view_name(), blender::animrig::default_channel_group_for_path(), blender::gpu::GPULogParser::filename_get(), blender::nodes::node_fn_format_string_cc::format_strings(), blender::gpu::VKShader::fragment_interface_declare(), blender::io::obj::geom_update_group(), blender::string_search::get_fuzzy_match_errors(), getname_anim_fcurve_for_slot(), blender::gpu::tests::gpu_shader_lib_test(), blender::gpu::GPU_vulkan_is_supported_driver(), icon_source_edit_cb(), blender::nodes::is_valid_key(), blender::gpu::match_renderer(), blender::locale::MessageKey::MessageKey(), blender::nodes::node_fn_match_string_cc::node_build_multi_function(), blender::ed::space_node::node_find_update_fn(), blender::gpu::MTLLogParser::parse_line(), blender::gpu::tests::print_test_line(), blender::ocio::split_view_specific_look(), blender::nodes::node_fn_find_in_string_cc::string_count(), blender::nodes::node_fn_find_in_string_cc::string_find(), svg_replace_color_attributes(), ui_but_tip_len_only_first_line(), ui_tooltip_period_needed(), and view_filter_for_look().
Definition at line 330 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), pos, and str.
Definition at line 378 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
|
constexpr |
Definition at line 372 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
Referenced by parse_format_specifier(), blender::bke::cryptomatte::manifest::skip_whitespaces_(), and trim().
Definition at line 354 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
Definition at line 348 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
Referenced by blender::nodes::Bundle::add_path_override(), blender::gpu::shader::ShaderCreateInfo::ResourceString::array_offset(), BKE_path_contains_template_syntax(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_hash(), blender::asset_system::AssetLibraryService::normalize_asset_weak_reference_relative_asset_identifier(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_line(), parse_format_specifier(), blender::nodes::split_path(), blender::tests::TEST(), and blender::tests::TEST().
|
constexpr |
Definition at line 390 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
|
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().
Definition at line 366 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
|
constexpr |
Definition at line 360 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
Referenced by blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_hash(), parse_format_specifier(), and blender::ed::geometry::run_node_group_get_name().
|
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().
|
constexpr |
Definition at line 228 of file BLI_string_ref.hh.
References size_.
|
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::Bundle::add_path_override(), blender::bke::path_templates::VariableMap::add_path_up_to_file(), blender::nodes::DeclarationListBuilder::add_socket(), blender::ed::object::bake_simulation::bake_simulation_get_path_users(), BKE_attribute_rename(), BLT_is_default_context(), calculate_selection_fcurve_bounds(), blender::ocio::cleanup_description(), colormanage_check_display_settings(), colormanage_check_view_settings(), 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_asset_operator_params(), blender::nodes::FormatStringItemsAccessor::custom_initial_name(), blender::nodes::draw_bake_data_block_list_item(), blender::nodes::draw_common_bake_settings(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell_value(), ED_armature_bone_rename(), blender::nodes::GeoNodeExecParams::ensure_absolute_path(), 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::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(), IMB_colormanagement_space_from_cicp(), IMB_colormanagement_space_to_cicp(), IMB_colormanagement_space_to_icc_profile(), IMB_colormanagement_validate_settings(), imb_colormanagement_working_space_set_from_matrix(), IMB_exr_add_channels(), 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::asset_system::AssetLibraryService::lookup_on_disk_library(), blender::bke::node_interface::make_panel(), blender::bke::node_interface::make_socket(), blender::ed::space_node::node_find_update_fn(), blender::bke::node_socket_short_label(), blender::asset_system::utils::normalize_directory_path(), openexr_header_metadata_colorspace(), 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::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_enum(), pyrna_struct_getattro(), RE_bake_pixels_populate(), RE_generate_texturemargin_adjacentfaces(), 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::nodes::split_path(), blender::ed::spreadsheet::spreadsheet_filter_panel_draw(), blender::ed::spreadsheet::spreadsheet_filter_panel_draw_header(), blender::ed::space_node::std_node_socket_draw(), 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::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_popup_block_template_confirm_op(), ui_popup_menu_create_block(), ui_tooltip_period_needed(), uilist_item_tooltip_func(), blender::nodes::materialx::NodeGraph::unique_node_name(), blender::bke::pbvh::pixels::update_pixels(), 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(), view_filter_for_look(), 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(), and WM_uilisttype_find().
|
constexpr |
Definition at line 199 of file BLI_string_ref.hh.
|
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.
|
constexpr |
Definition at line 213 of file BLI_string_ref.hh.
Definition at line 336 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), and pos.
Referenced by BLI_string_split_name_number(), blender::gpu::GPULogParser::filename_get(), blender::io::usd::USDMaterialReader::follow_connection(), blender::bke::bake::get_blend_file_name(), blender::asset_system::AssetCatalogPath::name(), blender::asset_system::AssetLibraryService::rfind_blendfile_extension(), and blender::gpu::GPULogParser::source_line_get().
Definition at line 342 of file BLI_string_ref.hh.
References BLI_assert, blender::index_or_npos_to_int64(), pos, and str.
|
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::bke::path_templates::VariableMap::add_path_up_to_file(), 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_panel_layout_panel_state_ensure(), BKE_uv_map_pin_name_get(), BLI_string_replace(), BLI_string_split_name_number(), blender::animrig::create_fcurve_for_channel(), 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::gpu::GPULogParser::filename_get(), 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::bke::id_hash::get_id_shallow_hash(), GPU_vertformat_safe_attr_name(), icon_source_edit_cb(), id_name_final_build(), IMB_exr_add_channels(), blender::bke::node_interface::make_panel(), 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(), pyrna_struct_getattro(), blender::bke::cryptomatte::manifest::quoted_string_len_(), UniqueName_Map::remove_full_name(), blender::gpu::shader::ShaderCreateInfo::ResourceString::ResourceString(), 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::GPULogParser::source_line_get(), 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_block_add_view_impl(), UI_but_placeholder_set(), ui_but_tip_len_only_first_line(), UI_tooltip_color_field_add(), ui_tooltip_color_string(), ui_tooltip_data_from_button_or_extra_icon(), WM_msg_publish_remote_io(), and WM_msg_subscribe_remote_io().
|
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::deg::DepsgraphRelationBuilder::build_driver_variables(), colormanage_check_display_settings(), colormanage_find_matching_view_name(), 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::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_fn_match_string_cc::node_build_multi_function(), 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::nodes::node_geo_remove_attribute_cc::remove_attributes_recursive(), 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().
|
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 add_exr_compositing_result(), blender::nodes::Bundle::add_path_override(), blender::bke::cryptomatte::BKE_cryptomatte_extract_layer_name(), BKE_path_template_error_to_string(), BLI_string_split_name_number(), colormanage_find_matching_view_name(), blender::ocio::GPUShaderBinder::create_gpu_shader(), blender::nodes::node_geo_viewer_cc::draw_string(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_hash(), blender::string_search::extract_normalized_words(), blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert(), blender::gpu::GPULogParser::filename_get(), 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::gpu::GPULogParser::source_line_get(), blender::nodes::split_path(), blender::ocio::split_view_specific_look(), blender::gpu::shader::ShaderCreateInfo::ResourceString::str_only_array(), blender::asset_system::tests::TEST(), blender::tests::TEST(), trim(), ui_but_drawstr_without_sep_char(), ui_tooltip_data_from_button_or_extra_icon(), unescape(), and view_filter_for_look().
|
constexpr |
Definition at line 396 of file BLI_string_ref.hh.
References trim().
Referenced by BKE_asset_metadata_catalog_id_set(), blender::asset_system::AssetCatalogPath::cleanup_component(), blender::ocio::cleanup_description(), blender::io::obj::MTLParser::parse_and_store(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_file(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_line(), blender::io::obj::parse_texture_map(), blender::io::fbx::read_ufbx_property(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), trim(), trim(), and wm_block_dialog_create().
|
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().
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().
|
protected |
Definition at line 50 of file BLI_string_ref.hh.
Referenced by back(), begin(), blender::StringRefNull::c_str(), copy_bytes_truncated(), copy_unsafe(), copy_utf8_truncated(), data(), blender::StringRef::drop_prefix(), blender::StringRef::drop_suffix(), end(), endswith(), front(), operator Span< char >(), operator std::string(), operator std::string_view(), blender::StringRef::operator[](), blender::StringRefNull::operator[](), startswith(), StringRefBase(), blender::StringRefNull::StringRefNull(), and substr().
|
staticconstexpr |
Similar to #string_view::npos, but signed.
Definition at line 57 of file BLI_string_ref.hh.
Referenced by blender::string_search::StringSearchBase::add_impl(), blender::nodes::Bundle::add_path_override(), blender::gpu::GPULogParser::at_any(), BLI_string_split_name_number(), blender::animrig::default_channel_group_for_path(), blender::bke::cryptomatte::CryptomatteStampDataCallbackData::extract_layer_hash(), blender::nodes::node_fn_format_string_cc::format_strings(), blender::nodes::node_fn_format_string_cc::format_without_format_specifier(), blender::bke::bake::get_blend_file_name(), blender::string_search::get_fuzzy_match_errors(), getname_anim_fcurve_for_slot(), blender::gpu::GPU_vulkan_is_supported_driver(), blender::index_or_npos_to_int64(), blender::nodes::is_valid_key(), make(), blender::gpu::match_renderer(), blender::locale::MessageKey::MessageKey(), blender::nodes::node_fn_match_string_cc::node_build_multi_function(), blender::ed::space_node::node_find_update_fn(), blender::asset_system::AssetLibraryService::normalize_asset_weak_reference_relative_asset_identifier(), blender::asset_system::utils::normalize_path(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_line(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_exploded_path(), blender::asset_system::AssetLibraryService::rfind_blendfile_extension(), blender::bke::cryptomatte::manifest::skip_whitespaces_(), blender::nodes::split_path(), blender::nodes::node_fn_find_in_string_cc::string_count(), trim(), ui_but_tip_len_only_first_line(), ui_popup_string_hash(), ui_tooltip_period_needed(), and blender::csv_parse::unescape_field().
|
protected |
Definition at line 51 of file BLI_string_ref.hh.
Referenced by back(), copy_bytes_truncated(), copy_unsafe(), copy_utf8_truncated(), blender::StringRef::drop_prefix(), blender::StringRef::drop_suffix(), end(), endswith(), front(), index_range(), is_empty(), operator Span< char >(), operator std::string(), operator std::string_view(), blender::StringRef::operator[](), blender::StringRefNull::operator[](), size(), startswith(), StringRefBase(), blender::StringRefNull::StringRefNull(), and substr().