Lucene++ - a full-featured, c++ search engine
API Documentation


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LuceneException.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef LUCENEEXCEPTION_H
8 #define LUCENEEXCEPTION_H
9 
10 #include "Lucene.h"
11 
12 namespace Lucene
13 {
15  class LPPAPI LuceneException : public std::exception
16  {
17  public:
19  {
29  IO,
47  UnsupportedOperation
48  };
49 
50  LuceneException(const String& error = EmptyString, LuceneException::ExceptionType type = Null) throw();
51  ~LuceneException() throw();
52 
53  protected:
55  String error;
56 
57  public:
58  ExceptionType getType() const;
59  String getError() const;
60  bool isNull() const;
61  void throwException();
62  };
63 
64  template <class ParentException, LuceneException::ExceptionType Type>
65  class ExceptionTemplate : public ParentException
66  {
67  public:
68  ExceptionTemplate(const String& error = EmptyString, LuceneException::ExceptionType type = Type) : ParentException(error, type)
69  {
70  }
71  };
72 
100 }
101 
102 #endif

clucene.sourceforge.net