minor documentation update

This commit is contained in:
James Turk 2005-01-27 05:24:11 +00:00
parent 07252d2424
commit 77fcb0ad25
4 changed files with 51 additions and 12 deletions

View File

@ -5,10 +5,13 @@
// James Turk (jpt2433@rit.edu) // James Turk (jpt2433@rit.edu)
// //
// Version: // Version:
// $Id: LogSink.h,v 1.1 2005/01/27 03:35:23 cozman Exp $ // $Id: LogSink.h,v 1.2 2005/01/27 05:24:11 cozman Exp $
// //
// Revisions: // Revisions:
// $Log: LogSink.h,v $ // $Log: LogSink.h,v $
// Revision 1.2 2005/01/27 05:24:11 cozman
// minor documentation update
//
// Revision 1.1 2005/01/27 03:35:23 cozman // Revision 1.1 2005/01/27 03:35:23 cozman
// initial import (exceptions,types, and logging,oh my!) // initial import (exceptions,types, and logging,oh my!)
// //
@ -23,6 +26,8 @@
namespace photon namespace photon
{ {
// Title: Logging Utilities
// Enum: LogLevel // Enum: LogLevel
// Enumeration defining severity of an error. // Enumeration defining severity of an error.
// //
@ -48,6 +53,11 @@ enum LogLevel
// Base class for all LogSinks to be used with <Log>, derived classes must // Base class for all LogSinks to be used with <Log>, derived classes must
// define message(LogLevel level, std::string string). // define message(LogLevel level, std::string string).
// A LogSink recieves any messages passed to the log it's registered with. // A LogSink recieves any messages passed to the log it's registered with.
//
// Children:
// <ConsoleSink>
// <TextSink>
// <HTMLSink>
class LogSink class LogSink
{ {
@ -109,6 +119,12 @@ private:
// Class: ConsoleSink // Class: ConsoleSink
// <LogSink> to be used with <Log> for simple console output. // <LogSink> to be used with <Log> for simple console output.
//
// See Also:
// <TextSink>, <HTMLSink>
//
// Parent:
// <LogSink>
class ConsoleSink : public LogSink class ConsoleSink : public LogSink
{ {
public: public:
@ -120,6 +136,12 @@ public:
// Class: TextSink // Class: TextSink
// <LogSink> to be used with <Log> for simple text file output. // <LogSink> to be used with <Log> for simple text file output.
//
// See Also:
// <ConsoleSink>, <HTMLSink>
//
// Parent:
// <LogSink>
class TextSink : public LogSink class TextSink : public LogSink
{ {
public: public:
@ -131,13 +153,19 @@ private:
std::ofstream out_; std::ofstream out_;
}; };
// Class: HtmlSink // Class: HTMLSink
// <LogSink> to be used with <Log> for simple HTML output. // <LogSink> to be used with <Log> for simple HTML output.
class HtmlSink : public LogSink //
// See Also:
// <TextSink>, <ConsoleSink>
//
// Parent:
// <LogSink>
class HTMLSink : public LogSink
{ {
public: public:
HtmlSink(std::string name, bool dynamic=false); HTMLSink(std::string name, bool dynamic=false);
virtual ~HtmlSink(); virtual ~HTMLSink();
virtual void writeMessage(LogLevel level, std::string msg); virtual void writeMessage(LogLevel level, std::string msg);
private: private:

View File

@ -5,10 +5,13 @@
// James Turk (jpt2433@rit.edu) // James Turk (jpt2433@rit.edu)
// //
// Version: // Version:
// $Id: exceptions.h,v 1.1 2005/01/27 03:35:23 cozman Exp $ // $Id: exceptions.h,v 1.2 2005/01/27 05:24:11 cozman Exp $
// //
// Revisions: // Revisions:
// $Log: exceptions.h,v $ // $Log: exceptions.h,v $
// Revision 1.2 2005/01/27 05:24:11 cozman
// minor documentation update
//
// Revision 1.1 2005/01/27 03:35:23 cozman // Revision 1.1 2005/01/27 03:35:23 cozman
// initial import (exceptions,types, and logging,oh my!) // initial import (exceptions,types, and logging,oh my!)
// //
@ -23,6 +26,8 @@
namespace photon namespace photon
{ {
// Title: Exception/Error Types
// Class: Throwable // Class: Throwable
// Throwable is the base exception class for Photon. // Throwable is the base exception class for Photon.
// //
@ -188,6 +193,8 @@ public:
}; };
// Section: Utility Functions
// Function: require // Function: require
// Similar to an assert, given a condition checks if it is true, and if it is // Similar to an assert, given a condition checks if it is true, and if it is
// not, throws an exception. // not, throws an exception.

1
ndoc/ndoc.sh Normal file
View File

@ -0,0 +1 @@
NaturalDocs -nag -i ../include -o HTML ../docs -p .

View File

@ -5,10 +5,13 @@
// James Turk (jpt2433@rit.edu) // James Turk (jpt2433@rit.edu)
// //
// Version: // Version:
// $Id: LogSink.cpp,v 1.1 2005/01/27 03:35:24 cozman Exp $ // $Id: LogSink.cpp,v 1.2 2005/01/27 05:24:11 cozman Exp $
// //
// Revisions: // Revisions:
// $Log: LogSink.cpp,v $ // $Log: LogSink.cpp,v $
// Revision 1.2 2005/01/27 05:24:11 cozman
// minor documentation update
//
// Revision 1.1 2005/01/27 03:35:24 cozman // Revision 1.1 2005/01/27 03:35:24 cozman
// initial import (exceptions,types, and logging,oh my!) // initial import (exceptions,types, and logging,oh my!)
// //
@ -88,9 +91,9 @@ void TextSink::writeMessage(LogLevel level, std::string msg)
out_ << pre[static_cast<int>(level)] << msg << std::endl; out_ << pre[static_cast<int>(level)] << msg << std::endl;
} }
//HtmlSink //HTMLSink
HtmlSink::HtmlSink(std::string name, bool dynamic) : HTMLSink::HTMLSink(std::string name, bool dynamic) :
LogSink(name,dynamic), LogSink(name,dynamic),
out_(std::string(name+".html").c_str()) out_(std::string(name+".html").c_str())
{ {
@ -108,13 +111,13 @@ HtmlSink::HtmlSink(std::string name, bool dynamic) :
<< std::endl << "<body>" << std::endl; << std::endl << "<body>" << std::endl;
} }
HtmlSink::~HtmlSink() HTMLSink::~HTMLSink()
{ {
out_ << "</body></html>" << std::endl; out_ << "</body></html>" << std::endl;
out_.close(); out_.close();
} }
void HtmlSink::writeMessage(LogLevel level, std::string msg) void HTMLSink::writeMessage(LogLevel level, std::string msg)
{ {
static char* css[] = {"note","verbose","warning","error","critical"}; static char* css[] = {"note","verbose","warning","error","critical"};
static char* pre[] = { " NOTE: ", static char* pre[] = { " NOTE: ",