MCPcopy Create free account
hub / github.com/Kitware/VTK / PrintFile

Function PrintFile

IO/SQL/Testing/Cxx/TestSQLiteTableReadWrite.cxx:97–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void PrintFile(const char* name, std::ostream& os)
98{
99 const char* div = "=======================================================================";
100 // Preserve valuable output regardless of the limits set in
101 // CMake/CTestCustom.cmake
102 os << "CTEST_FULL_OUTPUT\n";
103 os << "File \"" << name << "\"";
104 vtksys::SystemTools::Stat_t fs;
105 if (vtksys::SystemTools::Stat(name, &fs) != 0)
106 {
107 os << " does not exist.\n";
108 return;
109 }
110 else
111 {
112 os << " has " << fs.st_size << " bytes";
113 }
114
115 vtksys::ifstream fin(name);
116 if (fin)
117 {
118 os << ":\n" << div << "\n";
119 os << fin.rdbuf();
120 os << div << "\n";
121 os.flush();
122 }
123 else
124 {
125 os << " but cannot be opened for read.\n";
126 }
127}
128
129bool CompareAsciiFiles(const char* file1, const char* file2)
130{

Callers 1

TestSQLiteTableReadWriteFunction · 0.85

Calls 2

rdbufMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected