Blender V4.3
blender::StringRefNull Class Reference

#include <BLI_string_ref.hh>

Inherits blender::StringRefBase.

Public Member Functions

#StringRefNull Inline Methods
constexpr StringRefNull ()
constexpr StringRefNull (const char *str, int64_t size)
 StringRefNull (const char *str)
 StringRefNull (const std::string &str)
constexpr char operator[] (int64_t index) const
constexpr const char * c_str () 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
void unsafe_copy (char *dst) const
void copy (char *dst, int64_t dst_size) const
template<size_t N>
void copy (char(&dst)[N]) 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

Additional Inherited Members

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

Detailed Description

References a null-terminated const char array.

StringRefNull can be compared with StringRef and StringRefNull.

Definition at line 111 of file BLI_string_ref.hh.

Constructor & Destructor Documentation

◆ StringRefNull() [1/4]

blender::StringRefNull::StringRefNull ( )
constexpr

Definition at line 430 of file BLI_string_ref.hh.

References blender::StringRefBase::StringRefBase().

Referenced by StringRefNull().

◆ StringRefNull() [2/4]

blender::StringRefNull::StringRefNull ( const char * str,
int64_t size )
constexpr

Construct a StringRefNull from a null terminated c-string. This invokes undefined behavior when the given size is not the correct size of the string.

Definition at line 436 of file BLI_string_ref.hh.

References BLI_assert, blender::StringRefBase::size(), str, and blender::StringRefBase::StringRefBase().

◆ StringRefNull() [3/4]

blender::StringRefNull::StringRefNull ( const char * str)
inline

Construct a StringRefNull from a null terminated c-string. The pointer must not point to NULL.

Definition at line 446 of file BLI_string_ref.hh.

References BLI_assert, blender::StringRefBase::data_, blender::StringRefBase::size_, str, and blender::StringRefBase::StringRefBase().

◆ StringRefNull() [4/4]

blender::StringRefNull::StringRefNull ( const std::string & str)
inline

Reference a std::string. Remember that when the std::string is destructed, the StringRefNull will point to uninitialized memory.

Definition at line 456 of file BLI_string_ref.hh.

References c_str(), blender::StringRefBase::size(), str, and StringRefNull().

Member Function Documentation

◆ c_str()

const char * blender::StringRefNull::c_str ( ) const
constexpr

Returns the beginning of a null-terminated char array.

This is like ->data(), but can only be called on a StringRefNull.

Definition at line 477 of file BLI_string_ref.hh.

References blender::StringRefBase::data_.

