1 ///////////////////////////////////////////////////////////////////////////////
\r
3 // File : $Id: _ibs.cpp,v 1.2 2009/03/19 20:00:27 faust Exp $
\r
4 // Subject : IBPP, internal Status class implementation
\r
6 ///////////////////////////////////////////////////////////////////////////////
\r
8 // (C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
\r
10 // The contents of this file are subject to the IBPP License (the "License");
\r
11 // you may not use this file except in compliance with the License. You may
\r
12 // obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
\r
13 // file which must have been distributed along with this file.
\r
15 // This software, distributed under the License, is distributed on an "AS IS"
\r
16 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
\r
17 // License for the specific language governing rights and limitations
\r
18 // under the License.
\r
20 ///////////////////////////////////////////////////////////////////////////////
\r
23 // * Tabulations should be set every four characters when editing this file.
\r
25 ///////////////////////////////////////////////////////////////////////////////
\r
28 #pragma warning(disable: 4786 4996)
\r
30 #pragma warning(disable: 4702)
\r
42 using namespace ibpp_internals;
\r
44 int IBS::SqlCode() const
\r
46 return (int)(*gds.Call()->m_sqlcode)(&mVector[0]);
\r
49 const char* IBS::ErrorMessage() const
\r
54 if (! mMessage.empty()) return mMessage.c_str(); // If message compiled, returns it
\r
56 // Compiles the message (SQL part)
\r
57 std::ostringstream message;
\r
58 sqlcode = (*gds.Call()->m_sqlcode)(mVector);
\r
59 if (sqlcode != -999)
\r
61 (*gds.Call()->m_sql_interprete)((short)sqlcode, msg, sizeof(msg));
\r
62 message<< _("SQL Message : ")<< sqlcode<< "\n"<< msg<< "\n\n";
\r
65 message<< _("Engine Code : ")<< EngineCode()<< "\n";
\r
67 // Compiles the message (Engine part)
\r
68 ISC_STATUS* error = &mVector[0];
\r
69 try { (*gds.Call()->m_interprete)(msg, &error); }
\r
70 catch(...) { msg[0] = '\0'; }
\r
71 message<< _("Engine Message :")<< "\n"<< msg;
\r
74 while ((*gds.Call()->m_interprete)(msg, &error))
\r
75 message<< "\n"<< msg;
\r
80 mMessage = message.str();
\r
81 return mMessage.c_str();
\r
86 for (int i = 0; i < 20; i++) mVector[i] = 0;
\r
99 /** Copy Constructor
\r
102 IBS::IBS(IBS& copied)
\r
104 memcpy(mVector, copied.mVector, sizeof(mVector));
\r