Skip to content

Commit df437ea

Browse files
committed
convert SQLException to const ref
1 parent ec2e608 commit df437ea

6 files changed

Lines changed: 18 additions & 18 deletions

File tree

IscDbc/JString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const char* JString::getString()
199199
return (string) ? string : "";
200200
}
201201

202-
JString::operator const char* ()
202+
JString::operator const char* () const
203203
{
204204
/**************************************
205205
*

IscDbc/JString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class JString
6161

6262
void Format (const char*, ...);
6363
const char *getString();
64-
operator const char*();
64+
operator const char*() const;
6565
JString& operator = (const char *string);
6666
JString& operator = (const JString& string);
6767
JString& operator+=(const char *string);

IscDbc/SQLError.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ SQLError::~SQLError () throw()
112112

113113
}
114114

115-
int SQLError::getSqlcode ()
115+
int SQLError::getSqlcode () const
116116
{
117117
/**************************************
118118
*
@@ -128,7 +128,7 @@ int SQLError::getSqlcode ()
128128
return sqlcode;
129129
}
130130

131-
int SQLError::getFbcode ()
131+
int SQLError::getFbcode () const
132132
{
133133
/**************************************
134134
*
@@ -144,7 +144,7 @@ int SQLError::getFbcode ()
144144
return fbcode;
145145
}
146146

147-
const char *SQLError::getText ()
147+
const char *SQLError::getText () const
148148
{
149149
/**************************************
150150
*
@@ -160,7 +160,7 @@ const char *SQLError::getText ()
160160
return text;
161161
}
162162

163-
SQLError::operator const char* ()
163+
SQLError::operator const char* () const
164164
{
165165
/**************************************
166166
*
@@ -193,7 +193,7 @@ SQLError::SQLError( int code, __int64 codefb, const char * txt, ...)
193193
fbcode = (int) codefb;
194194
}
195195

196-
const char* SQLError::getTrace()
196+
const char* SQLError::getTrace() const
197197
{
198198
return stackTrace;
199199
}

IscDbc/SQLError.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ class SQLError : public SQLException
3333
public:
3434
virtual int release();
3535
virtual void addRef();
36-
virtual const char* getTrace();
36+
virtual const char* getTrace() const;
3737
SQLError (int sqlcode, __int64 fbcode, const char *text, ...);
3838
SQLError (SqlCode sqlcode, const char *text, ...);
3939
SQLError (Stream *trace, SqlCode code, const char *txt,...);
4040
~SQLError() throw();
4141

42-
virtual int getFbcode ();
43-
virtual int getSqlcode ();
44-
virtual const char *getText();
42+
virtual int getFbcode () const;
43+
virtual int getSqlcode () const;
44+
virtual const char *getText() const;
4545

4646
//void Delete();
47-
operator const char*();
47+
operator const char*() const;
4848

4949
int fbcode;
5050
int sqlcode;

IscDbc/SQLException.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class DllExport SQLException : public std::exception
4242
public:
4343
//virtual void addRef() = 0;
4444
//virtual int release() = 0;
45-
virtual int getFbcode () = 0;
46-
virtual int getSqlcode () = 0;
47-
virtual const char *getText() = 0;
48-
virtual const char *getTrace() = 0;
45+
virtual int getFbcode () const = 0;
46+
virtual int getSqlcode () const = 0;
47+
virtual const char *getText() const = 0;
48+
virtual const char *getTrace() const = 0;
4949
};
5050

5151
}; // end namespace IscDbcLibrary

OdbcJdbcSetup/DsnDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ void CDsnDialog::OnTestConnection( HWND hDlg )
789789

790790
MessageBox( hDlg, _TR( IDS_MESSAGE_01, "Connection successful!" ), TEXT( strHeadDlg ), MB_ICONINFORMATION | MB_OK );
791791
}
792-
catch (SQLException &ex)
792+
catch (const SQLException &ex)
793793
{
794794
char buffer[2048];
795795
JString text = ex.getText();
@@ -799,7 +799,7 @@ void CDsnDialog::OnTestConnection( HWND hDlg )
799799

800800
MessageBox( hDlg, TEXT( buffer ), TEXT( strHeadDlg ), MB_ICONERROR | MB_OK );
801801
}
802-
catch (std::exception &ex)
802+
catch (const std::exception &ex)
803803
{
804804
char buffer[2048];
805805
JString text = ex.what();

0 commit comments

Comments
 (0)