[172] | 1 | \hypertarget{classRootElement}{ |
---|
| 2 | \section{RootElement Class Reference} |
---|
| 3 | \label{classRootElement}\index{RootElement@{RootElement}} |
---|
| 4 | } |
---|
| 5 | This class serves to load and/or save DOMElements into/from files stored on a hard-disk. |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | {\tt \#include $<$userinfo.h$>$} |
---|
| 9 | |
---|
| 10 | Collaboration diagram for RootElement:\nopagebreak |
---|
| 11 | \begin{figure}[H] |
---|
| 12 | \begin{center} |
---|
| 13 | \leavevmode |
---|
| 14 | \includegraphics[width=76pt]{classRootElement__coll__graph} |
---|
| 15 | \end{center} |
---|
| 16 | \end{figure} |
---|
| 17 | \subsection*{Public Member Functions} |
---|
| 18 | \begin{CompactItemize} |
---|
| 19 | \item |
---|
| 20 | \hypertarget{classRootElement_6238814d4d806101cf54c6d803aac46c}{ |
---|
| 21 | \hyperlink{classRootElement_6238814d4d806101cf54c6d803aac46c}{RootElement} (const char $\ast$fileName)} |
---|
| 22 | \label{classRootElement_6238814d4d806101cf54c6d803aac46c} |
---|
| 23 | |
---|
| 24 | \begin{CompactList}\small\item\em attach new \hyperlink{classRootElement}{RootElement} instance to a file (typically with an XML extension) \item\end{CompactList}\item |
---|
| 25 | bool \hyperlink{classRootElement_888749537060fd60a939486cd2e73b9b}{Load} (void) |
---|
| 26 | \begin{CompactList}\small\item\em this method loads root element and all its subnodes from the attached file \item\end{CompactList}\item |
---|
| 27 | void \hyperlink{classRootElement_5ce717e64c3b7be09f695e6ede6294db}{Save} (void) |
---|
| 28 | \begin{CompactList}\small\item\em this method saves all the previsoulsy attached DOMElements into the file \item\end{CompactList}\item |
---|
| 29 | \hypertarget{classRootElement_9ad2ae1c73d73b06bc98afa0f32d9ad3}{ |
---|
| 30 | \hyperlink{classRootElement_9ad2ae1c73d73b06bc98afa0f32d9ad3}{operator DOMElement \&} ()} |
---|
| 31 | \label{classRootElement_9ad2ae1c73d73b06bc98afa0f32d9ad3} |
---|
| 32 | |
---|
| 33 | \begin{CompactList}\small\item\em this operator allows to use a \hyperlink{classRootElement}{RootElement} instance whenever a DOMElement variable is accepted \item\end{CompactList}\end{CompactItemize} |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | \subsection{Detailed Description} |
---|
| 37 | This class serves to load and/or save DOMElements into/from files stored on a hard-disk. |
---|
| 38 | |
---|
| 39 | Firstly, you associate new \hyperlink{classRootElement}{RootElement} instance with some filename during a time of its construtcion. Then, you disassembly some object into the new \hyperlink{classRootElement}{RootElement} instance, and save it into the file this way: |
---|
| 40 | |
---|
| 41 | \begin{Code}\begin{verbatim} CAudi audi; |
---|
| 42 | RootElement root("cars.xml"); |
---|
| 43 | UserInfo::Disassembly( audi, root, "TT"); |
---|
| 44 | root.Save(); |
---|
| 45 | \end{verbatim} |
---|
| 46 | \end{Code} |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | In the other way round, when loading object from a XML file, the appropriate code looks like this: |
---|
| 51 | |
---|
| 52 | \begin{Code}\begin{verbatim} RootElement root("cars.xml"); |
---|
| 53 | root.Load(); |
---|
| 54 | UserInfo::Assembly<T>(root,"TT"); |
---|
| 55 | \end{verbatim} |
---|
| 56 | \end{Code} |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | \subsection{Member Function Documentation} |
---|
| 61 | \hypertarget{classRootElement_888749537060fd60a939486cd2e73b9b}{ |
---|
| 62 | \index{RootElement@{RootElement}!Load@{Load}} |
---|
| 63 | \index{Load@{Load}!RootElement@{RootElement}} |
---|
| 64 | \subsubsection[Load]{\setlength{\rightskip}{0pt plus 5cm}bool RootElement::Load (void)}} |
---|
| 65 | \label{classRootElement_888749537060fd60a939486cd2e73b9b} |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | this method loads root element and all its subnodes from the attached file |
---|
| 69 | |
---|
| 70 | loads root element from a file |
---|
| 71 | |
---|
| 72 | This DOMWriter is used to import external data from xml files \hypertarget{classRootElement_5ce717e64c3b7be09f695e6ede6294db}{ |
---|
| 73 | \index{RootElement@{RootElement}!Save@{Save}} |
---|
| 74 | \index{Save@{Save}!RootElement@{RootElement}} |
---|
| 75 | \subsubsection[Save]{\setlength{\rightskip}{0pt plus 5cm}void RootElement::Save (void)}} |
---|
| 76 | \label{classRootElement_5ce717e64c3b7be09f695e6ede6294db} |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | this method saves all the previsoulsy attached DOMElements into the file |
---|
| 80 | |
---|
| 81 | Save \hyperlink{classUserInfo}{UserInfo} to the file (typically with an XML extension). |
---|
| 82 | |
---|
| 83 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
| 84 | \item |
---|
| 85 | work/git/mixpp/bdm/userinfo.h\item |
---|
| 86 | work/git/mixpp/bdm/userinfo.cpp\end{CompactItemize} |
---|