00001 // Copyright (C) 2005-2010 Code Synthesis Tools CC 00002 // 00003 // This program was generated by CodeSynthesis XSD, an XML Schema to 00004 // C++ data binding compiler. 00005 // 00006 // This program is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License version 2 as 00008 // published by the Free Software Foundation. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 // 00019 // In addition, as a special exception, Code Synthesis Tools CC gives 00020 // permission to link this program with the Xerces-C++ library (or with 00021 // modified versions of Xerces-C++ that use the same license as Xerces-C++), 00022 // and distribute linked combinations including the two. You must obey 00023 // the GNU General Public License version 2 in all respects for all of 00024 // the code used other than Xerces-C++. If you modify this copy of the 00025 // program, you may extend this exception to your version of the program, 00026 // but you are not obligated to do so. If you do not wish to do so, delete 00027 // this exception statement from your version. 00028 // 00029 // Furthermore, Code Synthesis Tools CC makes a special exception for 00030 // the Free/Libre and Open Source Software (FLOSS) which is described 00031 // in the accompanying FLOSSE file. 00032 // 00033 00034 // Begin prologue. 00035 // 00036 // 00037 // End prologue. 00038 00039 #include "tag-pskel.hxx" 00040 00041 // tag_pskel 00042 // 00043 00044 void tag_pskel:: 00045 k_parser (::xml_schema::string_pskel& p) 00046 { 00047 this->k_parser_ = &p; 00048 } 00049 00050 void tag_pskel:: 00051 v_parser (::xml_schema::string_pskel& p) 00052 { 00053 this->v_parser_ = &p; 00054 } 00055 00056 void tag_pskel:: 00057 parsers (::xml_schema::string_pskel& k, 00058 ::xml_schema::string_pskel& v) 00059 { 00060 this->k_parser_ = &k; 00061 this->v_parser_ = &v; 00062 } 00063 00064 tag_pskel:: 00065 tag_pskel () 00066 : k_parser_ (0), 00067 v_parser_ (0), 00068 v_state_attr_stack_ (sizeof (v_state_attr_), &v_state_attr_first_) 00069 { 00070 } 00071 00072 // tag_pskel 00073 // 00074 00075 void tag_pskel:: 00076 k (const ::std::string&) 00077 { 00078 } 00079 00080 void tag_pskel:: 00081 v (const ::std::string&) 00082 { 00083 } 00084 00085 #include <cassert> 00086 00087 // Attribute validation and dispatch functions for tag_pskel. 00088 // 00089 bool tag_pskel:: 00090 _attribute_impl_phase_one (const ::xml_schema::ro_string& ns, 00091 const ::xml_schema::ro_string& n, 00092 const ::xml_schema::ro_string& s) 00093 { 00094 if (n == "k" && ns.empty ()) 00095 { 00096 if (this->k_parser_) 00097 { 00098 this->k_parser_->pre (); 00099 this->k_parser_->_pre_impl (); 00100 this->k_parser_->_characters (s); 00101 this->k_parser_->_post_impl (); 00102 const ::std::string& tmp (this->k_parser_->post_string ()); 00103 this->k (tmp); 00104 } 00105 00106 static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ())->k = true; 00107 return true; 00108 } 00109 00110 if (n == "v" && ns.empty ()) 00111 { 00112 if (this->v_parser_) 00113 { 00114 this->v_parser_->pre (); 00115 this->v_parser_->_pre_impl (); 00116 this->v_parser_->_characters (s); 00117 this->v_parser_->_post_impl (); 00118 const ::std::string& tmp (this->v_parser_->post_string ()); 00119 this->v (tmp); 00120 } 00121 00122 static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ())->v = true; 00123 return true; 00124 } 00125 00126 return false; 00127 } 00128 00129 void tag_pskel:: 00130 _pre_a_validate () 00131 { 00132 this->v_state_attr_stack_.push (); 00133 v_state_attr_& as = *static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ()); 00134 00135 as.k = false; 00136 as.v = false; 00137 } 00138 00139 void tag_pskel:: 00140 _post_a_validate () 00141 { 00142 v_state_attr_& as = *static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ()); 00143 00144 if (!as.k) 00145 this->_expected_attribute ( 00146 "", "k"); 00147 if (!as.v) 00148 this->_expected_attribute ( 00149 "", "v"); 00150 00151 this->v_state_attr_stack_.pop (); 00152 } 00153 00154 // Begin epilogue. 00155 // 00156 // 00157 // End epilogue. 00158