|
Blender V4.3
|
#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) |
| const 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 39 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 |
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 30 of file text_format.hh.
| anonymous enum |
Definition at line 90 of file text_format.hh.
| TextFormatType * ED_text_format_get | ( | Text * | text | ) |
Definition at line 173 of file text_format.cc.
References BLI_strcasecmp(), ListBase::first, LISTBASE_FOREACH, and tft_lb.
Referenced by ED_text_format_comment_line_prefix(), and text_autocomplete_build().
| void ED_text_format_register | ( | TextFormatType * | tft | ) |
Definition at line 168 of file text_format.cc.
References BLI_addtail(), and tft_lb.
Referenced by 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(), 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().
| 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(), 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().
| 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(), 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().
| 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(), 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().
| 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(), 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().
| int flatten_string | ( | const SpaceText * | st, |
| FlattenString * | fs, | ||
| const char * | in ) |
Definition at line 57 of file text_format.cc.
References FlattenString::accum, BLI_str_utf8_size_safe(), FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, flatten_string_append(), FlattenString::len, len, and SpaceText::tabnumber.
Referenced by 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 90 of file text_format.cc.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, and MEM_freeN().
Referenced by 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 100 of file text_format.cc.
References BLI_assert, FlattenString::buf, int, len, FlattenString::pos, and str.
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 107 of file text_format.cc.
References len, MEM_freeN(), and MEM_mallocN.
Referenced by 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 128 of file text_format.cc.
References BLI_assert, BLI_str_utf8_size_safe(), len, size(), and str.
Referenced by 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 150 of file text_format.cc.
References BLI_assert, len, and str.
Referenced by txtfmt_glsl_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
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.
| const 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.