Blender V5.3
blender::gpu::shader::parser::MutableString Struct Reference

#include <intermediate.hh>

Inherited by blender::gpu::shader::parser::IntermediateForm< parser::FullLexer, parser::FullParser >, and blender::gpu::shader::parser::IntermediateForm< LexerFn, ParserFn >.

Classes

struct  Mutation

Public Member Functions

 MutableString (const std::string_view input)
 MutableString (const MutableString &other)=delete
MutableString & operator= (const MutableString &other)=delete
 MutableString (MutableString &&other)=default
MutableString & operator= (MutableString &&other)=default
std::string substr_range_inclusive (size_t start, size_t end)
std::string substr_range_inclusive (Token start, Token end)
std::string_view substr_range_inclusive_view (size_t start, size_t end)
std::string_view substr_range_inclusive_view (Token start, Token end)
bool report_failure ()
bool replace_try (size_t from, size_t to, const std::string &replacement)
bool replace_try (Token from, Token to, const std::string &replacement, bool keep_trailing_whitespaces=false)
void replace (size_t from, size_t to, const std::string &replacement)
void replace (Token from, Token to, const std::string &replacement, bool keep_trailing_whitespaces=false)
void replace (Token tok, const std::string &replacement, bool keep_trailing_whitespaces=false)
void replace (Scope scope, const std::string &replacement, bool keep_trailing_whitespaces=false)
void replace (ast::Node node, const std::string &replacement, bool keep_trailing_whitespaces=false)
bool erase_try (size_t from, size_t to)
void erase (size_t from, size_t to)
bool erase_try (Token from, Token to)
void erase (Token from, Token to)
bool erase_try (Token tok)
void erase (Token tok)
bool erase_try (Scope scope)
void erase (Scope scope)
bool erase_try (ast::Node node)
void erase (ast::Node node)
void insert_before (size_t at, const std::string &content, bool prepend=false)
void insert_before (Token at, const std::string &content, bool prepend=false)
void insert_after (size_t at, const std::string &content)
void insert_after (Token at, const std::string &content)
void insert_line_number (size_t at, int line, std::string_view filename="")
void insert_line_number (Token at, int line, std::string_view filename="")
void insert_directive (Token at, const std::string directive)
bool apply_mutations (LexerBase &lexer, const bool all_mutation_ordered=false)
const std::string & str ()
std::string serialize_mutations () const

Public Attributes

std::string str_
std::vector< Mutation > mutations_
std::string last_substitution_failure

Detailed Description

Definition at line 43 of file intermediate.hh.

Constructor & Destructor Documentation

◆ MutableString() [1/3]

◆ MutableString() [2/3]

blender::gpu::shader::parser::MutableString::MutableString ( const MutableString & other)
delete

References MutableString().

◆ MutableString() [3/3]

blender::gpu::shader::parser::MutableString::MutableString ( MutableString && other)
default

References MutableString().

Member Function Documentation

◆ apply_mutations()

bool blender::gpu::shader::parser::MutableString::apply_mutations ( LexerBase & lexer,
const bool all_mutation_ordered = false )

◆ erase() [1/5]

void blender::gpu::shader::parser::MutableString::erase ( ast::Node node)
inline

◆ erase() [2/5]

void blender::gpu::shader::parser::MutableString::erase ( Scope scope)
inline

◆ erase() [3/5]

void blender::gpu::shader::parser::MutableString::erase ( size_t from,
size_t to )
inline

◆ erase() [4/5]

void blender::gpu::shader::parser::MutableString::erase ( Token from,
Token to )
inline

◆ erase() [5/5]

void blender::gpu::shader::parser::MutableString::erase ( Token tok)
inline

◆ erase_try() [1/5]

bool blender::gpu::shader::parser::MutableString::erase_try ( ast::Node node)
inline

Definition at line 271 of file intermediate.hh.

References erase_try(), and node.

◆ erase_try() [2/5]

bool blender::gpu::shader::parser::MutableString::erase_try ( Scope scope)
inline

◆ erase_try() [3/5]

bool blender::gpu::shader::parser::MutableString::erase_try ( size_t from,
size_t to )
inline

◆ erase_try() [4/5]

bool blender::gpu::shader::parser::MutableString::erase_try ( Token from,
Token to )
inline

◆ erase_try() [5/5]

bool blender::gpu::shader::parser::MutableString::erase_try ( Token tok)
inline

Definition at line 244 of file intermediate.hh.

References erase_try(), and lexit::Token::is_invalid().

◆ insert_after() [1/2]

void blender::gpu::shader::parser::MutableString::insert_after ( size_t at,
const std::string & content )
inline

◆ insert_after() [2/2]

void blender::gpu::shader::parser::MutableString::insert_after ( Token at,
const std::string & content )
inline

Definition at line 304 of file intermediate.hh.

References insert_after().

◆ insert_before() [1/2]

