|
Blender V4.3
|
#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_string_utils.hh"#include "DNA_space_types.h"#include "DNA_text_types.h"#include "ED_text.hh"#include "text_format.hh"Go to the source code of this file.
Functions | |
| static void | flatten_string_append (FlattenString *fs, const char *c, int accum, int len) |
| 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, uint len) |
| void | text_format_fill (const char **str_p, char **fmt_p, const char type, const int len) |
| void | text_format_fill_ascii (const char **str_p, char **fmt_p, const char type, const int len) |
| void | ED_text_format_register (TextFormatType *tft) |
| TextFormatType * | ED_text_format_get (Text *text) |
| const char * | ED_text_format_comment_line_prefix (Text *text) |
| bool | ED_text_is_syntax_highlight_supported (Text *text) |
| int | text_format_string_literal_find (const Span< const char * > string_literals, const char *text) |
| const bool | text_format_string_literals_check_sorted_array (const Span< const char * > string_literals) |
Variables | |
| static ListBase | tft_lb = {nullptr, nullptr} |
| const char * ED_text_format_comment_line_prefix | ( | Text * | text | ) |
Definition at line 201 of file text_format.cc.
References ED_text_format_get().
Referenced by text_comment_exec().
| 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().
| bool ED_text_is_syntax_highlight_supported | ( | Text * | text | ) |
Definition at line 207 of file text_format.cc.
References BLI_path_extension(), BLI_strcasecmp(), BLI_string_is_decimal(), LISTBASE_FOREACH, and tft_lb.
Referenced by space_text_draw_context_init().
| 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().
|
static |
Definition at line 25 of file text_format.cc.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedbuf, FlattenString::len, len, MEM_callocN, MEM_freeN(), and FlattenString::pos.
Referenced by flatten_string().
| 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().
| int text_format_string_literal_find | ( | const Span< const char * > | string_literals, |
| const char * | text ) |
Definition at line 240 of file text_format.cc.
References cmp_fn().
Referenced by txtfmt_glsl_find_builtinfunc(), txtfmt_glsl_find_reserved(), txtfmt_glsl_find_specialvar(), txtfmt_ini_find_bool(), txtfmt_ini_find_keyword(), txtfmt_ini_find_reserved(), txtfmt_osl_find_builtinfunc(), txtfmt_osl_find_reserved(), txtfmt_osl_find_specialvar(), txtfmt_pov_find_bool(), txtfmt_pov_find_keyword(), txtfmt_pov_find_reserved_builtins(), txtfmt_pov_find_reserved_keywords(), txtfmt_pov_find_specialvar(), txtfmt_py_find_bool(), txtfmt_py_find_builtinfunc(), and txtfmt_py_find_specialvar().
| const bool text_format_string_literals_check_sorted_array | ( | const Span< const char * > | string_literals | ) |
Definition at line 260 of file text_format.cc.
References b, blender::Span< T >::begin(), and blender::Span< T >::end().
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().
|
static |
Definition at line 167 of file text_format.cc.
Referenced by ED_text_format_get(), ED_text_format_register(), and ED_text_is_syntax_highlight_supported().