Documentation and examples update.

[SVN r54831]
This commit is contained in:
Emil Dotchevski
2009-07-09 07:35:15 +00:00
parent 953399846a
commit 2b34528ef0
11 changed files with 6466 additions and 6410 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 { };
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;
}
}