From 77fcb0ad25b094179f0e54677327904834fef191 Mon Sep 17 00:00:00 2001 From: James Turk Date: Thu, 27 Jan 2005 05:24:11 +0000 Subject: [PATCH] minor documentation update --- include/LogSink.h | 38 +++++++++++++++++++++++++++++++++----- include/exceptions.h | 11 +++++++++-- ndoc/ndoc.sh | 1 + src/LogSink.cpp | 13 ++++++++----- 4 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 ndoc/ndoc.sh diff --git a/include/LogSink.h b/include/LogSink.h index 0a30c37..0a65a5b 100644 --- a/include/LogSink.h +++ b/include/LogSink.h @@ -5,10 +5,13 @@ // James Turk (jpt2433@rit.edu) // // 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: // $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 // initial import (exceptions,types, and logging,oh my!) // @@ -23,6 +26,8 @@ namespace photon { +// Title: Logging Utilities + // Enum: LogLevel // Enumeration defining severity of an error. // @@ -48,6 +53,11 @@ enum LogLevel // Base class for all LogSinks to be used with , derived classes must // define message(LogLevel level, std::string string). // A LogSink recieves any messages passed to the log it's registered with. +// +// Children: +// +// +// class LogSink { @@ -109,6 +119,12 @@ private: // Class: ConsoleSink // to be used with for simple console output. +// +// See Also: +// , +// +// Parent: +// class ConsoleSink : public LogSink { public: @@ -120,6 +136,12 @@ public: // Class: TextSink // to be used with for simple text file output. +// +// See Also: +// , +// +// Parent: +// class TextSink : public LogSink { public: @@ -131,13 +153,19 @@ private: std::ofstream out_; }; -// Class: HtmlSink +// Class: HTMLSink // to be used with for simple HTML output. -class HtmlSink : public LogSink +// +// See Also: +// , +// +// Parent: +// +class HTMLSink : public LogSink { public: - HtmlSink(std::string name, bool dynamic=false); - virtual ~HtmlSink(); + HTMLSink(std::string name, bool dynamic=false); + virtual ~HTMLSink(); virtual void writeMessage(LogLevel level, std::string msg); private: diff --git a/include/exceptions.h b/include/exceptions.h index 286ea3d..fd25bcc 100644 --- a/include/exceptions.h +++ b/include/exceptions.h @@ -5,10 +5,13 @@ // James Turk (jpt2433@rit.edu) // // 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: // $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 // initial import (exceptions,types, and logging,oh my!) // @@ -23,6 +26,8 @@ namespace photon { +// Title: Exception/Error Types + // Class: Throwable // Throwable is the base exception class for Photon. // @@ -54,7 +59,7 @@ private: // recoverable. // // See Also: -// +// // // Parent: // @@ -188,6 +193,8 @@ public: }; +// Section: Utility Functions + // Function: require // Similar to an assert, given a condition checks if it is true, and if it is // not, throws an exception. diff --git a/ndoc/ndoc.sh b/ndoc/ndoc.sh new file mode 100644 index 0000000..a75ea8f --- /dev/null +++ b/ndoc/ndoc.sh @@ -0,0 +1 @@ +NaturalDocs -nag -i ../include -o HTML ../docs -p . diff --git a/src/LogSink.cpp b/src/LogSink.cpp index 5bd4720..1eedd4d 100644 --- a/src/LogSink.cpp +++ b/src/LogSink.cpp @@ -5,10 +5,13 @@ // James Turk (jpt2433@rit.edu) // // 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: // $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 // initial import (exceptions,types, and logging,oh my!) // @@ -88,9 +91,9 @@ void TextSink::writeMessage(LogLevel level, std::string msg) out_ << pre[static_cast(level)] << msg << std::endl; } -//HtmlSink +//HTMLSink -HtmlSink::HtmlSink(std::string name, bool dynamic) : +HTMLSink::HTMLSink(std::string name, bool dynamic) : LogSink(name,dynamic), out_(std::string(name+".html").c_str()) { @@ -108,13 +111,13 @@ HtmlSink::HtmlSink(std::string name, bool dynamic) : << std::endl << "" << std::endl; } -HtmlSink::~HtmlSink() +HTMLSink::~HTMLSink() { out_ << "" << std::endl; 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* pre[] = { " NOTE: ",