mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-01-26 11:04:33 +00:00
Run Tests/RunCMake/cmake-E-bin2c/generate_files.sh to regenerate the following files: - Tests/RunCMake/cmake-E-bin2c/long.c.txt - Tests/RunCMake/cmake-E-bin2c/long_signed.c.txt - Tests/RunCMake/cmake-E-bin2c/jack_count.cmake - Tests/RunCMake/cmake-E-bin2c/hashes.cmake
36 lines
887 B
C++
36 lines
887 B
C++
#include <fstream>
|
|
#include <ios>
|
|
#include <string>
|
|
|
|
static unsigned char const long_contents[] = {
|
|
#include "long.c.txt"
|
|
};
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc != 3) {
|
|
return 1;
|
|
}
|
|
std::string name = argv[1];
|
|
std::ofstream fout(argv[2], std::ios::out | std::ios::binary);
|
|
|
|
if (name == "basic") {
|
|
fout.write("\xFC\xFD\xFE\xFF\x00\x01\x02\x03", 8);
|
|
} else if (name == "empty") {
|
|
// Write nothing
|
|
} else if (name == "text_lf") {
|
|
fout << "All work and no play makes Jack a dull boy.\n";
|
|
} else if (name == "text_crlf") {
|
|
fout << "All work and no play makes Jack a dull boy.\r\n";
|
|
} else if (name == "text_align") {
|
|
fout << "This exactly 32 characters long!";
|
|
} else if (name == "long") {
|
|
fout.write(reinterpret_cast<char const*>(long_contents),
|
|
sizeof(long_contents));
|
|
}
|
|
|
|
fout.flush();
|
|
fout.close();
|
|
return 0;
|
|
}
|