/*
      _______                          .__ .__   .__   .__                 
      \      \    ____   __ __ _______ |__||  |  |  |  |__|  ____    ____  
      /   |   \ _/ __ \ |  |  \\_  __ \|  ||  |  |  |  |  | /  _ \  /    \ 
     /    |    \\  ___/ |  |  / |  | \/|  ||  |__|  |__|  |(  <_> )|   |  \
     \____|__  / \___  >|____/  |__|   |__||____/|____/|__| \____/ |___|  /
    =========\/======\/=================================================\/==
  v0.01 04/JUL/2007 © Copyright 2007-2007 Scott D. Yelich SOME RIGHTS RESERVED
 .,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.-*~'`^`'~*-,._.,-*~'`^`'~*-,. 


  LICENSE:  Creative Commons Attribution 3.0 License.
  SEE:      http://creativecommons.org/licenses/by/3.0/


  Mon Aug 20 23:07:19 EDT 2007, v0.03 sdy

  This is Xql3.h, part of Xql.

  See Xql3.cpp for implementation details.

*/

#ifndef XQL3EXCEPTION_H
#define XQL3EXCEPTION_H

#include <stdexcept>

class Xql3Exception : public std::exception
{

  public:

  Xql3Exception(const int code,
                const std::string & message) :
     _code(code),
     _message(message)
  {
  }

  Xql3Exception(const int code) :
     _code(code),
     _message()
  {
  }

  Xql3Exception(const std::string & message) :
     _code(-1),
     _message(message)
  {
  }

  Xql3Exception() :
    _code(-1),
    _message()
  {
  }

  ~Xql3Exception() throw()
  {
  }

  const char*
  what() const throw()
  {
    return _message.c_str();
  }

  const int
  code() const throw()
  {
    return _code;
  }

  private:

  int _code;
  std::string _message;

};

#endif
