68 Name = strcpy(
new char[strlen(myname) + 1], myname);
78 : FormatBuf(
std::ios::out), OpenedSuccessfully(true) {
93 : FormatBuf(
std::ios::out), OpenedSuccessfully(true) {
99 MsgDest =
new std::ofstream(fname, std::ios::out);
101 MsgDest =
new std::ofstream(fname, std::ios::app);
107 std::cerr <<
"Inform: Cannot open file '" << fname <<
"'." <<
std::endl;
117 setup(myname, pnode);
124 : FormatBuf(
std::ios::out), OpenedSuccessfully(true) {
131 setup(myname, pnode);
138 : FormatBuf(
std::ios::out), MsgDest(os.MsgDest), OpenedSuccessfully(true) {
144 setup(myname, pnode);
191 char *stend = buf + strlen(buf);
194 while (*buf ==
'\n') {
200 while ( (buf = strtok(buf,
"\n")) != 0 ) {
207 while (*buf ==
'\n') {
255 char* cstring =
const_cast<char*
>(
MsgBuf.c_str());
271#ifdef DEBUG_INFORM_CLASS
273 int main(
int argc,
char *argv[]) {
278 Inform inf(
"Inform Test");
281 for ( i=0; i < argc ; i++)
282 inf <<
"Argument " << i <<
" = " << argv[i] <<
"\n";
287 inf <<
level2 <<
"This is the second test." <<
endl;
int main(int argc, char *argv[])
Inform & level2(Inform &inf)
Inform & level4(Inform &inf)
constexpr int MAX_INFORM_LEVEL
Inform & endl(Inform &inf)
Inform & level1(Inform &inf)
Inform & level3(Inform &inf)
constexpr int MIN_INFORM_LEVEL
Inform & level5(Inform &inf)
Inform & outputMessage(void)
void display_single_line(char *)
Inform(const char *=0, int=0)
void setDestination(std::ostream &dest)
Inform & setOutputLevel(const int)
void display_message(char *)
std::ostringstream FormatBuf
Inform & setMessageLevel(const int)
void setup(const char *, int)
int getOutputLevel(void) const