mirror of
https://github.com/supleed2/svd2cpp.git
synced 2024-09-19 21:06:17 +00:00
16 lines
465 B
C++
16 lines
465 B
C++
#include <XmlParser.hpp>
|
|
#include <iostream>
|
|
|
|
XmlParser::XmlParser(const std::string& inputFile){
|
|
xmlDocument.LoadFile(inputFile.c_str());
|
|
}
|
|
std::optional<std::string> XmlParser::isError() const{
|
|
return xmlDocument.Error() ? std::optional<std::string>(xmlDocument.ErrorStr()) : std::nullopt;
|
|
}
|
|
|
|
void XmlParser::parseXml(){
|
|
root = xmlDocument.FirstChildElement();
|
|
if(root == nullptr)
|
|
return;
|
|
std::cout << root->GetText();
|
|
} |