Blender V5.3
blender::StringRef Class Reference

#include <BLI_string_ref.hh>

Inherits blender::blender::StringRefBase.

Public Member Functions

constexpr StringRef ()
constexpr StringRef (StringRefNull other)
constexpr StringRef (const char *str)
constexpr StringRef (const char *str, int64_t length)
constexpr StringRef (const char *begin, const char *one_after_end)
constexpr StringRef (std::string_view view)
constexpr StringRef (Span< char > span)
 StringRef (const std::string &str)
constexpr StringRef drop_prefix (int64_t n) const
constexpr StringRef drop_known_prefix (StringRef prefix) const
constexpr StringRef drop_suffix (int64_t n) const
constexpr StringRef drop_known_suffix (StringRef suffix) const
constexpr char operator[] (int64_t index) const
Public Member Functions inherited from blender::blender::StringRefBase
void copy_utf8_truncated (char *dst, int64_t dst_size) const
void copy_bytes_truncated (char *dst, int64_t dst_size) const
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
constexpr StringRef trim_left () const
constexpr StringRef trim_left (StringRef characters_to_remove) const
constexpr StringRef trim_right () const
constexpr StringRef trim_right (StringRef characters_to_remove) const

Additional Inherited Members

Public Types inherited from blender::blender::StringRefBase
using value_type = char
Static Public Attributes inherited from blender::blender::StringRefBase
static constexpr int64_t not_found = -1
constexpr StringRefBase (const char *data, int64_t size)
Protected Attributes inherited from blender::blender::StringRefBase
const char * data_
int64_t size_

Detailed Description

References a const char array. It might not be null terminated.

StringRef can be compared with StringRef and StringRefNull.

Note
It is valid to pass nullptr to the constructor, as it can be used to indicate an empty string.

Definition at line 165 of file BLI_string_ref.hh.

Constructor & Destructor Documentation

◆ StringRef() [1/8]

