xml_archive_exception.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP
  2. #define BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // xml_archive_exception.hpp:
  9. // (C) Copyright 2007 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <exception>
  15. #include <boost/assert.hpp>
  16. #include <boost/config.hpp>
  17. #include <boost/preprocessor/empty.hpp>
  18. #include <boost/archive/detail/decl.hpp>
  19. #include <boost/archive/archive_exception.hpp>
  20. #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
  21. namespace boost {
  22. namespace archive {
  23. //////////////////////////////////////////////////////////////////////
  24. // exceptions thrown by xml archives
  25. //
  26. class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception :
  27. public virtual boost::archive::archive_exception
  28. {
  29. public:
  30. typedef enum {
  31. xml_archive_parsing_error, // see save_register
  32. xml_archive_tag_mismatch,
  33. xml_archive_tag_name_error
  34. } exception_code;
  35. xml_archive_exception(
  36. exception_code c,
  37. const char * e1 = NULL,
  38. const char * e2 = NULL
  39. );
  40. };
  41. }// namespace archive
  42. }// namespace boost
  43. #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
  44. #endif //BOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP