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 
2 // Copyright (c) 2009-2014 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 public:
27  IO,
45  UnsupportedOperation
46  };
47 
48  LuceneException(const String& error = EmptyString, LuceneException::ExceptionType type = Null) throw();
49  ~LuceneException() throw();
50 
51 protected:
53  String error;
54 
55 public:
56  ExceptionType getType() const;
57  String getError() const;
58  bool isNull() const;
59  void throwException();
60 };
61 
62 template <class ParentException, LuceneException::ExceptionType Type>
63 class ExceptionTemplate : public ParentException {
64 public:
65  ExceptionTemplate(const String& error = EmptyString, LuceneException::ExceptionType type = Type) : ParentException(error, type) {
66  }
67 };
68 
96 }
97 
98 #endif

clucene.sourceforge.net