00001 /*---------------------------------------------------------------------* 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2003 Qgar Project, LORIA | 00004 | | 00005 | This library is free software; you can redistribute it and/or | 00006 | modify it under the terms of the GNU Lesser General Public | 00007 | License version 2.1, as published by the Free Software Foundation. | 00008 | | 00009 | This library is distributed in the hope that it will be useful, | 00010 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00011 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 00012 | See the GNU Lesser General Public License for more details. | 00013 | | 00014 | The GNU Lesser General Public License is included in the file | 00015 | LICENSE.LGPL, in the root directory of the Qgar packaging. See | 00016 | http://www.gnu.org/licenses/lgpl.html for the terms of the license. | 00017 | To receive a paper copy, write to the Free Software Foundation, | 00018 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | 00019 | | 00020 | Contact Project Qgar for any information: | 00021 | LORIA - équipe Qgar | 00022 | B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France | 00023 | email: qgar-contact@loria.fr | 00024 | http://www.qgar.org/ | 00025 *---------------------------------------------------------------------*/ 00026 00027 00028 /** 00029 * @file XercesAttributesAdaptor.C 00030 * @brief Implementation of class qgxml::XercesAttributesAdaptor. 00031 * 00032 * See file XercesAttributesAdaptor.H for the interface. 00033 * 00034 * @author <a href="mailto:qgar-contact@loria.fr?subject=Qgar fwd Jan Rendek">Jan Rendek</a> 00035 * @date March 31, 2003 10:10 00036 * @since Qgar 2.1 00037 */ 00038 00039 00040 // For RCS/CVS use: Do not delete 00041 /* $Id: XercesAttributesAdaptor.C,v 1.3 2004/07/01 22:19:37 masini Exp $ */ 00042 00043 00044 #include <qgarlib/xercesimpl/XercesAttributesAdaptor.H> 00045 00046 using namespace std; 00047 00048 namespace qgxml { 00049 00050 00051 // --------------------------------------------------------------------- 00052 // C O N S T R U C T O R S 00053 // --------------------------------------------------------------------- 00054 00055 // Default constructor 00056 XercesAttributesAdaptor::XercesAttributesAdaptor(xercesc::Attributes * attributes) 00057 { 00058 _impl = attributes; 00059 } 00060 00061 00062 00063 // --------------------------------------------------------------------- 00064 // D E S T R U C T O R 00065 // --------------------------------------------------------------------- 00066 00067 XercesAttributesAdaptor::~XercesAttributesAdaptor() 00068 { /* NOP */ } 00069 00070 00071 00072 // --------------------------------------------------------------------- 00073 // A C C E S S 00074 // --------------------------------------------------------------------- 00075 00076 int 00077 XercesAttributesAdaptor::getIndex(const string& qName) const 00078 { 00079 return _impl->getIndex( _sc.convert(qName) ); 00080 } 00081 00082 // ---------------------------------------------------------------------- 00083 00084 int 00085 XercesAttributesAdaptor::getIndex(const string& uri, 00086 const string& localName) const 00087 { 00088 return _impl->getIndex(_sc.convert(uri), _sc.convert(localName)); 00089 } 00090 00091 // ---------------------------------------------------------------------- 00092 00093 int 00094 XercesAttributesAdaptor::getLength() const 00095 { 00096 return _impl->getLength(); 00097 } 00098 00099 // ---------------------------------------------------------------------- 00100 00101 string 00102 XercesAttributesAdaptor::getLocalName(int index) const 00103 { 00104 return _sc.convert(_impl->getLocalName(index)); 00105 } 00106 00107 // ---------------------------------------------------------------------- 00108 00109 string 00110 XercesAttributesAdaptor::getQName(int index) const 00111 { 00112 return _sc.convert(_impl->getQName(index)); 00113 } 00114 00115 // ---------------------------------------------------------------------- 00116 00117 string 00118 XercesAttributesAdaptor::getType(int index) const 00119 { 00120 return _sc.convert(_impl->getType(index)); 00121 } 00122 00123 // ---------------------------------------------------------------------- 00124 00125 string 00126 XercesAttributesAdaptor::getType(const string& qName) const 00127 { 00128 return _sc.convert(_impl->getType(_sc.convert(qName))); 00129 } 00130 00131 // ---------------------------------------------------------------------- 00132 00133 string 00134 XercesAttributesAdaptor::getType(const string& uri, 00135 const string& localName) const 00136 { 00137 return _sc.convert(_impl->getType( _sc.convert(uri), 00138 _sc.convert(localName))); 00139 } 00140 00141 // ---------------------------------------------------------------------- 00142 00143 string 00144 XercesAttributesAdaptor::getURI(int index) const 00145 { 00146 return _sc.convert(_impl->getURI(index)); 00147 } 00148 00149 // ---------------------------------------------------------------------- 00150 00151 string 00152 XercesAttributesAdaptor::getValue(int index) const 00153 { 00154 return _sc.convert(_impl->getValue(index)); 00155 } 00156 00157 // ---------------------------------------------------------------------- 00158 00159 string 00160 XercesAttributesAdaptor::getValue(const string& qName) const 00161 { 00162 return _sc.convert( _impl->getValue(_sc.convert(qName)) ); 00163 } 00164 00165 // ---------------------------------------------------------------------- 00166 00167 string 00168 XercesAttributesAdaptor::getValue(const string& uri, 00169 const string& localName) const 00170 { 00171 return _sc.convert( _impl->getValue(_sc.convert(uri), 00172 _sc.convert(localName)) ); 00173 } 00174 00175 // ---------------------------------------------------------------------- 00176 00177 } // namespace qgxml