1 /* 2 * Copyright 2006-2012 The FLWOR Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 %feature("director") DiagnosticHandler; 18 19 %{ // start Implementations 20 error(const zorba::ZorbaException & ze)21 void DiagnosticHandler::error (const zorba::ZorbaException &ze) 22 { 23 if ( zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze ) ) { 24 const XQueryException xe2(xe); 25 error(xe2); 26 } 27 if ( zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze ) ) { 28 const UserException ue2(ue); 29 error(ue2); 30 } 31 } warning(const zorba::XQueryException & xw)32 void DiagnosticHandler::warning (const zorba::XQueryException &xw) 33 { 34 // TODO: do something with warning 35 } 36 ~DiagnosticHandler()37 DiagnosticHandler::~DiagnosticHandler() {} error(const ZorbaException & ze)38 void DiagnosticHandler::error(const ZorbaException &ze) { 39 } 40 41 42 %} // end Implementations 43 44 %include "DiagnosticHandler.h" 45