#include <misc.h>
Definition at line 149 of file misc.h.
void shared::FileContentsEscaper::quoteAndPrint |
( |
std::ostream & |
os | ) |
const |
Definition at line 153 of file misc.cpp.
References filename.
Referenced by shared::operator<<().
155 if (!file.is_open()) {
156 os <<
"\"Unable to open " <<
filename <<
'"';
160 std::ios orig_os_state(
nullptr);
161 orig_os_state.copyfmt(os);
163 while (file.get(ch)) {
166 }
else if (ch ==
'\\') {
168 }
else if (std::isprint(ch) || ch ==
' ') {
173 case '\b': os <<
"\\b";
break;
174 case '\f': os <<
"\\f";
break;
175 case '\n': os <<
"\\n";
break;
176 case '\r': os <<
"\\r";
break;
177 case '\t': os <<
"\\t";
break;
180 os <<
"\\u" << std::hex << std::setw(4) << std::setfill(
'0')
181 <<
static_cast<unsigned>(
static_cast<unsigned char>(ch));
187 os.copyfmt(orig_os_state);
char const *const filename
char const* const shared::FileContentsEscaper::filename |
The documentation for this struct was generated from the following files:
- /home/jenkins-slave/workspace/core-os-doxygen/Shared/misc.h
- /home/jenkins-slave/workspace/core-os-doxygen/Shared/misc.cpp