diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/libs/boost-1.37.0/boost/exception/get_error_info.hpp | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/libs/boost-1.37.0/boost/exception/get_error_info.hpp')
-rw-r--r-- | src/libs/boost-1.37.0/boost/exception/get_error_info.hpp | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/src/libs/boost-1.37.0/boost/exception/get_error_info.hpp b/src/libs/boost-1.37.0/boost/exception/get_error_info.hpp deleted file mode 100644 index e45d3d6e..00000000 --- a/src/libs/boost-1.37.0/boost/exception/get_error_info.hpp +++ /dev/null @@ -1,134 +0,0 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. - -//Distributed under the Boost Software License, Version 1.0. (See accompanying -//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef UUID_1A590226753311DD9E4CCF6156D89593 -#define UUID_1A590226753311DD9E4CCF6156D89593 - -#include <boost/exception/exception.hpp> -#include <boost/exception/detail/error_info_impl.hpp> -#include <boost/exception/detail/type_info.hpp> -#include <boost/shared_ptr.hpp> - -namespace -boost - { - namespace - exception_detail - { - struct - strwrap - { - std::string str; - char const * ptr; - - explicit - strwrap( char const * s ): - str(s), - ptr(&str[0]) - { - } - - private: - - strwrap( strwrap const & ); - strwrap & operator=( strwrap const & ); - }; - - template <> - struct - get_info<throw_function> - { - static - shared_ptr<char const * const> - get( exception const & x ) - { - if( x.throw_function_ && *x.throw_function_ ) - { - shared_ptr<strwrap> s(new strwrap(x.throw_function_)); - return shared_ptr<char const *>(s,&s->ptr); - } - else - return shared_ptr<char const * const>(); - } - }; - - template <> - struct - get_info<throw_file> - { - static - shared_ptr<char const * const> - get( exception const & x ) - { - if( x.throw_file_ && *x.throw_file_ ) - { - shared_ptr<strwrap> s(new strwrap(x.throw_file_)); - return shared_ptr<char const *>(s,&s->ptr); - } - else - return shared_ptr<char const * const>(); - } - }; - - template <> - struct - get_info<throw_line> - { - static - shared_ptr<int const> - get( exception const & x ) - { - if( x.throw_line_!=-1 ) - return boost::shared_ptr<int>(new int(x.throw_line_)); - else - return shared_ptr<int const>(); - } - }; - - template <class ErrorInfo> - struct - get_info - { - static - shared_ptr<typename ErrorInfo::value_type const> - get( exception const & x ) - { - if( exception_detail::error_info_container * c=x.data_.get() ) - if( shared_ptr<exception_detail::error_info_base const> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) - { -#ifndef BOOST_NO_RTTI - BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo const *>(eib.get()) ); -#endif - ErrorInfo const * w = static_cast<ErrorInfo const *>(eib.get()); - return shared_ptr<typename ErrorInfo::value_type const>(eib,&w->value()); - } - return shared_ptr<typename ErrorInfo::value_type const>(); - } - }; - } - -#ifdef BOOST_NO_RTTI - template <class ErrorInfo> - inline - shared_ptr<typename ErrorInfo::value_type const> - get_error_info( boost::exception const & x ) - { - return exception_detail::get_info<ErrorInfo>::get(x); - } -#else - template <class ErrorInfo,class E> - inline - shared_ptr<typename ErrorInfo::value_type const> - get_error_info( E const & some_exception ) - { - if( exception const * x = dynamic_cast<exception const *>(&some_exception) ) - return exception_detail::get_info<ErrorInfo>::get(*x); - else - return shared_ptr<typename ErrorInfo::value_type const>(); - } -#endif - } - -#endif |