Blender V5.3
string.h File Reference
#include <cstring>
#include <string>
#include <OpenImageIO/string_view.h>
#include "util/vector.h"

Go to the source code of this file.

Macros

#define PRINTF_ATTRIBUTE

Functions

string string_printf (const char *format,...) PRINTF_ATTRIBUTE
bool string_iequals (const string &a, const string &b)
void string_split (vector< string > &tokens, const string &str, const string &separators="\t ", bool skip_empty_tokens=true)
void string_replace (string &haystack, const string &needle, const string &other)
void string_replace_same_length (string &haystack, const string &needle, const string &other)
bool string_startswith (string_view s, string_view start)
bool string_endswith (string_view s, string_view end)
string string_strip (const string &s)
string string_remove_trademark (const string &s)
string string_from_bool (const bool var)
string string_hex (const uint8_t *data, const size_t size)
string to_string (const char *str)
string to_string (const float2 &v)
string to_string (const float4 &v)
string string_to_lower (const string &s)
string string_remove_gpu_from_cpu_name (const string &s)
wstring string_to_wstring (const string &str)
string string_from_wstring (const wstring &str)
string string_human_readable_size (const size_t size)
string string_human_readable_number (const size_t num)

Macro Definition Documentation

◆ PRINTF_ATTRIBUTE

#define PRINTF_ATTRIBUTE

Definition at line 30 of file string.h.

Function Documentation

◆ string_endswith()

◆ string_from_bool()

string string_from_bool ( const bool var)

◆ string_from_wstring()

string string_from_wstring ( const wstring & str)

Definition at line 286 of file string.cpp.

References state, str, string_from_wstring(), and utf8_locale_new().

Referenced by string_from_wstring().

◆ string_hex()

string string_hex ( const uint8_t * data,
const size_t size )

Definition at line 193 of file string.cpp.

References size(), string_hex(), and string_printf().

Referenced by string_hex().

◆ string_human_readable_number()

◆ string_human_readable_size()

◆ string_iequals()

bool string_iequals ( const string & a,
const string & b )

◆ string_printf()

string string_printf ( const char * format,
... )

Definition at line 25 of file string.cpp.

References assert, str, and string_printf().

Referenced by add_cryptomatte_layer(), ImageManager::add_image(), BlenderSession::bake(), buffer_params_from_image_spec_atttributes(), buffer_params_to_image_spec_atttributes(), Octree::build(), Geometry::compute_bvh(), GeometryManager::create_volume_mesh(), datestring(), device_cuda_info(), device_hip_info(), GeometryManager::displace(), exr_channel_names_for_passes(), ImageStats::full_report(), NamedNestedSampleStats::full_report(), NamedSampleCountStats::full_report(), NamedSizeStats::full_report(), NamedTimeStats::full_report(), RenderScheduler::full_report(), SVMCompiler::Summary::full_report(), TaskPool::Summary::full_report(), ObjectManager::get_cryptomatte_assets(), ShaderManager::get_cryptomatte_materials(), ObjectManager::get_cryptomatte_objects(), get_emitter_id(), get_knode_id(), get_node_id(), ColorSpaceManager::get_xyz_to_scene_linear_rgb_string(), device_image::log_name(), make_tx(), DenoiseImage::parse_channels(), parse_channels(), print_emitters(), BVHBuild::progress_update(), recursive_print_knode(), recursive_print_node(), DenoiseImage::save_output(), session_print_status(), string_hex(), string_human_readable_size(), string_printf(), BlenderSync::sync_render_passes(), TEST(), TEST(), TEST(), TEST(), time_human_readable_from_seconds(), to_string(), to_string(), unique_filename_tx(), Hair::update_shadow_transparency(), BlenderSession::update_status_progress(), Session::update_status_time(), OIIOOutputDriver::write_render_tile(), and write_stats_tx().

◆ string_remove_gpu_from_cpu_name()

string string_remove_gpu_from_cpu_name ( const string & s)

◆ string_remove_trademark()

string string_remove_trademark ( const string & s)

◆ string_replace()

void string_replace ( string & haystack,
const string & needle,
const string & other )

◆ string_replace_same_length()

void string_replace_same_length ( string & haystack,
const string & needle,
const string & other )

Definition at line 157 of file string.cpp.

References assert, and string_replace_same_length().

Referenced by string_replace_same_length().

◆ string_split()

void string_split ( vector< string > & tokens,
const string & str,
const string & separators = "\t ",
bool skip_empty_tokens = true )

◆ string_startswith()

bool string_startswith ( string_view s,
string_view start )

◆ string_strip()

string string_strip ( const string & s)

◆ string_to_lower()

string string_to_lower ( const string & s)

◆ string_to_wstring()

wstring string_to_wstring ( const string & str)

◆ to_string() [1/3]

◆ to_string() [2/3]

string to_string ( const float2 & v)

Definition at line 207 of file string.cpp.

References string_printf(), and to_string().

◆ to_string() [3/3]

string to_string ( const float4 & v)

Definition at line 212 of file string.cpp.

References string_printf(), and to_string().