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 QtAttributesAdaptor.C 00030 * @brief Implementation of class qgxml::QtAttributesAdaptor 00031 * 00032 * See file QtAttributesAdaptor.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 11, 2003 09:52 00036 * @since Qgar 2.1.1 00037 */ 00038 00039 00040 // For RCS/CVS use: Do not delete 00041 /* $Id: QtAttributesAdaptor.C,v 1.3 2004/06/21 16:03:37 rendek Exp $ */ 00042 00043 00044 #include <qgarlib/qtimpl/QtAttributesAdaptor.H> 00045 00046 00047 using namespace std; 00048 00049 namespace qgxml { 00050 00051 00052 // --------------------------------------------------------------------- 00053 // C O N S T R U C T O R S 00054 // --------------------------------------------------------------------- 00055 00056 // Default constructor 00057 QtAttributesAdaptor::QtAttributesAdaptor(QXmlAttributes * attributes) 00058 { 00059 _impl = attributes; 00060 } 00061 00062 00063 00064 // --------------------------------------------------------------------- 00065 // D E S T R U C T O R 00066 // --------------------------------------------------------------------- 00067 00068 QtAttributesAdaptor::~QtAttributesAdaptor() 00069 { /* EMPTY */ } 00070 00071 00072 00073 // --------------------------------------------------------------------- 00074 // A C C E S S 00075 // --------------------------------------------------------------------- 00076 00077 int 00078 QtAttributesAdaptor::getIndex(const string& qName) const 00079 { 00080 return _impl->index( _sc.convert(qName) ); 00081 } 00082 00083 // ---------------------------------------------------------------------- 00084 00085 int 00086 QtAttributesAdaptor::getIndex(const string& uri, 00087 const string& localName) const 00088 { 00089 return _impl->index( _sc.convert(uri), _sc.convert(localName) ); 00090 } 00091 00092 // ---------------------------------------------------------------------- 00093 00094 int 00095 QtAttributesAdaptor::getLength() const 00096 { 00097 return _impl->length(); 00098 } 00099 00100 // ---------------------------------------------------------------------- 00101 00102 string 00103 QtAttributesAdaptor::getLocalName(int index) const 00104 { 00105 return _sc.convert(_impl->localName(index)); 00106 } 00107 00108 // ---------------------------------------------------------------------- 00109 00110 string 00111 QtAttributesAdaptor::getQName(int index) const 00112 { 00113 return _sc.convert(_impl->qName(index)); 00114 } 00115 00116 // ---------------------------------------------------------------------- 00117 00118 string 00119 QtAttributesAdaptor::getType(int index) const 00120 { 00121 return _sc.convert(_impl->type(index)); 00122 } 00123 00124 // ---------------------------------------------------------------------- 00125 00126 string 00127 QtAttributesAdaptor::getType(const string& qName) const 00128 { 00129 return _sc.convert(_impl->type(_sc.convert(qName))); 00130 } 00131 00132 // ---------------------------------------------------------------------- 00133 00134 string 00135 QtAttributesAdaptor::getType(const string& uri, 00136 const string& localName) const 00137 { 00138 return _sc.convert(_impl->type( _sc.convert(uri), 00139 _sc.convert(localName))); 00140 } 00141 00142 // ---------------------------------------------------------------------- 00143 00144 string 00145 QtAttributesAdaptor::getURI(int index) const 00146 { 00147 return _sc.convert(_impl->uri(index)); 00148 } 00149 00150 // ---------------------------------------------------------------------- 00151 00152 string 00153 QtAttributesAdaptor::getValue(int index) const 00154 { 00155 return _sc.convert(_impl->value(index)); 00156 } 00157 00158 // ---------------------------------------------------------------------- 00159 00160 string 00161 QtAttributesAdaptor::getValue(const string& qName) const 00162 { 00163 return _sc.convert( _impl->value(_sc.convert(qName)) ); 00164 } 00165 00166 // ---------------------------------------------------------------------- 00167 00168 string 00169 QtAttributesAdaptor::getValue(const string& uri, 00170 const string& localName) const 00171 { 00172 return _sc.convert( _impl->value(_sc.convert(uri), 00173 _sc.convert(localName)) ); 00174 } 00175 00176 // ---------------------------------------------------------------------- 00177 00178 } // namespace qgxml