BasicParser now uses string_view
This commit is contained in:
+3
-3
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user