diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/form_8cpp-source.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/form_8cpp-source.html')
-rw-r--r-- | docs/doxygen/nel/form_8cpp-source.html | 427 |
1 files changed, 427 insertions, 0 deletions
diff --git a/docs/doxygen/nel/form_8cpp-source.html b/docs/doxygen/nel/form_8cpp-source.html new file mode 100644 index 00000000..683ef628 --- /dev/null +++ b/docs/doxygen/nel/form_8cpp-source.html @@ -0,0 +1,427 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>form.cpp</h1><a href="form_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00008 <font class="comment"> *</font> +00009 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00013 <font class="comment"> * any later version.</font> +00014 <font class="comment"></font> +00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00018 <font class="comment"> * General Public License for more details.</font> +00019 <font class="comment"></font> +00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00023 <font class="comment"> * MA 02111-1307, USA.</font> +00024 <font class="comment"> */</font> +00025 +00026 <font class="preprocessor">#include "<a class="code" href="stdgeorges_8h.html">stdgeorges.h</a>"</font> +00027 +00028 <font class="preprocessor">#include "<a class="code" href="i__xml_8h.html">nel/misc/i_xml.h</a>"</font> +00029 <font class="preprocessor">#include "<a class="code" href="common_8h.html">nel/misc/common.h</a>"</font> +00030 <font class="preprocessor">#include "<a class="code" href="path_8h.html">nel/misc/path.h</a>"</font> +00031 +00032 <font class="preprocessor">#include "<a class="code" href="form_8h.html">form.h</a>"</font> +00033 <font class="preprocessor">#include "<a class="code" href="form__loader_8h.html">form_loader.h</a>"</font> +00034 +00035 <font class="keyword">using</font> <font class="keyword">namespace </font>NLMISC; +00036 +00037 <font class="keyword">namespace </font>NLGEORGES +00038 { +00039 +00040 <font class="comment">// ***************************************************************************</font> +00041 <font class="comment">// Misc</font> +00042 <font class="comment">// ***************************************************************************</font> +00043 +00044 <font class="keywordtype">void</font> <a class="code" href="namespaceNLGEORGES.html#a0">warning</a> (<font class="keywordtype">bool</font> exception, <font class="keyword">const</font> <font class="keywordtype">char</font> *<a class="code" href="driver__opengl__extension__def_8h.html#a275">format</a>, ... ) +00045 { +00046 <font class="comment">// Make a buffer string</font> +00047 va_list args; +00048 va_start( args, <a class="code" href="driver__opengl__extension__def_8h.html#a275">format</a> ); +00049 <font class="keywordtype">char</font> <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>[1024]; +00050 <a class="code" href="types__nl_8h.html#a13">sint</a> ret = vsnprintf( <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>, 1024, <a class="code" href="driver__opengl__extension__def_8h.html#a275">format</a>, args ); +00051 va_end( args ); +00052 +00053 <font class="comment">// Set the warning</font> +00054 <font class="keywordflow">if</font> (exception) +00055 { +00056 <font class="comment">// Make an error message</font> +00057 <font class="keywordtype">char</font> tmp[1024]; +00058 <a class="code" href="namespaceNLMISC.html#a203">smprintf</a> (tmp, 1024, <font class="stringliteral">"NeL::Georges %s"</font>, <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>); +00059 <font class="keywordflow">throw</font> EXmlParsingError (tmp); +00060 } +00061 <font class="keywordflow">else</font> +00062 <a class="code" href="debug_8h.html#a2">nlwarning</a> (<font class="stringliteral">"NeL::Georges %s"</font>, <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>); +00063 } +00064 +00065 <font class="comment">// ***************************************************************************</font> +00066 <font class="comment">// UForm</font> +00067 <font class="comment">// ***************************************************************************</font> +00068 +<a name="l00069"></a><a class="code" href="classNLGEORGES_1_1UForm.html#a0">00069</a> UForm::~UForm () +00070 { +00071 } +00072 +00073 <font class="comment">// ***************************************************************************</font> +00074 +<a name="l00075"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a0">00075</a> UFormElm& CForm::getRootNode () +00076 { +00077 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#m1">Elements</a>; +00078 } +00079 +00080 <font class="comment">// ***************************************************************************</font> +00081 +<a name="l00082"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a1">00082</a> <font class="keyword">const</font> UFormElm& CForm::getRootNode ()<font class="keyword"> const</font> +00083 <font class="keyword"></font>{ +00084 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#m1">Elements</a>; +00085 } +00086 +00087 <font class="comment">// ***************************************************************************</font> +00088 <font class="comment">// CForm</font> +00089 <font class="comment">// ***************************************************************************</font> +00090 +<a name="l00091"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a3">00091</a> CForm::CForm () : Elements (this, NULL, NULL, 0xffffffff) +00092 { +00093 <a class="code" href="types__nl_8h.html#a14">uint</a> i; +00094 <font class="keywordflow">for</font> (i=0; i<<a class="code" href="classNLGEORGES_1_1CForm.html#s1s0">HeldElementCount</a>; i++) +00095 { +00096 <a class="code" href="classNLGEORGES_1_1CForm.html#m2">HeldElements</a>[i] = <font class="keyword">new</font> CFormElmStruct (<font class="keyword">this</font>, NULL, NULL, 0xffffffff); +00097 } +00098 } +00099 +00100 <font class="comment">// ***************************************************************************</font> +00101 +<a name="l00102"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a4">00102</a> CForm::~CForm () +00103 { +00104 <a class="code" href="types__nl_8h.html#a14">uint</a> i; +00105 <font class="keywordflow">for</font> (i=0; i<<a class="code" href="classNLGEORGES_1_1CForm.html#s1s0">HeldElementCount</a>; i++) +00106 { +00107 <font class="keyword">delete</font> <a class="code" href="classNLGEORGES_1_1CForm.html#m2">HeldElements</a>[i]; +00108 } +00109 } +00110 +00111 <font class="comment">// ***************************************************************************</font> +00112 +<a name="l00113"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a6">00113</a> <font class="keywordtype">void</font> CForm::write (xmlDocPtr doc, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename, <font class="keywordtype">bool</font> georges4CVS) +00114 { +00115 <font class="comment">// Save the filename</font> +00116 <a class="code" href="classNLGEORGES_1_1CForm.html#o1">_Filename</a> = CFile::getFilename (filename); +00117 +00118 <font class="comment">// Create the first node</font> +00119 xmlNodePtr node = xmlNewDocNode (doc, NULL, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"FORM"</font>, NULL); +00120 xmlDocSetRootElement (doc, node); +00121 +00122 <font class="comment">// List of parent</font> +00123 <font class="keywordflow">for</font> (<a class="code" href="types__nl_8h.html#a14">uint</a> parent=0; parent<<a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.size (); parent++) +00124 { +00125 <font class="comment">// Parent name not empty ?</font> +00126 <font class="keywordflow">if</font> (!(<a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>[parent].ParentFilename.empty())) +00127 { +00128 <font class="comment">// Add a parent node</font> +00129 xmlNodePtr parentNode = xmlNewChild ( node, NULL, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"PARENT"</font>, NULL ); +00130 xmlSetProp (parentNode, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"Filename"</font>, (<font class="keyword">const</font> xmlChar*)<a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>[parent].ParentFilename.c_str()); +00131 } +00132 } +00133 +00134 <font class="comment">// Write elements</font> +00135 <a class="code" href="classNLGEORGES_1_1CForm.html#m1">Elements</a>.write (node, <font class="keyword">this</font>, NULL, <font class="keyword">true</font>); +00136 +00137 <font class="comment">// Write held elements</font> +00138 <a class="code" href="types__nl_8h.html#a14">uint</a> i; +00139 <font class="keywordflow">for</font> (i=0; i<<a class="code" href="classNLGEORGES_1_1CForm.html#s1s0">HeldElementCount</a>; i++) +00140 { +00141 <a class="code" href="classNLGEORGES_1_1CForm.html#m2">HeldElements</a>[i]->write (node, <font class="keyword">this</font>, NULL, <font class="keyword">true</font>); +00142 } +00143 +00144 <font class="comment">// Header</font> +00145 <a class="code" href="classNLGEORGES_1_1CForm.html#m0">Header</a>.write (node, georges4CVS); +00146 } +00147 +00148 <font class="comment">// ***************************************************************************</font> +00149 +<a name="l00150"></a><a class="code" href="classNLGEORGES_1_1CForm.html#c1">00150</a> <font class="keywordtype">void</font> CForm::readParent (<font class="keyword">const</font> <font class="keywordtype">char</font> *parent, CFormLoader &loader) +00151 { +00152 <font class="comment">// Load the parent</font> +00153 <a class="code" href="classNLGEORGES_1_1CForm.html#a3">CForm</a> *theParent = (<a class="code" href="classNLGEORGES_1_1CForm.html#a3">CForm</a>*)loader.loadForm (parent); +00154 <font class="keywordflow">if</font> (theParent != NULL) +00155 { +00156 <font class="comment">// Set the parent</font> +00157 <font class="keywordflow">if</font> (!<a class="code" href="classNLGEORGES_1_1CForm.html#a7">insertParent</a> (<a class="code" href="classNLGEORGES_1_1CForm.html#a11">getParentCount</a> (), parent, theParent)) +00158 { +00159 <font class="comment">// Make an error message</font> +00160 std::string parentName = parent; +00161 +00162 <font class="comment">// Delete the value</font> +00163 xmlFree ((<font class="keywordtype">void</font>*)parent); +00164 +00165 <font class="comment">// Throw exception</font> +00166 <a class="code" href="classNLGEORGES_1_1CForm.html#a14">warning</a> (<font class="keyword">true</font>, <font class="stringliteral">"readParent"</font>, <font class="stringliteral">"Can't set the parent FORM named (%s). Check if it is the same form or if it use a differnt formDfn."</font>, parentName.c_str ()); +00167 } +00168 } +00169 <font class="keywordflow">else</font> +00170 { +00171 <font class="comment">// Make an error message</font> +00172 std::string parentName = parent; +00173 +00174 <font class="comment">// Delete the value</font> +00175 xmlFree ((<font class="keywordtype">void</font>*)parent); +00176 +00177 <font class="comment">// Throw exception</font> +00178 <a class="code" href="classNLGEORGES_1_1CForm.html#a14">warning</a> (<font class="keyword">true</font>, <font class="stringliteral">"readParent"</font>, <font class="stringliteral">"Can't load the parent FORM named (%s)."</font>, parentName.c_str ()); +00179 } +00180 } +00181 +00182 <font class="comment">// ***************************************************************************</font> +00183 +<a name="l00184"></a><a class="code" href="classNLGEORGES_1_1CForm.html#c0">00184</a> <font class="keywordtype">void</font> CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename) +00185 { +00186 <font class="comment">// Save the filename</font> +00187 <a class="code" href="classNLGEORGES_1_1CForm.html#o1">_Filename</a> = CFile::getFilename (filename); +00188 +00189 <font class="comment">// Reset form</font> +00190 <a class="code" href="classNLGEORGES_1_1CForm.html#a5">clean</a> (); +00191 +00192 <font class="comment">// Check node name</font> +00193 <font class="keywordflow">if</font> ( ((<font class="keyword">const</font> <font class="keywordtype">char</font>*)node->name == NULL) || (strcmp ((<font class="keyword">const</font> <font class="keywordtype">char</font>*)node->name, <font class="stringliteral">"FORM"</font>) != 0) ) +00194 { +00195 <font class="comment">// Make an error message</font> +00196 <a class="code" href="classNLGEORGES_1_1CForm.html#a14">warning</a> (<font class="keyword">true</font>, <font class="stringliteral">"read"</font>, <font class="stringliteral">"XML Syntax error in block line %d, node (%s) should be FORM."</font>, +00197 (<font class="keywordtype">int</font>)node->content, node->name); +00198 } +00199 +00200 <font class="comment">// Get first struct node</font> +00201 xmlNodePtr child = CIXml::getFirstChildNode (node, <font class="stringliteral">"STRUCT"</font>); +00202 <font class="keywordflow">if</font> (child == NULL) +00203 { +00204 <font class="comment">// Throw exception</font> +00205 <a class="code" href="classNLGEORGES_1_1CForm.html#a14">warning</a> (<font class="keyword">true</font>, <font class="stringliteral">"read"</font>, <font class="stringliteral">"Syntax error in block line %d, node (%s) should have a STRUCT child node."</font>, +00206 (<font class="keywordtype">int</font>)node->content, node->name); +00207 } +00208 +00209 <font class="comment">// Read the struct</font> +00210 <a class="code" href="classNLGEORGES_1_1CForm.html#m1">Elements</a>.read (child, loader, dfn, <font class="keyword">this</font>); +00211 +00212 <font class="comment">// Get next struct node</font> +00213 child = CIXml::getNextChildNode (node, <font class="stringliteral">"STRUCT"</font>); +00214 <a class="code" href="types__nl_8h.html#a14">uint</a> <a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a> = 0; +00215 <font class="keywordflow">while</font> ( (child != NULL) && (<a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a> < <a class="code" href="classNLGEORGES_1_1CForm.html#s1s0">HeldElementCount</a>)) +00216 { +00217 <a class="code" href="classNLGEORGES_1_1CForm.html#m2">HeldElements</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a>]->read (child, loader, dfn, <font class="keyword">this</font>); +00218 <a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a>++; +00219 } +00220 <font class="keywordflow">while</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a> < <a class="code" href="classNLGEORGES_1_1CForm.html#s1s0">HeldElementCount</a>) +00221 { +00222 <font class="comment">// Build the Form</font> +00223 <a class="code" href="classNLGEORGES_1_1CForm.html#m2">HeldElements</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a>]->build (dfn); +00224 <a class="code" href="driver__opengl__extension__def_8h.html#a236">index</a>++; +00225 } +00226 +00227 <font class="comment">// Get the old parent parameter</font> +00228 <font class="keyword">const</font> <font class="keywordtype">char</font> *parent = (<font class="keyword">const</font> <font class="keywordtype">char</font>*)xmlGetProp (node, (xmlChar*)<font class="stringliteral">"Parent"</font>); +00229 <font class="keywordflow">if</font> (parent) +00230 { +00231 <font class="comment">// Add a parent, xmlFree is done by readParent</font> +00232 <a class="code" href="classNLGEORGES_1_1CForm.html#c1">readParent</a> (parent, loader); +00233 } +00234 +00235 <font class="comment">// Read the new parent nodes</font> +00236 <a class="code" href="types__nl_8h.html#a14">uint</a> parentCount = CIXml::countChildren (node, <font class="stringliteral">"PARENT"</font>); +00237 +00238 <font class="comment">// Reserve some parents</font> +00239 <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.reserve (<a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.size () + parentCount); +00240 +00241 <font class="comment">// Enum children node</font> +00242 child = CIXml::getFirstChildNode (node, <font class="stringliteral">"PARENT"</font>); +00243 <font class="keywordflow">while</font> (child) +00244 { +00245 parent = (<font class="keyword">const</font> <font class="keywordtype">char</font>*)xmlGetProp (child, (xmlChar*)<font class="stringliteral">"Filename"</font>); +00246 +00247 <font class="comment">// Add a parent, xmlFree is done by readParent</font> +00248 <a class="code" href="classNLGEORGES_1_1CForm.html#c1">readParent</a> (parent, loader); +00249 +00250 <font class="comment">// Next node <PARENT></font> +00251 child = CIXml::getNextChildNode (child, <font class="stringliteral">"PARENT"</font>); +00252 } +00253 +00254 <font class="comment">// Read the header</font> +00255 <a class="code" href="classNLGEORGES_1_1CForm.html#m0">Header</a>.read (node); +00256 } +00257 +00258 <font class="comment">// ***************************************************************************</font> +00259 +<a name="l00260"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a2">00260</a> <font class="keyword">const</font> std::string &CForm::getComment ()<font class="keyword"> const</font> +00261 <font class="keyword"></font>{ +00262 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#m0">Header</a>.Comments; +00263 } +00264 +00265 <font class="comment">// ***************************************************************************</font> +00266 +<a name="l00267"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a7">00267</a> <font class="keywordtype">bool</font> CForm::insertParent (<a class="code" href="types__nl_8h.html#a14">uint</a> before, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename, CForm *parent) +00268 { +00269 <font class="comment">// Set or reset ?</font> +00270 <a class="code" href="debug_8h.html#a6">nlassert</a> (parent) +00271 +00272 <font class="comment">// Must have the same DFN</font> +00273 <font class="keywordflow">if</font> (parent->Elements.FormDfn == <a class="code" href="classNLGEORGES_1_1CForm.html#m1">Elements</a>.FormDfn) +00274 { +00275 <font class="comment">// Set members</font> +00276 std::vector<CParent>::iterator ite = <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.insert (<a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.begin() + before); +00277 ite->Parent = parent; +00278 ite->ParentFilename = filename; +00279 +00280 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00281 } +00282 <font class="keywordflow">else</font> +00283 { +00284 <font class="comment">// Output an error</font> +00285 <a class="code" href="classNLGEORGES_1_1CForm.html#a14">warning</a> (<font class="keyword">false</font>, <font class="stringliteral">"insertParent"</font>, <font class="stringliteral">"Can't insert parent form (%s) that has not the same DFN."</font>, filename); +00286 } +00287 +00288 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00289 } +00290 +00291 <font class="comment">// ***************************************************************************</font> +00292 +<a name="l00293"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a8">00293</a> <font class="keywordtype">void</font> CForm::removeParent (<a class="code" href="types__nl_8h.html#a14">uint</a> parent) +00294 { +00295 <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.erase (<a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.begin() + parent); +00296 } +00297 +00298 <font class="comment">// ***************************************************************************</font> +00299 +<a name="l00300"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a9">00300</a> CForm *CForm::getParent (<a class="code" href="types__nl_8h.html#a14">uint</a> parent)<font class="keyword"> const</font> +00301 <font class="keyword"></font>{ +00302 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>[parent].Parent; +00303 } +00304 +00305 <font class="comment">// ***************************************************************************</font> +00306 +<a name="l00307"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a10">00307</a> <font class="keyword">const</font> std::string &CForm::getParentFilename (<a class="code" href="types__nl_8h.html#a14">uint</a> parent)<font class="keyword"> const</font> +00308 <font class="keyword"></font>{ +00309 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>[parent].ParentFilename; +00310 } +00311 +00312 <font class="comment">// ***************************************************************************</font> +00313 +<a name="l00314"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a11">00314</a> <a class="code" href="types__nl_8h.html#a14">uint</a> CForm::getParentCount ()<font class="keyword"> const</font> +00315 <font class="keyword"></font>{ +00316 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.size (); +00317 } +00318 +00319 <font class="comment">// ***************************************************************************</font> +00320 +<a name="l00321"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a5">00321</a> <font class="keywordtype">void</font> CForm::clean () +00322 { +00323 <a class="code" href="classNLGEORGES_1_1CForm.html#a12">clearParents</a> (); +00324 } +00325 +00326 <font class="comment">// ***************************************************************************</font> +00327 +<a name="l00328"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a12">00328</a> <font class="keywordtype">void</font> CForm::clearParents () +00329 { +00330 <a class="code" href="classNLGEORGES_1_1CForm.html#o0">ParentList</a>.clear (); +00331 } +00332 +00333 <font class="comment">// ***************************************************************************</font> +00334 +<a name="l00335"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a13">00335</a> <font class="keyword">const</font> std::string &CForm::getFilename ()<font class="keyword"> const</font> +00336 <font class="keyword"></font>{ +00337 <font class="keywordflow">return</font> <a class="code" href="classNLGEORGES_1_1CForm.html#o1">_Filename</a>; +00338 } +00339 +00340 <font class="comment">// ***************************************************************************</font> +00341 +<a name="l00342"></a><a class="code" href="classNLGEORGES_1_1CForm.html#a14">00342</a> <font class="keywordtype">void</font> CForm::warning (<font class="keywordtype">bool</font> exception, <font class="keyword">const</font> <font class="keywordtype">char</font> *function, <font class="keyword">const</font> <font class="keywordtype">char</font> *<a class="code" href="driver__opengl__extension__def_8h.html#a275">format</a>, ... )<font class="keyword"> const</font> +00343 <font class="keyword"></font>{ +00344 <font class="comment">// Make a buffer string</font> +00345 va_list args; +00346 va_start( args, <a class="code" href="driver__opengl__extension__def_8h.html#a275">format</a> ); +00347 <font class="keywordtype">char</font> <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>[1024]; +00348 <a class="code" href="types__nl_8h.html#a13">sint</a> ret = vsnprintf( <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>, 1024, <a class="code" href="driver__opengl__extension__def_8h.html#a275">format</a>, args ); +00349 va_end( args ); +00350 +00351 <font class="comment">// Set the warning</font> +00352 <a class="code" href="namespaceNLGEORGES.html#a0">NLGEORGES::warning</a> (exception, <font class="stringliteral">"(CForm::%s) in form (%s) : %s"</font>, function, <a class="code" href="classNLGEORGES_1_1CForm.html#o1">_Filename</a>.c_str (), <a class="code" href="driver__opengl__extension__def_8h.html#a259">buffer</a>); +00353 } +00354 +00355 <font class="comment">// ***************************************************************************</font> +00356 +00357 } <font class="comment">// NLGEORGES</font> +00358 +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |