mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
add template argument for size in StringBuffer
Until now the pre-allocated array size was defined to be 64 without a way of adjusting it from the calling side. This commit adds the size as a template parameter.
This commit is contained in:
parent
00387cbe1b
commit
ac2a9bb267
3 changed files with 84 additions and 107 deletions
|
@ -178,7 +178,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
|
|||
};
|
||||
case '#': {
|
||||
|
||||
StringBuffer color_str;
|
||||
StringBuffer<> color_str;
|
||||
color_str += '#';
|
||||
while (true) {
|
||||
CharType ch = p_stream->get_char();
|
||||
|
@ -299,7 +299,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
|
|||
if (cchar == '-' || (cchar >= '0' && cchar <= '9')) {
|
||||
//a number
|
||||
|
||||
StringBuffer num;
|
||||
StringBuffer<> num;
|
||||
#define READING_SIGN 0
|
||||
#define READING_INT 1
|
||||
#define READING_DEC 2
|
||||
|
@ -378,7 +378,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
|
|||
|
||||
} else if ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_') {
|
||||
|
||||
StringBuffer id;
|
||||
StringBuffer<> id;
|
||||
bool first = true;
|
||||
|
||||
while ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_' || (!first && cchar >= '0' && cchar <= '9')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue