warning.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License, version 2.0, as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is also distributed with certain software (including
  9. * but not limited to OpenSSL) that is licensed under separate terms,
  10. * as designated in a particular file or component or in included license
  11. * documentation. The authors of MySQL hereby grant you an
  12. * additional permission to link the program and your derivative works
  13. * with the separately licensed software that they have included with
  14. * MySQL.
  15. *
  16. * Without limiting anything contained in the foregoing, this file,
  17. * which is part of MySQL Connector/C++, is also subject to the
  18. * Universal FOSS Exception, version 1.0, a copy of which can be found at
  19. * http://oss.oracle.com/licenses/universal-foss-exception.
  20. *
  21. * This program is distributed in the hope that it will be useful, but
  22. * WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  24. * See the GNU General Public License, version 2.0, for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software Foundation, Inc.,
  28. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #ifndef _SQL_WARNING_H_
  31. #define _SQL_WARNING_H_
  32. #include <stdexcept>
  33. #include <string>
  34. #include <memory>
  35. #include "sqlstring.h"
  36. namespace sql
  37. {
  38. #ifdef _WIN32
  39. #pragma warning (disable : 4290)
  40. //warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
  41. #endif
  42. class SQLWarning
  43. {
  44. public:
  45. SQLWarning(){}
  46. virtual const sql::SQLString & getMessage() const = 0;
  47. virtual const sql::SQLString & getSQLState() const = 0;
  48. virtual int getErrorCode() const = 0;
  49. virtual const SQLWarning * getNextWarning() const = 0;
  50. virtual void setNextWarning(const SQLWarning * _next) = 0;
  51. protected:
  52. virtual ~SQLWarning(){};
  53. SQLWarning(const SQLWarning&){};
  54. private:
  55. const SQLWarning & operator = (const SQLWarning & rhs);
  56. };
  57. } /* namespace sql */
  58. #endif /* _SQL_WARNING_H_ */