FuzzyExceptions.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* Copyright 2010 Juan Rada-Vilela
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. /*
  13. * File: FuzzyExceptions.h
  14. * Author: jcrada
  15. *
  16. * Created on November 13, 2009, 3:34 PM
  17. */
  18. #ifndef FL_FUZZYEXCEPTIONS_H
  19. #define FL_FUZZYEXCEPTIONS_H
  20. #include "FuzzyException.h"
  21. #include <sstream>
  22. namespace fl {
  23. class OutOfRangeException : public FuzzyException {
  24. public:
  25. OutOfRangeException(const std::string& file, int line, const std::string& function,
  26. const std::string& message);
  27. OutOfRangeException(const std::string& file, int line, const std::string& function,
  28. const std::string& message, const FuzzyException& previous_exception);
  29. virtual ~OutOfRangeException() throw ();
  30. virtual std::string name() const throw ();
  31. static void CheckArray(const std::string& file, int line, const std::string& function,
  32. int index, int max);
  33. };
  34. class InvalidArgumentException : public FuzzyException {
  35. public:
  36. InvalidArgumentException(const std::string& file, int line, const std::string& function,
  37. const std::string& message);
  38. InvalidArgumentException(const std::string& file, int line, const std::string& function,
  39. const std::string& message, const FuzzyException& previous_exception);
  40. virtual ~InvalidArgumentException() throw ();
  41. virtual std::string name() const throw ();
  42. };
  43. class NullPointerException : public FuzzyException {
  44. public:
  45. NullPointerException(const std::string& file, int line, const std::string& function,
  46. const std::string& message);
  47. NullPointerException(const std::string& file, int line, const std::string& function,
  48. const std::string& message, const FuzzyException& previous_exception);
  49. virtual ~NullPointerException() throw ();
  50. virtual std::string name() const throw ();
  51. };
  52. class ParsingException : public FuzzyException {
  53. public:
  54. ParsingException(const std::string& file, int line, const std::string& function,
  55. const std::string& message);
  56. ParsingException(const std::string& file, int line, const std::string& function,
  57. const std::string& message, const FuzzyException& previous_exception);
  58. virtual ~ParsingException() throw ();
  59. virtual std::string name() const throw ();
  60. };
  61. }
  62. #endif /* FL_FUZZYEXCEPTIONS_H */