mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
BasicParser now uses string_view
This commit is contained in:
parent
65e85f362c
commit
5da2a30326
9 changed files with 45 additions and 43 deletions
|
|
@ -177,7 +177,7 @@ const std::string& Document::getEncoding() const {
|
|||
return encoding;
|
||||
}
|
||||
|
||||
Parser::Parser(const std::string& filename, const std::string& source)
|
||||
Parser::Parser(std::string_view filename, std::string_view source)
|
||||
: BasicParser(filename, source) {
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ std::string Parser::parseText() {
|
|||
}
|
||||
nextChar();
|
||||
}
|
||||
return source.substr(start, pos-start);
|
||||
return std::string(source.substr(start, pos-start));
|
||||
}
|
||||
|
||||
inline bool is_xml_identifier_start(char c) {
|
||||
|
|
@ -270,7 +270,7 @@ std::string Parser::parseXMLName() {
|
|||
while (hasNext() && is_xml_identifier_part(source[pos])) {
|
||||
pos++;
|
||||
}
|
||||
return source.substr(start, pos-start);
|
||||
return std::string(source.substr(start, pos-start));
|
||||
}
|
||||
|
||||
xmlelement Parser::parseElement() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue