|
Blender V4.5
|
#include "BLI_span.hh"Go to the source code of this file.
Classes | |
| struct | FlattenString |
| struct | TextFormatType |
Macros | |
| #define | FMT_CONT_ALL (FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C) |
Enumerations | |
| enum | { FMT_CONT_NOP = 0 , FMT_CONT_QUOTESINGLE = (1 << 0) , FMT_CONT_QUOTEDOUBLE = (1 << 1) , FMT_CONT_TRIPLE = (1 << 2) , FMT_CONT_QUOTESINGLE_TRIPLE = (FMT_CONT_TRIPLE | FMT_CONT_QUOTESINGLE) , FMT_CONT_QUOTEDOUBLE_TRIPLE = (FMT_CONT_TRIPLE | FMT_CONT_QUOTEDOUBLE) , FMT_CONT_COMMENT_C = (1 << 3) } |
| enum | { FMT_TYPE_WHITESPACE = '_' , FMT_TYPE_COMMENT = '#' , FMT_TYPE_SYMBOL = '!' , FMT_TYPE_NUMERAL = 'n' , FMT_TYPE_STRING = 'l' , FMT_TYPE_DIRECTIVE = 'd' , FMT_TYPE_SPECIAL = 'v' , FMT_TYPE_RESERVED = 'r' , FMT_TYPE_KEYWORD = 'b' , FMT_TYPE_DEFAULT = 'q' } |
Functions | |
| int | flatten_string (const SpaceText *st, FlattenString *fs, const char *in) |
| void | flatten_string_free (FlattenString *fs) |
| int | flatten_string_strlen (FlattenString *fs, const char *str) |
| int | text_check_format_len (TextLine *line, unsigned int len) |
| void | text_format_fill (const char **str_p, char **fmt_p, char type, int len) |
| void | text_format_fill_ascii (const char **str_p, char **fmt_p, char type, int len) |
| TextFormatType * | ED_text_format_get (Text *text) |
| void | ED_text_format_register (TextFormatType *tft) |
| void | ED_text_format_register_glsl () |
| void | ED_text_format_register_py () |
| void | ED_text_format_register_osl () |
| void | ED_text_format_register_pov () |
| void | ED_text_format_register_pov_ini () |
| int | text_format_string_literal_find (Span< const char * > string_literals, const char *text) |
| bool | text_format_string_literals_check_sorted_array (Span< const char * > string_literals) |
| #define FMT_CONT_ALL (FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C) |
Definition at line 41 of file text_format.hh.
Referenced by txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| anonymous enum |
Definition at line 92 of file text_format.hh.
| anonymous enum |
Format continuation flags (stored just after the null terminator).
| Enumerator | |
|---|---|
| FMT_CONT_NOP | |
| FMT_CONT_QUOTESINGLE | |
| FMT_CONT_QUOTEDOUBLE | |
| FMT_CONT_TRIPLE | |
| FMT_CONT_QUOTESINGLE_TRIPLE | |
| FMT_CONT_QUOTEDOUBLE_TRIPLE | |
| FMT_CONT_COMMENT_C | |
Definition at line 32 of file text_format.hh.
| TextFormatType * ED_text_format_get | ( | Text * | text | ) |
Definition at line 176 of file text_format.cc.
References BLI_strcasecmp(), ED_text_format_get(), ListBase::first, Text::id, LISTBASE_FOREACH, ID::name, and tft_lb.
Referenced by draw_text_main(), ED_text_format_comment_line_prefix(), ED_text_format_get(), and text_autocomplete_build().
| void ED_text_format_register | ( | TextFormatType * | tft | ) |
Definition at line 171 of file text_format.cc.
References BLI_addtail(), ED_text_format_register(), and tft_lb.
Referenced by ED_text_format_register(), ED_text_format_register_glsl(), ED_text_format_register_osl(), ED_text_format_register_pov(), ED_text_format_register_pov_ini(), and ED_text_format_register_py().
| void ED_text_format_register_glsl | ( | ) |
Definition at line 575 of file text_format_glsl.cc.
References BLI_assert, TextFormatType::comment_line, ED_text_format_register(), ED_text_format_register_glsl(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, text_format_glsl_literals_builtinfunc(), text_format_glsl_literals_reserved(), text_format_glsl_literals_specialvar(), text_format_string_literals_check_sorted_array(), txtfmt_glsl_format_identifier(), and txtfmt_glsl_format_line().
Referenced by ED_spacetype_text(), and ED_text_format_register_glsl().
| void ED_text_format_register_osl | ( | ) |
Definition at line 378 of file text_format_osl.cc.
References BLI_assert, TextFormatType::comment_line, ED_text_format_register(), ED_text_format_register_osl(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, text_format_osl_literals_builtinfunc(), text_format_osl_literals_reserved(), text_format_osl_literals_specialvar(), text_format_string_literals_check_sorted_array(), txtfmt_osl_format_identifier(), and txtfmt_osl_format_line().
Referenced by ED_spacetype_text(), and ED_text_format_register_osl().
| void ED_text_format_register_pov | ( | ) |
Definition at line 938 of file text_format_pov.cc.
References BLI_assert, TextFormatType::comment_line, ED_text_format_register(), ED_text_format_register_pov(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, text_format_pov_literals_bool(), text_format_pov_literals_builtins(), text_format_pov_literals_keyword(), text_format_pov_literals_reserved(), text_format_pov_literals_specialvar(), text_format_string_literals_check_sorted_array(), txtfmt_pov_format_identifier(), and txtfmt_pov_format_line().
Referenced by ED_spacetype_text(), and ED_text_format_register_pov().
| void ED_text_format_register_pov_ini | ( | ) |
Definition at line 523 of file text_format_pov_ini.cc.
References BLI_assert, TextFormatType::comment_line, ED_text_format_register(), ED_text_format_register_pov_ini(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, text_format_pov_ini_literals_bool(), text_format_pov_ini_literals_keyword(), text_format_pov_ini_literals_reserved(), text_format_string_literals_check_sorted_array(), txtfmt_pov_ini_format_identifier(), and txtfmt_pov_ini_format_line().
Referenced by ED_spacetype_text(), and ED_text_format_register_pov_ini().
| void ED_text_format_register_py | ( | ) |
Definition at line 562 of file text_format_py.cc.
References BLI_assert, TextFormatType::comment_line, ED_text_format_register(), ED_text_format_register_py(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, text_format_py_literals_bool(), text_format_py_literals_builtinfunc(), text_format_py_literals_specialvar(), text_format_string_literals_check_sorted_array(), txtfmt_py_format_identifier(), and txtfmt_py_format_line().
Referenced by ED_spacetype_text(), and ED_text_format_register_py().
| int flatten_string | ( | const SpaceText * | st, |
| FlattenString * | fs, | ||
| const char * | in ) |
Definition at line 60 of file text_format.cc.
References FlattenString::accum, BLI_str_utf8_size_safe(), FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, flatten_string(), flatten_string_append(), i, in, FlattenString::len, len(), and SpaceText::tabnumber.
Referenced by flatten_string(), space_text_draw(), space_text_draw_wrapped(), text_convert_whitespace_exec(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| void flatten_string_free | ( | FlattenString * | fs | ) |
Definition at line 93 of file text_format.cc.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, flatten_string_free(), and MEM_freeN().
Referenced by flatten_string_free(), space_text_draw(), space_text_draw_wrapped(), text_convert_whitespace_exec(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| int flatten_string_strlen | ( | FlattenString * | fs, |
| const char * | str ) |
Takes a string within fs->buf and returns its length.
Definition at line 103 of file text_format.cc.
References BLI_assert, FlattenString::buf, flatten_string_strlen(), len(), FlattenString::pos, and str.
Referenced by flatten_string_strlen().
Ensures the format string for the given line is long enough, reallocating as needed. Allocation is done here, alone, to ensure consistency.
Definition at line 110 of file text_format.cc.
References TextLine::format, len(), MEM_freeN(), MEM_malloc_arrayN(), and text_check_format_len().
Referenced by text_check_format_len(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| void text_format_fill | ( | const char ** | str_p, |
| char ** | fmt_p, | ||
| char | type, | ||
| int | len ) |
Fill the string with formatting constant, advancing str_p and fmt_p
| len | length in bytes of fmt_p to fill. |
Definition at line 131 of file text_format.cc.
References BLI_assert, BLI_str_utf8_size_safe(), i, len(), str, and text_format_fill().
Referenced by text_format_fill(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| void text_format_fill_ascii | ( | const char ** | str_p, |
| char ** | fmt_p, | ||
| char | type, | ||
| int | len ) |
ASCII version of text_format_fill, use when we no the text being stepped over is ASCII (as is the case for most keywords)
Definition at line 153 of file text_format.cc.
References BLI_assert, len(), str, and text_format_fill_ascii().
Referenced by text_format_fill_ascii(), txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
| int text_format_string_literal_find | ( | Span< const char * > | string_literals, |
| const char * | text ) |
Checks the specified source string #text for a string literal in #string_literals array. This string literal must start at the beginning of the source string.
If a string literal is found, the length of the string literal is returned. Otherwise, 0.
References text_format_string_literal_find().
| bool text_format_string_literals_check_sorted_array | ( | Span< const char * > | string_literals | ) |
Check if #string_literals array is shorted. This validation is required since text formatters do binary search on these string literals arrays. Used only for assertions.
References text_format_string_literals_check_sorted_array().