$treeview $search $mathjax
Stratagus  2.2.7
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

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");

Constructor & Destructor Documentation

gcn::Exception::Exception (  ) 

Constructor.

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

Constructor.

Parameters:
message the error message.

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.


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.

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

Gets the error message of the exception.

Returns:
the error message.

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.

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.


Member Data Documentation

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

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

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

int gcn::Exception::mLine [protected]


The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.