Referenced by blender::animrig::action_add(), blender::animrig::action_fcurve_ensure(), blender::animrig::legacy::action_fcurves_remove(), blender::add_attribute_search_button(), blender::add_attribute_search_or_value_buttons(), blender::ui::BasicTreeViewItem::add_label(), blender::ed::asset::shelf::add_tab_button(), blender::animrig::apply_evaluation_result(), blender::bke::idprop::array_create(), AS_asset_library_find_suitable_root_path_from_path(), blender::bke::asset_edit_id_save_as(), blender::bke::asset_write_in_library(), blender::draw::pbvh::attribute_format(), blender::ed::object::bake_simulation::bake_directory_has_data(), BKE_armature_deform_coords_with_curves(), BKE_libblock_rename(), BKE_packedfile_blend_read(), BKE_paint_brush_type_default_reference(), blender::ed::spreadsheet::GreasePencilLayerViewItem::build_row(), blender::ed::spreadsheet::InstanceReferenceViewItem::build_row(), calculate_selection_fcurve_bounds(), blender::ed::asset::catalog_name_ensure_unique(), compare_asset_catalog(), blender::gpu::ShaderCompiler::compile(), blender::gpu::ShaderInterface::copy_input_name(), blender::bke::idprop::create(), blender::bke::idprop::create(), blender::bke::idprop::create(), blender::bke::idprop::create(), blender::bke::idprop::create(), blender::ed::asset::shelf::create_activate_operator_params(), blender::bke::idprop::create_array(), blender::bke::idprop::create_bool(), blender::ed::space_node::create_description_inspection_string(), blender::bke::idprop::create_group(), blender::ed::space_node::create_inspection_string_for_field_info(), blender::io::grease_pencil::GreasePencilImporter::create_material(), blender::io::grease_pencil::GreasePencilImporter::create_object(), blender::bke::bake::directory_is_empty(), blender::ed::asset::draw_menu_for_catalog(), blender::draw_named_attributes_panel(), blender::draw_property_for_output_socket(), blender::draw_property_for_socket(), blender::ed::asset_browser::AssetCatalogDropTarget::drop_assets_into_catalog(), blender::animrig::Layer::duplicate_with_shallow_strip_copies(), ED_id_rename(), ED_image_filesel_detect_sequences(), blender::ensure_vertex_group(), blender::animrig::tests::ActionFCurveMoveTest::fcurve_create(), blender::animrig::fcurve_find_in_action(), blender::animrig::fcurve_find_in_action_slot(), blender::animrig::fcurve_matches_collection_path(), fileentry_uiname(), filelist_readjob_all_asset_library(), blender::gpu::VKShaderModule::finalize(), blender::bke::bake::find_sorted_meta_files(), foreach_libblock_remap_callback(), blender::bke::bake::BakePath::from_single_root(), blender::nodes::node_shader_math_cc::get_base_multi_function(), blender::bke::bake::get_blend_file_name(), blender::bke::bake::get_data_type_from_io_name(), blender::bke::FileHandlerType::get_default_filename(), blender::bke::bake::get_domain_from_io_name(), blender::ed::asset::get_local_asset_from_relative_identifier(), blender::nodes::node_shader_vector_math_cc::get_multi_function(), blender::nodes::node_composite_math_cc::MathShaderNode::get_shader_function_name(), gpu_material_library_use_function(), GPU_shader_create_from_info_name(), blender::gpu::shader::gpu_shader_dependency_get_filename_from_source_string(), blender::nodes::node_shader_math_cc::gpu_shader_get_name(), grease_pencil_layer_cache_add(), blender::ed::greasepencil::grease_pencil_layer_parent_set(), blender::gpu::GLShader::init(), blender::draw::init_format_for_attribute(), blender::ed::asset::index::init_indexer_entry_from_value(), blender::io::usd::is_armature_modifier_bone_name(), blender::ed::greasepencil::join_object_with_active(), keyblock_ensure_from_uid(), blender::animrig::StripKeyframeData::keyframe_insert(), keymap_update_brushes_handle_add_item(), keymap_update_brushes_handle_remove_item(), blender::bke::greasepencil::LayerMask::LayerMask(), blender::ed::sculpt_paint::library_to_library_ref(), link_append_context_library_blohandle_ensure(), blender::io::usd::UsdCurvesTest::load_file_and_depsgraph(), blender::io::usd::UsdExportTest::load_file_and_depsgraph(), blender::io::usd::UsdUsdzExportTest::load_file_and_depsgraph(), blender::draw::mesh_cd_calc_used_gpu_layers(), blender::ed::mesh::set_attribute::mesh_set_attribute_ui(), blender::ed::space_node::node_geometry_add_attribute_search_button(), blender::ed::space_node::node_group_make_insert_selected(), node_reroute_declare(), blender::asset_system::utils::normalize_path(), blender::fstream::open(), uiListNameFilter::operator()(), blender::ed::outliner::outliner_draw_warning_tree_element(), blender::bke::bake::pack_files_from_directory(), paint_brush_set_default_reference(), blender::io::path_reference(), blender::gpu::MTLParallelShaderCompiler::precompile_specializations(), blender::io::alembic::preprocess_sample(), blender::gpu::Shader::print_log(), blender::io::grease_pencil::SVGImporter::read(), blender::ui::bonecollections::BoneCollectionItem::rename(), blender::ui::greasepencil::LayerGroupViewItem::rename(), blender::ui::greasepencil::LayerViewItem::rename(), blender::nodes::node_fn_replace_string_cc::replace_all(), rna_def_node_item_array_common_functions(), rna_def_node_item_array_new_with_socket_and_name(), rna_def_node_item_array_socket_item_common(), blender::ed::geometry::rna_property_for_attribute_type_retrieve_value(), blender::ed::curves::set_attribute_ui(), blender::nodes::inverse_eval::set_rna_property(), blender::ed::object::shade_auto_smooth_exec(), blender::ed::asset::shelf::AssetViewItem::should_be_filtered_visible(), blender::ed::sculpt_paint::show_catalog_in_asset_shelf(), blender::animrig::Action::slot_find_by_name(), blender::animrig::Action::slot_name_define(), blender::ed::spreadsheet::spreadsheet_column_assign_runtime_data(), StringRefNull(), blender::ui::template_asset_shelf_popover(), blender::io::usd::TEST_F(), uiTemplateStatusInfo(), blender::bke::bake::unpack_bake_to_disk(), blender::nodes::update_input_properties_from_node_tree(), use_layer_in_render(), version_legacy_actions_to_layered(), blender::gpu::VKImageView::VKImageView(), WM_drag_asset_id_import(), WM_drag_get_item_name(), blender::io::grease_pencil::PDFExporter::write_to_file(), and blender::io::grease_pencil::SVGExporter::write_to_file().

◆ operator[]()

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

Get the char at the given index.

Definition at line 464 of file BLI_string_ref.hh.

References BLI_assert, blender::StringRefBase::data_, and blender::StringRefBase::size_.


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