Use std::filesystem::path::string() when writing paths to std::cout/std::cerr
Otherwise they will be quoted, which is not desirable, especially under Windows (backslashes will be duplicated).master
parent
e0b2583ff9
commit
5b400b69f0
|
@ -372,7 +372,7 @@ DynamicModel::writeDynamicPerBlockCFiles(const string &basename, const string &m
|
||||||
ofstream output{filename, ios::out | ios::binary};
|
ofstream output{filename, ios::out | ios::binary};
|
||||||
if (!output.is_open())
|
if (!output.is_open())
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Can't open file " << filename << " for writing" << endl;
|
cerr << "ERROR: Can't open file " << filename.string() << " for writing" << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,7 +543,7 @@ DynamicModel::writeDynamicPerBlockCFiles(const string &basename, const string &m
|
||||||
ofstream header_output{filename, ios::out | ios::binary};
|
ofstream header_output{filename, ios::out | ios::binary};
|
||||||
if (!header_output.is_open())
|
if (!header_output.is_open())
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Can't open file " << filename << " for writing" << endl;
|
cerr << "ERROR: Can't open file " << filename.string() << " for writing" << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
header_output << header.str() << ';' << endl;
|
header_output << header.str() << ';' << endl;
|
||||||
|
@ -4605,7 +4605,7 @@ DynamicModel::isChecksumMatching(const string &basename) const
|
||||||
checksum_file.open(filename, ios::out | ios::binary);
|
checksum_file.open(filename, ios::out | ios::binary);
|
||||||
if (!checksum_file.is_open())
|
if (!checksum_file.is_open())
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Can't open file " << filename << endl;
|
cerr << "ERROR: Can't open file " << filename.string() << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
checksum_file << result;
|
checksum_file << result;
|
||||||
|
|
|
@ -1759,7 +1759,7 @@ ModelTree::compileMEX(const filesystem::path &output_dir, const string &output_b
|
||||||
cmd << '"';
|
cmd << '"';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cout << "Compiling " << output_filename << endl;
|
cout << "Compiling " << output_filename.string() << endl;
|
||||||
|
|
||||||
// The prerequisites are the object files among the input files
|
// The prerequisites are the object files among the input files
|
||||||
set<filesystem::path> prerequisites;
|
set<filesystem::path> prerequisites;
|
||||||
|
|
|
@ -837,7 +837,7 @@ ModelTree::writeModelCFile(const string &basename, const string &mexext,
|
||||||
output.open(p, ios::out | ios::binary);
|
output.open(p, ios::out | ios::binary);
|
||||||
if (!output.is_open())
|
if (!output.is_open())
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Can't open file " << p << " for writing" << endl;
|
cerr << "ERROR: Can't open file " << p.string() << " for writing" << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -167,7 +167,7 @@ StaticModel::writeStaticPerBlockCFiles(const string &basename, const string &mex
|
||||||
ofstream output{filename, ios::out | ios::binary};
|
ofstream output{filename, ios::out | ios::binary};
|
||||||
if (!output.is_open())
|
if (!output.is_open())
|
||||||
{
|
{
|
||||||
cerr << "ERROR: Can't open file " << filename << " for writing" << endl;
|
cerr << "ERROR: Can't open file " << filename.string() << " for writing" << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
output << "/* Block " << blk+1 << endl
|
output << "/* Block " << blk+1 << endl
|
||||||
|
|
Loading…
Reference in New Issue