error.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
  2. // (C) Copyright 2003-2007 Jonathan Turkanis
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
  5. // See http://www.boost.org/libs/iostreams for documentation.
  6. #ifndef BOOST_IOSTREAMS_DETAIL_ERROR_HPP_INCLUDED
  7. #define BOOST_IOSTREAMS_DETAIL_ERROR_HPP_INCLUDED
  8. #if defined(_MSC_VER)
  9. # pragma once
  10. #endif
  11. #include <boost/iostreams/detail/ios.hpp> // failure.
  12. namespace boost { namespace iostreams { namespace detail {
  13. inline BOOST_IOSTREAMS_FAILURE cant_read()
  14. { return BOOST_IOSTREAMS_FAILURE("no read access"); }
  15. inline BOOST_IOSTREAMS_FAILURE cant_write()
  16. { return BOOST_IOSTREAMS_FAILURE("no write access"); }
  17. inline BOOST_IOSTREAMS_FAILURE cant_seek()
  18. { return BOOST_IOSTREAMS_FAILURE("no random access"); }
  19. inline BOOST_IOSTREAMS_FAILURE bad_read()
  20. { return BOOST_IOSTREAMS_FAILURE("bad read"); }
  21. inline BOOST_IOSTREAMS_FAILURE bad_putback()
  22. { return BOOST_IOSTREAMS_FAILURE("putback buffer full"); }
  23. inline BOOST_IOSTREAMS_FAILURE bad_write()
  24. { return BOOST_IOSTREAMS_FAILURE("bad write"); }
  25. inline BOOST_IOSTREAMS_FAILURE write_area_exhausted()
  26. { return BOOST_IOSTREAMS_FAILURE("write area exhausted"); }
  27. inline BOOST_IOSTREAMS_FAILURE bad_seek()
  28. { return BOOST_IOSTREAMS_FAILURE("bad seek"); }
  29. } } } // End namespaces detail, iostreams, boost.
  30. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_ERROR_HPP_INCLUDED