50 std::stringstream input;
53 std::ifstream ifs(confPath);
56 catch (
const std::ifstream::failure& e)
58 std::cerr <<
"Error occurred while opening file: " << e.what() << std::endl;
62 const std::string& source = input.str();
64 frxml::doc doc(source);
67 const char* begin = doc.error().source;
70 for (
auto i = 0; i < 5 && begin > &source[0]; ++i)
72 for (
auto i = 0; i < 5 && begin + length < &source[source.size() - 1]; ++i)
76 <<
"Error occurred while parsing XML: "
78 <<
" (" << std::string_view(begin, length) <<
")\n";
83 if (!outPath.ends_with(
'/'))
85 outPath += libPath +
".cs";
86 std::ofstream ofs(outPath);
90 visitor.
Begin(ctx, doc.root() , doc.root(), 0);
96 catch (
const std::ofstream::failure& e)
98 std::cerr <<
"Error occurred while opening file: " << e.what() << std::endl;
int Run(std::string confPath, std::string libPath, std::string outPath, std::vector< std::string > argv) const override
Runs action with given paths.