30 Printer(
const string&
msg,
const string&
prepend):
31 _pos(0), _lineSize(0), _msg(
msg), _prefix(
prepend) {
35 while (_pos < _msg.size()) {
42 if (_pos == _msg.size())
44 if (_msg[_pos] ==
'\n') {
51 while (_pos < _msg.size()) {
52 if (_msg[_pos] ==
'\n') {
62 ASSERT(_msg[_pos] !=
'\n');
63 ASSERT(_pos < _msg.size());
66 while (_pos < _msg.size() &&
90 while (_pos < _msg.size() && _msg[_pos] !=
'\n' &&
isspace(_msg[_pos])) {
91 _indentation += _msg[_pos];
115 _lineSize +=
word.size();
126 const string& _prefix;
151 fputs(
"\n\n*** Error while printing error! ***\n",
stderr);
153 fputs(
"*** Retrying display of error using simpler display method. ***\n",
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
void display(const string &msg, const string &prepend)
Display msg to standard error with automatic line breaking.
void displayError(const string &msg)
Display msg to standard error in a way that indicates that it is an error.
void displayNote(const string &msg)
Display msg to standard error in a way that indicates that this is something that the user should tak...
void displayInternalError(const string &msg)
Display msg to standard in a way that indicates that it is an internal error.
void displayException(const std::exception &exception)
Display the message of exception.
This file contains functions for printing strings to standard error.