diff --git a/DesignEvaluator/src/main.cpp b/DesignEvaluator/src/main.cpp index 4db511bf1432ddb0769de532df2f88c700b2cca2..74c8791785b70e7f928f2380cb4979dab684c0b1 100644 --- a/DesignEvaluator/src/main.cpp +++ b/DesignEvaluator/src/main.cpp @@ -1,13 +1,33 @@ #include <iostream> +#include <filesystem> #include <boost/property_tree/xml_parser.hpp> #include <boost/property_tree/ptree.hpp> int main () { - boost::property_tree::ptree tree1, tree2; + std::filesystem::path upstream_file("./test-upstream-files/oldFormat-CSR.xml"); + std::filesystem::path local_file("./projects/oldFormat-CSR.xml"); + boost::property_tree::ptree upstream_tree, local_tree; + + // Checking path properties + if (std::filesystem::exists(upstream_file)) { + std::cout << "File exists" << std::endl; + } + + if (std::filesystem::exists(local_file)) { + std::cout << "File exists" << std::endl; + } + + // Accessing path components + std::cout << upstream_file.root_name() << std::endl; + std::cout << upstream_file.parent_path() << std::endl; + std::cout << upstream_file.filename() << std::endl; + std::cout << upstream_file.extension() << std::endl; + try { - boost::property_tree::read_xml("oldFormat-CSR.xml", tree1); + boost::property_tree::read_xml(upstream_file.string(), upstream_tree); + boost::property_tree::read_xml(local_file.string(), local_tree); } catch(const std::exception& e) {