void blender::gpu::shader::parser::MutableString::insert_before ( size_t at,
const std::string & content,
bool prepend = false )
inline

Definition at line 284 of file intermediate.hh.

References blender::IndexRange::IndexRange(), and mutations_.

Referenced by insert_before().

◆ insert_before() [2/2]

void blender::gpu::shader::parser::MutableString::insert_before ( Token at,
const std::string & content,
bool prepend = false )
inline

Definition at line 294 of file intermediate.hh.

References insert_before().

◆ insert_directive()

void blender::gpu::shader::parser::MutableString::insert_directive ( Token at,
const std::string directive )
inline

Definition at line 324 of file intermediate.hh.

References insert_after(), insert_line_number(), and str_.

◆ insert_line_number() [1/2]

void blender::gpu::shader::parser::MutableString::insert_line_number ( size_t at,
int line,
std::string_view filename = "" )
inline

◆ insert_line_number() [2/2]

void blender::gpu::shader::parser::MutableString::insert_line_number ( Token at,
int line,
std::string_view filename = "" )
inline

◆ operator=() [1/2]

MutableString & blender::gpu::shader::parser::MutableString::operator= ( const MutableString & other)
delete

References MutableString().

◆ operator=() [2/2]

MutableString & blender::gpu::shader::parser::MutableString::operator= ( MutableString && other)
default

References MutableString().

◆ replace() [1/5]

void blender::gpu::shader::parser::MutableString::replace ( ast::Node node,
const std::string & replacement,
bool keep_trailing_whitespaces = false )
inline

Definition at line 190 of file intermediate.hh.

References node, replace(), and lexit::Token::Token().

◆ replace() [2/5]

void blender::gpu::shader::parser::MutableString::replace ( Scope scope,
const std::string & replacement,
bool keep_trailing_whitespaces = false )
inline

◆ replace() [3/5]

void blender::gpu::shader::parser::MutableString::replace ( size_t from,
size_t to,
const std::string & replacement )
inline

◆ replace() [4/5]

void blender::gpu::shader::parser::MutableString::replace ( Token from,
Token to,
const std::string & replacement,
bool keep_trailing_whitespaces = false )
inline

Definition at line 154 of file intermediate.hh.

References replace().

◆ replace() [5/5]

void blender::gpu::shader::parser::MutableString::replace ( Token tok,
const std::string & replacement,
bool keep_trailing_whitespaces = false )
inline

Definition at line 168 of file intermediate.hh.

References replace().

◆ replace_try() [1/2]

bool blender::gpu::shader::parser::MutableString::replace_try ( size_t from,
size_t to,
const std::string & replacement )
inline

◆ replace_try() [2/2]

bool blender::gpu::shader::parser::MutableString::replace_try ( Token from,
Token to,
const std::string & replacement,
bool keep_trailing_whitespaces = false )
inline

Definition at line 129 of file intermediate.hh.

References replace_try().

◆ report_failure()

bool blender::gpu::shader::parser::MutableString::report_failure ( )
inline

Definition at line 101 of file intermediate.hh.

References last_substitution_failure.

Referenced by erase(), erase(), erase(), erase(), erase(), and replace().

◆ serialize_mutations()

std::string blender::gpu::shader::parser::MutableString::serialize_mutations ( ) const
inline

Definition at line 344 of file intermediate.hh.

References mutations_, blender::gpu::shader::metadata::out, and str_.

◆ str()

const std::string & blender::gpu::shader::parser::MutableString::str ( )
inline

Definition at line 338 of file intermediate.hh.

References str_.

Referenced by insert_line_number().

◆ substr_range_inclusive() [1/2]

std::string blender::gpu::shader::parser::MutableString::substr_range_inclusive ( size_t start,
size_t end )
inline

Definition at line 78 of file intermediate.hh.

References str_.

Referenced by substr_range_inclusive().

◆ substr_range_inclusive() [2/2]

std::string blender::gpu::shader::parser::MutableString::substr_range_inclusive ( Token start,
Token end )
inline

Definition at line 83 of file intermediate.hh.

References substr_range_inclusive().

◆ substr_range_inclusive_view() [1/2]

std::string_view blender::gpu::shader::parser::MutableString::substr_range_inclusive_view ( size_t start,
size_t end )
inline

Definition at line 89 of file intermediate.hh.

References str_.

Referenced by substr_range_inclusive_view().

◆ substr_range_inclusive_view() [2/2]

std::string_view blender::gpu::shader::parser::MutableString::substr_range_inclusive_view ( Token start,
Token end )
inline

Definition at line 94 of file intermediate.hh.

References substr_range_inclusive_view().

Member Data Documentation

◆ last_substitution_failure

std::string blender::gpu::shader::parser::MutableString::last_substitution_failure

Definition at line 99 of file intermediate.hh.

Referenced by replace_try(), and report_failure().

◆ mutations_

std::vector<Mutation> blender::gpu::shader::parser::MutableString::mutations_

◆ str_


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