Remove OutputFile include

This commit is contained in:
Aadi Desai 2023-03-06 16:44:15 +00:00 committed by GitHub
parent a88a46a9a9
commit 04dce84fff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -9,9 +9,8 @@ include_directories(tinyxml2)
add_library(ClassBuilder Src/ClassBuilder.cpp)
add_library(Builders Src/Builders.cpp)
add_library(OutputFile Src/OutputFile.cpp)
add_library(XmlParser Src/XmlParser.cpp)
add_library(tinyxml2 tinyxml2/tinyxml2.cpp)
add_executable(svd2cpp Src/main.cpp)
target_link_libraries(svd2cpp ClassBuilder Builders OutputFile XmlParser tinyxml2)
target_link_libraries(svd2cpp ClassBuilder Builders XmlParser tinyxml2)

View file

@ -1,8 +1,8 @@
#include <fstream>
#include <iostream>
#include <cxxopts.hpp>
#include <XmlParser.hpp>
#include <ClassBuilder.hpp>
#include <OutputFile.hpp>
int main(int argc, char** argv){
// Create and configure options for the program
@ -47,6 +47,8 @@ int main(int argc, char** argv){
classBuilder.setupBuilders();
classBuilder.build();
OutputFile oFile(outputFile);
std::cout << (oFile.save(classBuilder.getStream()) ? "Successfuly created " : "Failed to create ") << outputFile << std::endl;
std::ofstream oFile;
oFile.open(outputFile);
oFile << classBuilder.getStream().str();
oFile.close();
}