Skip to content
Snippets Groups Projects
Commit f32b6076 authored by Oliver Charles Schubert's avatar Oliver Charles Schubert
Browse files

Adds <filesystem> library for testing purposes.

parent 11f6cb44
Branches
No related tags found
No related merge requests found
#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)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment