Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /proc/self/root/usr/share/doc/libclam-doc/html/ |
Current File : //proc/self/root/usr/share/doc/libclam-doc/html/group__XmlAdapters.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>CLAM-Development: Using XML Adapters to implement StoreOn and LoadFrom</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">CLAM-Development  <span id="projectnumber">1.4.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</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="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> </div> <div class="headertitle"> <div class="title">Using XML Adapters to implement StoreOn and LoadFrom</div> </div> <div class="ingroups"><a class="el" href="group__XmlCustomize.html">Customizing the XML format for your object</a></div></div><!--header--> <div class="contents"> <p>How to use XmlAdapters to implement Load and Store methods for a <a class="el" href="classCLAM_1_1Component.html" title="Abstract class for objects that can have subitems to be stored on a storage.">CLAM::Component</a>. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classCLAM_1_1XMLAdapter.html">CLAM::XMLAdapter< T ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">This class adapts to the <a class="el" href="classCLAM_1_1XMLable.html" title="Interface for objects to be stored on a XMLStorage.">XMLable</a> interface any basic object. <a href="classCLAM_1_1XMLAdapter.html#details">More...</a><br/></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classCLAM_1_1XMLArrayAdapter.html">CLAM::XMLArrayAdapter< T ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">This class adapts to the <a class="el" href="classCLAM_1_1XMLable.html" title="Interface for objects to be stored on a XMLStorage.">XMLable</a> interface any array of basic objects. <a href="classCLAM_1_1XMLArrayAdapter.html#details">More...</a><br/></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classCLAM_1_1XMLComponentAdapter.html">CLAM::XMLComponentAdapter</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">This class adapts to the <a class="el" href="classCLAM_1_1XMLable.html" title="Interface for objects to be stored on a XMLStorage.">XMLable</a> interface any object that is a <a class="el" href="classCLAM_1_1Component.html" title="Abstract class for objects that can have subitems to be stored on a storage.">CLAM::Component</a>. <a href="classCLAM_1_1XMLComponentAdapter.html#details">More...</a><br/></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classCLAM_1_1XMLIterableAdapter.html">CLAM::XMLIterableAdapter< T ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">This class adapts to the <a class="el" href="classCLAM_1_1XMLable.html" title="Interface for objects to be stored on a XMLStorage.">XMLable</a> interface any STL like container of basic objects or <a class="el" href="classCLAM_1_1Component.html" title="Abstract class for objects that can have subitems to be stored on a storage.">CLAM::Component</a>'s. <a href="classCLAM_1_1XMLIterableAdapter.html#details">More...</a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <p>How to use XmlAdapters to implement Load and Store methods for a <a class="el" href="classCLAM_1_1Component.html" title="Abstract class for objects that can have subitems to be stored on a storage.">CLAM::Component</a>. </p> <dl class="section author"><dt>Author:</dt><dd>David Garcia.</dd></dl> <p>When you are implementing StoreOn and LoadFrom for a given Component, you should choose one of those adapters to wrap the subitems to be stored on, or loaded from, the XmlStorage.</p> <p>When you create an adapter, the adaptee is specified by the the first constructor parameters, so they are adapter dependant. The later two constructor parameters are always to indicate in which XML form the subitem will be stored or loaded. </p> <div class="fragment"><div class="line"> MyAdapterClass( <span class="comment">// Here goes the adaptee info </span></div> <div class="line"> , <span class="keyword">const</span> <span class="keywordtype">char</span> * name = <a class="code" href="OSDefines_8hxx.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <span class="keywordtype">bool</span> beElement = <span class="keyword">false</span> );</div> </div><!-- fragment --><ul> <li>As plain content (name = null, beElement = false)</li> <li>As XML attribute (name = "yourAttributeName", beElement = false)</li> <li>As XML element (name = "yourElementName", beElement = true)</li> </ul> <p>You can use them in the following form: </p> <div class="fragment"><div class="line"> <span class="keywordtype">void</span> StoreOn(<a class="code" href="classCLAM_1_1Storage.html" title="The abstract class for storages.">CLAM::Storage</a> & storage)<span class="keyword"> const</span></div> <div class="line"><span class="keyword"> </span>{</div> <div class="line"> SelectedAdapter adapter(subitem, <span class="stringliteral">"ElementName"</span>, <span class="keyword">true</span>);</div> <div class="line"> storage.<a class="code" href="classCLAM_1_1Storage.html#a3635ac06fce8025cccc23ea15fc85e4a" title="Stores an storable object on the storage.">Store</a>(adapter);</div> <div class="line"> }</div> <div class="line"> <span class="keywordtype">void</span> LoadFrom(<a class="code" href="classCLAM_1_1Storage.html" title="The abstract class for storages.">CLAM::Storage</a> & storage)</div> <div class="line"> {</div> <div class="line"> SelectedAdapter adapter(subitem, <span class="stringliteral">"ElementName"</span>, <span class="keyword">true</span>);</div> <div class="line"> <span class="keywordflow">if</span> (!storage.<a class="code" href="classCLAM_1_1Storage.html#a47040ce330c31a8af99e8db8b00022eb" title="Loads an storable object from the storage.">Load</a>(adapter))</div> <div class="line"> {</div> <div class="line"> <span class="comment">// error handling</span></div> <div class="line"> }</div> <div class="line"> }</div> </div><!-- fragment --><dl class="section warning"><dt>Warning:</dt><dd>The adapter only copies the pointer to the the null-terminated string, not a copy of it. So it is dangerous to delete or modify this string until the adapter has been stored on the Storage.</dd></dl> <p>For more information see the documentation for any concrete adapter class.</p> <dl class="section author"><dt>Author:</dt><dd>David Garcia. </dd></dl> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1 </small></address> </body> </html>
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare