summaryrefslogtreecommitdiffstats
path: root/core/io/xml_parser.h
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-07-05 01:23:04 +0200
committerkobewi <kobewi4e@gmail.com>2022-07-05 01:23:04 +0200
commit415c7dda37bf46a6a0d043c88206f739f827c4e4 (patch)
tree4f3e04f842fc729edaca035888a160719ad1ec0d /core/io/xml_parser.h
parent100d2237361004bd053aaf1b6d63ad3068d6272e (diff)
downloadredot-engine-415c7dda37bf46a6a0d043c88206f739f827c4e4.tar.gz
Implement XMLParser.get_current_line()
Diffstat (limited to 'core/io/xml_parser.h')
-rw-r--r--core/io/xml_parser.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h
index da14ee8eae..aea252ddc7 100644
--- a/core/io/xml_parser.h
+++ b/core/io/xml_parser.h
@@ -68,6 +68,7 @@ private:
char *data = nullptr;
char *P = nullptr;
uint64_t length = 0;
+ uint64_t current_line = 0;
String node_name;
bool node_empty = false;
NodeType node_type = NODE_NONE;
@@ -88,6 +89,13 @@ private:
void _parse_opening_xml_element();
void _parse_current_node();
+ _FORCE_INLINE_ void next_char() {
+ if (*P == '\n') {
+ current_line++;
+ }
+ P++;
+ }
+
static void _bind_methods();
public:
@@ -113,7 +121,6 @@ public:
void close();
- XMLParser();
~XMLParser();
};