____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

gcn::Exception Class Reference

#include <exception.h>

List of all members.

Public Member Functions

 Exception ()
 Exception (const std::string &message)
 Exception (const std::string &message, const std::string &function, const std::string &filename, int line)
const std::string & getFunction () const
const std::string & getMessage () const
const std::string & getFilename () const
int getLine () const

Protected Attributes

std::string mFunction
std::string mMessage
std::string mFilename
int mLine


Detailed Description

An exception containing a message, a file and a line number. Guichan will only throw exceptions of this class. You can use this class for your own exceptions. A nifty feature of the excpetion class is that it can tell you from which line and file it was thrown. To make things easier when throwing exceptions there exists a macro for creating exceptions which automatically sets the filename and line number.

EXAMPLE:

          throw GCN_EXCEPTION("my error message");

Definition at line 94 of file exception.h.


Constructor & Destructor Documentation

gcn::Exception::Exception (  ) 

Constructor.

Definition at line 63 of file exception.cpp.

References mLine.

gcn::Exception::Exception ( const std::string &  message  ) 

Constructor.

Parameters:
message the error message.

Definition at line 68 of file exception.cpp.

References mMessage.

gcn::Exception::Exception ( const std::string &  message,
const std::string &  function,
const std::string &  filename,
int  line 
)

Constructor.

NOTE: Don't use this constructor. Use the GCN_EXCEPTION macro instead.

Parameters:
message the error message.
function the function name.
filename the name of the file.
line the line number.

Definition at line 73 of file exception.cpp.

References mFilename, mFunction, mLine, and mMessage.


Member Function Documentation

const std::string & gcn::Exception::getFunction (  )  const

Gets the function name in which the exception was thrown.

Returns:
the function name in which the exception was thrown.

Definition at line 84 of file exception.cpp.

References mFunction.

const std::string & gcn::Exception::getMessage (  )  const

Gets the error message of the exception.

Returns:
the error message.

Definition at line 89 of file exception.cpp.

References mMessage.

const std::string & gcn::Exception::getFilename (  )  const

Gets the filename in which the exceptions was thrown.

Returns:
the filename in which the exception was thrown.

Definition at line 94 of file exception.cpp.

References mFilename.

int gcn::Exception::getLine (  )  const

Gets the line number of the line where the exception was thrown.

Returns:
the line number of the line where the exception was thrown.

Definition at line 99 of file exception.cpp.

References mLine.


Member Data Documentation

std::string gcn::Exception::mFunction [protected]

Definition at line 154 of file exception.h.

Referenced by Exception(), and getFunction().

std::string gcn::Exception::mMessage [protected]

Definition at line 155 of file exception.h.

Referenced by Exception(), and getMessage().

std::string gcn::Exception::mFilename [protected]

Definition at line 156 of file exception.h.

Referenced by Exception(), and getFilename().

int gcn::Exception::mLine [protected]

Definition at line 157 of file exception.h.

Referenced by Exception(), and getLine().


The documentation for this class was generated from the following files:

Generated on Sat Feb 21 00:28:26 2009 for Bos Wars by  doxygen 1.5.6