Skip to content
Snippets Groups Projects

aron code generation: explicitly specifying include paths

All threads resolved!
4 files
+ 56
28
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -63,7 +63,8 @@ int main(int argc, char* argv[])
options.add_options("IO")
("i,input", "XML file name", cxxopts::value<std::string>()->default_value(input_default))
("o,output", "The output path", cxxopts::value<std::string>()->default_value(output_default));
("o,output", "The output path", cxxopts::value<std::string>()->default_value(output_default))
("I,include", "include path", cxxopts::value<std::vector<std::string>>());
options.add_options("Generation")
("f,force", "Enforce the generation", cxxopts::value<bool>()->default_value("false"));
@@ -108,6 +109,17 @@ int main(int argc, char* argv[])
std::filesystem::path input_file(filename);
std::filesystem::path output_folder(output);
std::vector<std::filesystem::path> includePaths;
if(result.count("I") > 0)
{
for(const auto& path: result["I"].as<std::vector<std::string>>())
{
includePaths.emplace_back(path);
}
}
if (!std::filesystem::exists(input_file) || !std::filesystem::is_regular_file(input_file))
{
std::cerr << "The input file does not exist or is not a regular file." << std::endl;
@@ -132,7 +144,7 @@ int main(int argc, char* argv[])
}
typereader::xml::Reader reader;
reader.parseFile(input_file);
reader.parseFile(input_file, includePaths);
if (verbose)
{
std::cout << "Parsing the XML file... done!" << std::endl;
Loading