Merging in changes trunk updates: adding standard error_info typedefs, updating the documentation.

[SVN r55094]
This commit is contained in:
Emil Dotchevski
2009-07-22 20:55:50 +00:00
parent 6a8b96d9c3
commit 0f5a51238b
64 changed files with 13772 additions and 8727 deletions

View File

@ -5,28 +5,24 @@
//This example shows how to add arbitrary data to active exception objects.
#include <boost/exception.hpp>
#include <boost/exception/all.hpp>
#include <boost/shared_ptr.hpp>
#include <stdio.h>
#include <errno.h>
//
typedef boost::error_info<struct tag_errno,int> errno_info;
class file_read_error: public boost::exception { };
struct file_read_error: virtual boost::exception { };
void
file_read( FILE * f, void * buffer, size_t size )
{
if( size!=fread(buffer,1,size,f) )
throw file_read_error() << errno_info(errno);
throw file_read_error() << boost::errinfo_errno(errno);
}
//
typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode );
void file_read( FILE * f, void * buffer, size_t size );
@ -43,7 +39,7 @@ parse_file( char const * file_name )
catch(
boost::exception & e )
{
e << file_name_info(file_name);
e << boost::errinfo_file_name(file_name);
throw;
}
}