<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crystal Space 1.2.1: csutil/documentcommon.h Source File (Crystal Space 1.2.1 Public API Reference)</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="head"> <tr height="59"> <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td> <td class="head"><h2>Public API Reference</h2></td> </tr> <tr height="11"> <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td> </tr> </table> <div class="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>csutil/documentcommon.h</h1><a href="documentcommon_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> Copyright (C) 2005 by Jorrit Tyberghein</span> <a name="l00003"></a>00003 <span class="comment"> (C) 2005 by Frank Richter</span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00008"></a>00008 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00013"></a>00013 <span class="comment"> Library General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"></span> <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00016"></a>00016 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00017"></a>00017 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00018"></a>00018 <span class="comment">*/</span> <a name="l00019"></a>00019 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef __CS_CSUTIL_DOCUMENTCOMMON_H__</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __CS_CSUTIL_DOCUMENTCOMMON_H__</span> <a name="l00026"></a>00026 <span class="preprocessor"></span> <a name="l00027"></a>00027 <span class="preprocessor">#include "csextern.h"</span> <a name="l00028"></a>00028 <span class="preprocessor">#include "csutil/leakguard.h"</span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="scf__implementation_8h.html" title="Crystal Space Shared Class Facility (SCF) - implementation creation support.">csutil/scf_implementation.h</a>"</span> <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="document_8h.html" title="Document Interface.">iutil/document.h</a>"</span> <a name="l00031"></a>00031 <a name="l00035"></a><a class="code" href="classcsEmptyDocumentNodeIterator.html">00035</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsEmptyDocumentNodeIterator.html" title="Document node iterator does not return any nodes.">csEmptyDocumentNodeIterator</a> : <a name="l00036"></a>00036 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csEmptyDocumentNodeIterator, iDocumentNodeIterator> <a name="l00037"></a>00037 { <a name="l00038"></a>00038 <span class="keyword">public</span>: <a name="l00039"></a>00039 CS_LEAKGUARD_DECLARE(<a class="code" href="classcsEmptyDocumentNodeIterator.html" title="Document node iterator does not return any nodes.">csEmptyDocumentNodeIterator</a>); <a name="l00040"></a>00040 <a name="l00041"></a>00041 <a class="code" href="classcsEmptyDocumentNodeIterator.html" title="Document node iterator does not return any nodes.">csEmptyDocumentNodeIterator</a> (); <a name="l00042"></a>00042 <span class="keyword">virtual</span> ~<a class="code" href="classcsEmptyDocumentNodeIterator.html" title="Document node iterator does not return any nodes.">csEmptyDocumentNodeIterator</a> (); <a name="l00043"></a>00043 <a name="l00044"></a><a class="code" href="classcsEmptyDocumentNodeIterator.html#05d55d09f93057fa0b2518d49d99cd9f">00044</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> HasNext () { <span class="keywordflow">return</span> <span class="keyword">false</span>; } <a name="l00045"></a><a class="code" href="classcsEmptyDocumentNodeIterator.html#d4261d397183de9dfaff76d997ae68b2">00045</a> <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNode></a> Next () { <span class="keywordflow">return</span> 0; } <a name="l00046"></a><a class="code" href="classcsEmptyDocumentNodeIterator.html#e6edd032029f5d95ba089d330ddaeaf7">00046</a> <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> GetNextPosition () { <span class="keywordflow">return</span> 1; } <a name="l00047"></a><a class="code" href="classcsEmptyDocumentNodeIterator.html#5a697e48413308a09a4131603f1159cd">00047</a> <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> GetEndPosition () { <span class="keywordflow">return</span> 1; } <a name="l00048"></a>00048 }; <a name="l00049"></a>00049 <a name="l00053"></a><a class="code" href="classcsEmptyDocumentAttributeIterator.html">00053</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsEmptyDocumentAttributeIterator.html" title="Document attribute iterator does not return any attributes.">csEmptyDocumentAttributeIterator</a> : <a name="l00054"></a>00054 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csEmptyDocumentAttributeIterator, iDocumentAttributeIterator> <a name="l00055"></a>00055 { <a name="l00056"></a>00056 <span class="keyword">public</span>: <a name="l00057"></a>00057 CS_LEAKGUARD_DECLARE(<a class="code" href="classcsEmptyDocumentAttributeIterator.html" title="Document attribute iterator does not return any attributes.">csEmptyDocumentAttributeIterator</a>); <a name="l00058"></a>00058 <a name="l00059"></a>00059 <a class="code" href="classcsEmptyDocumentAttributeIterator.html" title="Document attribute iterator does not return any attributes.">csEmptyDocumentAttributeIterator</a> (); <a name="l00060"></a>00060 <span class="keyword">virtual</span> ~<a class="code" href="classcsEmptyDocumentAttributeIterator.html" title="Document attribute iterator does not return any attributes.">csEmptyDocumentAttributeIterator</a> (); <a name="l00061"></a>00061 <a name="l00062"></a><a class="code" href="classcsEmptyDocumentAttributeIterator.html#c88a6609d24a0e8c4d7cdf29cc2fde61">00062</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> HasNext () { <span class="keywordflow">return</span> <span class="keyword">false</span>; } <a name="l00063"></a><a class="code" href="classcsEmptyDocumentAttributeIterator.html#e68cabd0081f9952b904fb246e1b4396">00063</a> <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentAttribute></a> Next () { <span class="keywordflow">return</span> 0; } <a name="l00064"></a>00064 }; <a name="l00065"></a>00065 <a name="l00069"></a><a class="code" href="classcsDocumentNodeCommon.html">00069</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsDocumentNodeCommon.html" title="Partial iDocumentNode implementation with commonly duplicated logic.">csDocumentNodeCommon</a> : <a name="l00070"></a>00070 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csDocumentNodeCommon, iDocumentNode> <a name="l00071"></a>00071 { <a name="l00072"></a>00072 <span class="keyword">public</span>: <a name="l00073"></a><a class="code" href="classcsDocumentNodeCommon.html#701a18ccbb810caaa28733c471bbac97">00073</a> <a class="code" href="classcsDocumentNodeCommon.html" title="Partial iDocumentNode implementation with commonly duplicated logic.">csDocumentNodeCommon</a> () : <a class="code" href="classscfImplementation1.html">scfImplementationType</a> (this) {} <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValueAsInt (<span class="keywordtype">int</span> value); <a name="l00077"></a>00077 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValueAsFloat (<span class="keywordtype">float</span> value); <a name="l00079"></a>00079 <a name="l00081"></a><a class="code" href="classcsDocumentNodeCommon.html#702d178bee5637118ebdf9c0d3ba8ebe">00081</a> <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNodeIterator></a> GetNodes () <a name="l00082"></a>00082 { <span class="keywordflow">return</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iDocumentNodeIterator></a> (<span class="keyword">new</span> <a class="code" href="classcsEmptyDocumentNodeIterator.html" title="Document node iterator does not return any nodes.">csEmptyDocumentNodeIterator</a>); } <a name="l00087"></a>00087 <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNodeIterator></a> GetNodes (<span class="keyword">const</span> <span class="keywordtype">char</span>* value); <a name="l00089"></a><a class="code" href="classcsDocumentNodeCommon.html#ebf27711b5b74711370c7a2ad960c024">00089</a> <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNode></a> GetNode (<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*value*/</span>) <a name="l00090"></a>00090 { <span class="keywordflow">return</span> 0; } <a name="l00091"></a>00091 <a name="l00093"></a>00093 <a name="l00097"></a>00097 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetContentsValue (); <a name="l00098"></a>00098 <span class="keyword">virtual</span> <span class="keywordtype">int</span> GetContentsValueAsInt (); <a name="l00099"></a>00099 <span class="keyword">virtual</span> <span class="keywordtype">float</span> GetContentsValueAsFloat (); <a name="l00101"></a>00101 <a name="l00103"></a><a class="code" href="classcsDocumentNodeCommon.html#981013a726644b543d76549271f7f6e8">00103</a> <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentAttributeIterator></a> GetAttributes () <a name="l00104"></a>00104 { <a name="l00105"></a>00105 <span class="keywordflow">return</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iDocumentAttributeIterator></a> <a name="l00106"></a>00106 (<span class="keyword">new</span> <a class="code" href="classcsEmptyDocumentAttributeIterator.html" title="Document attribute iterator does not return any attributes.">csEmptyDocumentAttributeIterator</a>); <a name="l00107"></a>00107 } <a name="l00108"></a>00108 <a name="l00110"></a><a class="code" href="classcsDocumentNodeCommon.html#a44a9548d4ce31d574e73697d701a6dc">00110</a> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentAttribute></a> GetAttribute (<span class="keyword">const</span> <span class="keywordtype">char</span>*) { <span class="keywordflow">return</span> 0; } <a name="l00112"></a>00112 <a name="l00113"></a>00113 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetAttributeValue (<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00114"></a>00114 <span class="keyword">virtual</span> <span class="keywordtype">int</span> GetAttributeValueAsInt (<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00115"></a>00115 <span class="keyword">virtual</span> <span class="keywordtype">float</span> GetAttributeValueAsFloat (<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00116"></a>00116 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> GetAttributeValueAsBool (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a name="l00117"></a>00117 <span class="keywordtype">bool</span> defaultvalue = <span class="keyword">false</span>); <a name="l00119"></a>00119 <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetAttributeAsInt (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span> value); <a name="l00123"></a>00123 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetAttributeAsFloat (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">float</span> value); <a name="l00125"></a>00125 }; <a name="l00126"></a>00126 <a name="l00130"></a><a class="code" href="classcsDocumentAttributeCommon.html">00130</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsDocumentAttributeCommon.html" title="Partial iDocumentAttribute implementation with commonly duplicated logic.">csDocumentAttributeCommon</a> : <a name="l00131"></a>00131 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csDocumentAttributeCommon, iDocumentAttribute> <a name="l00132"></a>00132 { <a name="l00133"></a>00133 <span class="keyword">public</span>: <a name="l00134"></a><a class="code" href="classcsDocumentAttributeCommon.html#9976795af0d5e5cb1479a830ccb03cbd">00134</a> <a class="code" href="classcsDocumentAttributeCommon.html" title="Partial iDocumentAttribute implementation with commonly duplicated logic.">csDocumentAttributeCommon</a> () : <a class="code" href="classscfImplementation1.html">scfImplementationType</a> (this) <a name="l00135"></a>00135 {} <a name="l00137"></a>00137 <a name="l00140"></a>00140 <span class="keyword">virtual</span> <span class="keywordtype">int</span> GetValueAsInt (); <a name="l00141"></a>00141 <span class="keyword">virtual</span> <span class="keywordtype">float</span> GetValueAsFloat (); <a name="l00142"></a>00142 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> GetValueAsBool (); <a name="l00144"></a>00144 <a name="l00146"></a>00146 <a name="l00147"></a>00147 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValueAsInt (<span class="keywordtype">int</span> v); <a name="l00148"></a>00148 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValueAsFloat (<span class="keywordtype">float</span> f); <a name="l00150"></a>00150 }; <a name="l00151"></a>00151 <a name="l00156"></a><a class="code" href="classcsDocumentNodeReadOnly.html">00156</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsDocumentNodeReadOnly.html" title="Partial iDocumentNode implementation with commonly duplicated logic and dummy implementations...">csDocumentNodeReadOnly</a> : <a name="l00157"></a>00157 <span class="keyword">public</span> <a class="code" href="classscfImplementationExt0.html">scfImplementationExt0</a><csDocumentNodeReadOnly, csDocumentNodeCommon> <a name="l00158"></a>00158 { <a name="l00159"></a>00159 <span class="keyword">public</span>: <a name="l00160"></a><a class="code" href="classcsDocumentNodeReadOnly.html#7ad3539d92132d04a84dc2e623ae114c">00160</a> <a class="code" href="classcsDocumentNodeReadOnly.html" title="Partial iDocumentNode implementation with commonly duplicated logic and dummy implementations...">csDocumentNodeReadOnly</a> () <a name="l00161"></a>00161 : <a class="code" href="classscfImplementation1.html">scfImplementationType</a> (this) <a name="l00162"></a>00162 {} <a name="l00164"></a>00164 <a name="l00165"></a><a class="code" href="classcsDocumentNodeReadOnly.html#ed6918c8a4aa4f6162071d897631e80e">00165</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValue (<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*value*/</span>) {} <a name="l00166"></a><a class="code" href="classcsDocumentNodeReadOnly.html#f4c9378cbe1eac665e4cd64828b7e70e">00166</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValueAsInt (<span class="keywordtype">int</span> <span class="comment">/*value*/</span>) {} <a name="l00167"></a><a class="code" href="classcsDocumentNodeReadOnly.html#140d135396c5306954dbb1176e87ac70">00167</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetValueAsFloat (<span class="keywordtype">float</span> <span class="comment">/*value*/</span>) {} <a name="l00168"></a>00168 <a name="l00169"></a><a class="code" href="classcsDocumentNodeReadOnly.html#210871659cee6be5ef160b71d0777d9a">00169</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveNode (<span class="keyword">const</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNode></a>& <span class="comment">/*child*/</span>) {} <a name="l00170"></a><a class="code" href="classcsDocumentNodeReadOnly.html#6367f9a869a4454dd43d7ad7f273feb6">00170</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveNodes (<a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNodeIterator></a> <span class="comment">/*children*/</span>) {} <a name="l00171"></a><a class="code" href="classcsDocumentNodeReadOnly.html#bd79b2fb3786ef9908b6fb1cc2650540">00171</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveNodes () {} <a name="l00172"></a>00172 <a name="l00173"></a><a class="code" href="classcsDocumentNodeReadOnly.html#5c24346c0a66f1bd6564601209dc6a3e">00173</a> <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentNode></a> CreateNodeBefore (<a class="code" href="group__util.html#gb42cea72c57ecad9c3d599a08bce4475" title="Possible node types for iDocumentNode.">csDocumentNodeType</a> <span class="comment">/*type*/</span>, <a name="l00174"></a>00174 <a class="code" href="structiDocumentNode.html" title="Representation of a node in a document.">iDocumentNode</a>* <span class="comment">/*before*/</span>) <a name="l00175"></a>00175 { <span class="keywordflow">return</span> 0; } <a name="l00176"></a>00176 <a name="l00177"></a><a class="code" href="classcsDocumentNodeReadOnly.html#3a2b2ff902b19c8ac056286afd92b5ec">00177</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveAttribute (<span class="keyword">const</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iDocumentAttribute></a>& <span class="comment">/*attr*/</span>) {} <a name="l00178"></a><a class="code" href="classcsDocumentNodeReadOnly.html#48a081aa55d978315ed8a2c96d81ff6d">00178</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveAttributes () {} <a name="l00179"></a>00179 <a name="l00180"></a><a class="code" href="classcsDocumentNodeReadOnly.html#664c303e10e4486d50b1c6e87d14b602">00180</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetAttribute (<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*name*/</span>, <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*value*/</span>) {} <a name="l00181"></a><a class="code" href="classcsDocumentNodeReadOnly.html#0ad55d071d59511cb5e05a10588f60d8">00181</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetAttributeAsInt (<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*name*/</span>, <span class="keywordtype">int</span> <span class="comment">/*value*/</span>) {} <a name="l00182"></a><a class="code" href="classcsDocumentNodeReadOnly.html#4f21233dc66fdfee82a23da1b062d102">00182</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetAttributeAsFloat (<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*name*/</span>, <span class="keywordtype">float</span> <span class="comment">/*value*/</span>) {} <a name="l00184"></a>00184 }; <a name="l00185"></a>00185 <a name="l00186"></a>00186 <span class="preprocessor">#endif // __CS_CSUTIL_DOCUMENTCOMMON_H__</span> </pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 </small></address> </div></body> </html>