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