|
From: <syn...@us...> - 2009-04-22 18:12:21
|
Revision: 3001
http://clucene.svn.sourceforge.net/clucene/?rev=3001&view=rev
Author: synhershko
Date: 2009-04-22 18:12:11 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Tweaking CLuceneError a bit
Modified Paths:
--------------
branches/lucene2_3_2/src/core/CLucene/debug/error.cpp
branches/lucene2_3_2/src/core/CLucene/debug/error.h
Modified: branches/lucene2_3_2/src/core/CLucene/debug/error.cpp
===================================================================
--- branches/lucene2_3_2/src/core/CLucene/debug/error.cpp 2009-04-22 17:54:32 UTC (rev 3000)
+++ branches/lucene2_3_2/src/core/CLucene/debug/error.cpp 2009-04-22 18:12:11 UTC (rev 3001)
@@ -43,8 +43,8 @@
this->_twhat = STRDUP_TtoT(clone._twhat);
}
CLuceneError::~CLuceneError() throw(){
- _CLDELETE_CARRAY(_twhat);
- _CLDELETE_CaARRAY(_awhat);
+ _CLDELETE_LCARRAY(_twhat);
+ _CLDELETE_LCaARRAY(_awhat);
}
char* CLuceneError::what(){
#ifdef _ASCII
Modified: branches/lucene2_3_2/src/core/CLucene/debug/error.h
===================================================================
--- branches/lucene2_3_2/src/core/CLucene/debug/error.h 2009-04-22 17:54:32 UTC (rev 3000)
+++ branches/lucene2_3_2/src/core/CLucene/debug/error.h 2009-04-22 18:12:11 UTC (rev 3001)
@@ -55,29 +55,30 @@
*/
#else
- class CLUCENE_EXPORT CLuceneError
- {
+class CLUCENE_EXPORT CLuceneError
+{
char* _awhat;
TCHAR* _twhat;
- int error_number;
- public:
- CLuceneError();
- CLuceneError(const CLuceneError& clone);
- CLuceneError(int num, const char* str, bool ownstr);
+ int error_number;
+public:
+ CLuceneError();
+ CLuceneError(const CLuceneError& clone);
+ CLuceneError(int num, const char* str, bool ownstr);
#ifdef _UCS2
- CLuceneError(int num, const TCHAR* str, bool ownstr);
+ CLuceneError(int num, const TCHAR* str, bool ownstr);
#endif
- int number(){return error_number;}
- char* what();
- TCHAR* twhat();
- ~CLuceneError() throw();
+ int number(){return error_number;}
+ char* what();
+ TCHAR* twhat();
+ ~CLuceneError() throw();
- void set(int num, const char*, bool ownstr=false);
- void set(int num, const TCHAR*, bool ownstr=false);
- };
+ void set(int num, const char*, bool ownstr=false);
+ void set(int num, const TCHAR*, bool ownstr=false);
+};
//#define _THROWS //does nothing
#define _TRY try
+ #define _CLCATCH_ERR(err_num, cleanup, x) catch(CLuceneError& err){if (err.number!=err_num){cleanup;throw err;}else {x;}}
#define _CLFINALLY(x) catch(...){ x; throw; } x //note: code x is not run if return is called
#define _CLTHROWA(number, str) throw CLuceneError(number, str,false)
#define _CLTHROWT(number, str) throw CLuceneError(number, str,false)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|