Last change
on this file since 269 was
221,
checked in by Matthew Whiting, 17 years ago
|
More documentation being added to source code, with a new file (src/Utils/Hanning.cc) added as well.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[120] | 1 | #include <iostream> |
---|
| 2 | #include <iomanip> |
---|
| 3 | #include <string> |
---|
| 4 | #include <duchamp.hh> |
---|
| 5 | |
---|
| 6 | void duchampWarning(std::string subroutine, std::string warning) |
---|
| 7 | { |
---|
[221] | 8 | /** |
---|
| 9 | * Prints a WARNING message to the standard error stream, quoting |
---|
| 10 | * the subroutine that the problem occurred in, and a descriptive |
---|
| 11 | * warning text. |
---|
| 12 | * |
---|
| 13 | * Format: WARNING \<function\> : Something happened that you should be aware of. |
---|
| 14 | */ |
---|
[120] | 15 | std::string preamble = "WARNING <" + subroutine + "> : "; |
---|
| 16 | std::cerr << preamble; |
---|
| 17 | for(int i=0;i<warning.size();i++){ |
---|
| 18 | std::cerr << warning[i]; |
---|
| 19 | if((i!=warning.size()-1)&&(warning[i]=='\n')) |
---|
| 20 | std::cerr << std::setw(preamble.size()) <<": "; |
---|
| 21 | } |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | void duchampError(std::string subroutine, std::string error) |
---|
| 25 | { |
---|
[221] | 26 | /** |
---|
| 27 | * Prints an ERROR message to the standard error stream, quoting |
---|
| 28 | * the subroutine that the problem occurred in, a descriptive |
---|
| 29 | * warning text, and sounding the bell. |
---|
| 30 | * |
---|
| 31 | * Format: ERROR \<function\> : Something bad happened. |
---|
| 32 | */ |
---|
[164] | 33 | std::string preamble = "\aERROR <" + subroutine + "> : "; |
---|
[120] | 34 | std::cerr << preamble; |
---|
| 35 | for(int i=0;i<error.size();i++){ |
---|
| 36 | std::cerr << error[i]; |
---|
| 37 | if((i!=error.size()-1)&&(error[i]=='\n')) |
---|
[164] | 38 | std::cerr << std::setw(preamble.size()-1) <<": "; |
---|
[120] | 39 | } |
---|
| 40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.