Referenced by blender::bke::path_templates::VariableMap::add_filename_only(), blender::bke::cryptomatte::CryptomatteLayer::add_ID(), blender::bke::compositor::add_passes_used_by_cryptomatte_node(), blender::ui::attribute_data_type_string(), blender::ui::attribute_domain_string(), blender::BKE_add_template_variables_general(), blender::BKE_attribute_remove(), blender::BKE_attribute_rename(), blender::BKE_image_render_write_exr(), blender::BKE_modifiers_persistent_uid_init(), blender::BKE_viewer_path_elem_equal(), blender::BLO_write_file_impl(), blender::ed::space_node::SocketTooltipBuilder::build(), blender::ui::but_event_property_operator_string(), blender::ui::button_drawstr_without_sep_char(), blender::ed::asset::catalog_path_skipped_prefix(), blender::ed::asset::catalog_rename(), blender::ed::object::collection_importer_add_ensure(), blender::ui::colorspaces_menu_draw(), blender::ui::MarkdownLayouter::compute_layout(), blender::console_cursor_region_xy_get(), blender::ed::geometry::convert_attribute(), blender::create_from_shader_node_tree(), blender::create_mirrored_name(), blender::CustomData_free_layer_named(), blender::data_transfer_layersmapping_cdlayers(), blender::data_transfer_layersmapping_cdlayers_multisrc_to_dst(), blender::nodes::node_composite_render_layer_cc::declare_pass_callback(), blender::bke::bake::deserialize_bake_item(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell_value(), blender::nodes::draw_property_for_socket(), blender::ui::draw_property_for_socket(), blender::draw_viewport_name(), blender::driver_target_path_fix(), drop_known_prefix(), drop_known_suffix(), blender::blender::StringRef::drop_prefix(), drop_prefix(), blender::blender::StringRef::drop_suffix(), drop_suffix(), blender::io::drop_whitespace(), blender::DRW_text_cache_add(), blender::eval_template(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute(), blender::nodes::LazyFunctionForClosureZone::execute_impl(), blender::dot_export::Attributes::export__as_bracket_list(), blender::ui::eyedropper_cryptomatte_sample_view3d_fl(), blender::csv_parse::CsvRecord::field_str(), blender::filelist_readjob_list_lib_add_datablock(), blender::filelist_readjob_main_assets_add_items(), blender::filelist_readjob_recursive_dir_add_items(), blender::filelist_readjob_remote_asset_library_index_read(), blender::bke::FileHandlerType::filter_glob_from_extensions(), blender::format_float_to_string(), blender::nodes::node_fn_format_string_cc::format_without_format_specifier(), blender::nodes::node_fn_format_string_cc::FormatStringMultiFunction::FormatStringMultiFunction(), blender::nodes::StringPattern::from_str(), blender::animrig::generic_slot_for_autoassign(), blender::io::obj::geom_new_object(), blender::io::obj::geom_set_curve_type(), blender::io::obj::geom_update_smooth_group(), blender::bke::bake::get_blend_file_name(), blender::draw::compositor_engine::Context::get_pass(), blender::render::Context::get_pass(), blender::render::Context::get_pass_data_type(), blender::render::Context::get_pass_type(), blender::bke::NamedLayerSelectionFieldInput::get_varray_for_context(), blender::GPU_debug_group_begin(), blender::GPU_material_from_nodetree(), blender::ed::space_node::grid_data_type_string(), blender::nodes::group_input_insert_link(), blender::nodes::group_output_insert_link(), blender::ed::object::has_capture_rest_geometry_modifier(), blender::LibWeakRefKey::hash(), blender::animrig::Slot::identifier_ensure_prefix(), blender::animrig::Slot::identifier_without_prefix(), blender::io::fbx::import_meshes(), blender::init_node_tool_operator_idnames(), blender::ed::asset::index::init_user_data(), blender::ed::object::bake_simulation::initialize_modifier_bake_directory_if_necessary(), blender::nodes::socket_usage_inference::input_may_affect_visibility(), blender::nodes::LazyFunctionForGeometryNode::input_name(), blender::asset_system::AssetRepresentation::is_potentially_editable_asset_blend(), blender::ed::object::is_smooth_by_angle_modifier(), blender::compositor::is_socket_available(), blender::asset_system::AssetCatalogPath::iterate_components(), blender::ocio::LibOCIODisplay::LibOCIODisplay(), blender::ui::MarkdownLayouter::md_enter_span(), blender::ui::menu_items_from_ui_create(), blender::ui::menu_items_from_ui_create_item_from_button(), blender::MOD_lineart_gpencil_generate_v3(), blender::seq::modifier_persistent_uid_init(), blender::new_project_name_get(), blender::nodes::node_composite_image_cc::node_declare_multi_layer(), blender::nodes::node_composite_render_layer_cc::node_extra_info(), blender::nodes::node_shader_raycast_cc::node_extra_info(), blender::ed::space_node::node_find_update_fn(), blender::bke::idprop::IDPropertyGroupChildrenSet::IDPropNameGetter::operator()(), blender::DefaultHash< SpreadsheetColumnID >::operator()(), blender::nodes::IDPropNameGetter::operator()(), blender::ui::PopupLayoutPanelStatesIDNameGetter::operator()(), blender::gpu::PruningStream::operator<<(), blender::operator==(), blender::io::obj::MTLParser::parse_and_store(), blender::asset_system::AssetCatalogDefinitionFile::parse_catalog_file(), blender::dna::parse_dna_header(), blender::io::parse_float(), blender::io::parse_int(), blender::gpu::MTLLogParser::parse_line(), blender::io::obj::parse_texture_map(), blender::io::obj::parse_texture_option(), blender::bke::node_interface::item_types::pixel_subtype_forward_compat(), blender::nodes::node_fn_format_string_cc::preprocess_python_compatible_syntax(), blender::timeit::print_duration(), blender::ui::Layout::prop(), blender::io::ply::read_header(), blender::io::read_next_line(), blender::io::fbx::read_ufbx_property(), blender::asset_system::AssetCatalogPath::rebase(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_exploded_path(), blender::bke::bake::resolve_bake_directory(), blender::io::otio::resolve_generator_type(), blender::rna_def_node_socket_interface_subtypes(), blender::rna_def_node_socket_subtypes(), blender::RNA_path_resolve_from_type_to_property(), blender::sdna_data_pointer_read_string(), blender::ed::vse::sequencer_add_text_strip_from_file(), blender::ed::vse::sequencer_change_path_draw_check_prop(), blender::animrig::Action::slot_display_name_define(), blender::animrig::Action::slot_identifier_define(), blender::ed::space_node::socket_needs_bundle_type_search(), blender::str_map_tests(), blender::gpu::shader::ResourceString::str_no_array(), blender::nodes::eval_log::StringLog::StringLog(), blender::blender::StringRefBase::substr(), blender::ui::svg_replace_color_attributes(), blender::nodes::sync_sockets_closure(), blender::nodes::sync_sockets_closure_to_list(), blender::nodes::sync_sockets_combine_bundle(), blender::nodes::sync_sockets_evaluate_closure(), blender::nodes::sync_sockets_separate_bundle(), 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::ed::space_node::test_inline_shader_nodes_exec(), blender::ui::text_clip_middle_ex(), blender::ui::text_clip_right_ex(), blender::ui::textbox_wrap_lines(), blender::io::otio::title_parameter(), blender::dna::tokenize_dna_header(), blender::blender::StringRefBase::trim(), blender::blender::StringRefBase::trim(), blender::blender::StringRefBase::trim_left(), blender::blender::StringRefBase::trim_right(), blender::nodes::materialx::NodeGraph::unique_node_name(), blender::bke::bake::unpack_geometry_nodes_bake(), blender::nodes::decl::IDSocketDeclaration::update_or_build(), blender::detail::ustring_ensure_entry(), blender::locale::MOFile::value(), blender::view_filter_for_look(), blender::ui::widget_draw_multiline_text(), blender::wm_block_dialog_create(), blender::wm_block_splash_create(), blender::WM_operatortype_find(), blender::wm_window_title_project_append(), blender::wm_window_title_text(), blender::timeit::ScopedTimer::~ScopedTimer(), and blender::timeit::ScopedTimerAveraged::~ScopedTimerAveraged().

◆ StringRef() [2/8]

◆ StringRef() [3/8]

blender::StringRef::StringRef ( const char * str)
constexpr

References str.

◆ StringRef() [4/8]

blender::StringRef::StringRef ( const char * str,
int64_t length )
constexpr

References length(), and str.

◆ StringRef() [5/8]

blender::StringRef::StringRef ( const char * begin,
const char * one_after_end )
constexpr

◆ StringRef() [6/8]

blender::StringRef::StringRef ( std::string_view view)
constexpr

◆ StringRef() [7/8]

blender::StringRef::StringRef ( Span< char > span)
constexpr

◆ StringRef() [8/8]

blender::StringRef::StringRef ( const std::string & str)

References str.

Member Function Documentation

◆ drop_known_prefix()

◆ drop_known_suffix()

◆ drop_prefix()

◆ drop_suffix()

◆ operator[]()

char blender::StringRef::operator[] ( int64_t index) const
constexpr

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