exceptions.cpp
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:2k
- /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
- Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
- Software license is located in file "COPYING"
- */
- #include "stdafx.h"
- #include "exceptions.h"
- void BasicException::init( const char *format, ... )
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- void BasicException::init( const char *format, va_list ap )
- {
- char buf[1024];
- vsnprintf( buf, sizeof( buf ), format, ap );
-
- text = buf;
- }
- // ---------------------------------------
- NetworkException::NetworkException( void *_some_pointer,
- const char *format, ... )
- : BasicException(), some_pointer( _some_pointer )
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- ProtocolException::ProtocolException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- SyntaxException::SyntaxException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- ShutdownException::ShutdownException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- MutexErrorException::MutexErrorException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- MutexTimeoutException::MutexTimeoutException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- VideoException::VideoException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }
- // ---------------------------------------
- ComportException::ComportException( const char *format, ... )
- : BasicException()
- {
- va_list ap;
- va_start( ap, format );
- init( format, ap );
- va_end( ap );
- }