📄 classfilesyncsource.tex
字号:
\section{FileSyncSource Class Reference}\label{classFileSyncSource}\index{FileSyncSource@{FileSyncSource}}Synchronizes the content of files in a certain directory and the file attributes using a certain XML format. {\tt \#include $<$FileSyncSource.h$>$}Inheritance diagram for FileSyncSource:\nopagebreak\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=75pt]{classFileSyncSource__inherit__graph}\end{center}\end{figure}Collaboration diagram for FileSyncSource:\nopagebreak\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=130pt]{classFileSyncSource__coll__graph}\end{center}\end{figure}\subsection*{Public Member Functions}\begin{CompactItemize}\item \textbf{FileSyncSource} (const WCHAR $\ast$name, {\bf SyncSourceConfig} $\ast$sc)\label{classFileSyncSource_d007c5fa3051331e5770ddf55c17a033}\item void {\bf setDir} (const char $\ast$p)\begin{CompactList}\small\item\em The directory synchronized by this source. \item\end{CompactList}\item const char $\ast$ \textbf{getDir} ()\label{classFileSyncSource_2b16db43cd52868973256a8e166bc4c4}\item void {\bf setFileNode} (ManagementNode $\ast$mn)\begin{CompactList}\small\item\em Tracking changes requires persistent storage: for each item sent to the server a property is set to the item's modification time. \item\end{CompactList}\item ManagementNode $\ast$ \textbf{getFileNode} ()\label{classFileSyncSource_b5a92bdb0cd2c5d194275de259851f09}\item SyncItem $\ast$ {\bf getFirstItem} ()\begin{CompactList}\small\item\em Return the first SyncItem of all. \item\end{CompactList}\item SyncItem $\ast$ {\bf getNextItem} ()\begin{CompactList}\small\item\em Return the next SyncItem of all. \item\end{CompactList}\item SyncItem $\ast$ {\bf getFirstNewItem} ()\begin{CompactList}\small\item\em Return the first SyncItem of new one. \item\end{CompactList}\item SyncItem $\ast$ {\bf getNextNewItem} ()\begin{CompactList}\small\item\em Return the next SyncItem of new one. \item\end{CompactList}\item SyncItem $\ast$ {\bf getFirstUpdatedItem} ()\begin{CompactList}\small\item\em Return the first SyncItem of updated one. \item\end{CompactList}\item SyncItem $\ast$ {\bf getNextUpdatedItem} ()\begin{CompactList}\small\item\em Return the next SyncItem of updated one. \item\end{CompactList}\item SyncItem $\ast$ {\bf getFirstDeletedItem} ()\begin{CompactList}\small\item\em Return the first SyncItem of updated one. \item\end{CompactList}\item SyncItem $\ast$ {\bf getNextDeletedItem} ()\begin{CompactList}\small\item\em Return the next SyncItem of updated one. \item\end{CompactList}\item SyncItem $\ast$ {\bf getFirstItemKey} ()\begin{CompactList}\small\item\em Return the key of the first SyncItem of all. \item\end{CompactList}\item SyncItem $\ast$ {\bf getNextItemKey} ()\begin{CompactList}\small\item\em Return the key of the next SyncItem of all. \item\end{CompactList}\item int {\bf addItem} (SyncItem \&item)\begin{CompactList}\small\item\em Called by the sync engine to add an item that the server has sent. \item\end{CompactList}\item int {\bf updateItem} (SyncItem \&item)\begin{CompactList}\small\item\em Called by the sync engine to update an item that the source already should have. \item\end{CompactList}\item int {\bf deleteItem} (SyncItem \&item)\begin{CompactList}\small\item\em Called by the sync engine to update an item that the source already should have. \item\end{CompactList}\item void {\bf setItemStatus} (const WCHAR $\ast$key, int status)\begin{CompactList}\small\item\em called by the sync engine with the status returned by the server for a certain item that the client sent to the server \item\end{CompactList}\item int {\bf beginSync} ()\begin{CompactList}\small\item\em Called by the engine from inside SyncClient::sync() at the begin of the sync. \item\end{CompactList}\item int {\bf endSync} ()\begin{CompactList}\small\item\em Called by the engine from inside SyncClient::sync() at the end of the sync. \item\end{CompactList}\item void \textbf{assign} ({\bf FileSyncSource} \&s)\label{classFileSyncSource_915e533591f833439923083134fe9c28}\item ArrayElement $\ast$ {\bf clone} ()\label{classFileSyncSource_5170a55f3400458479a46829e5068de3}\begin{CompactList}\small\item\em ArrayElement implementation. \item\end{CompactList}\end{CompactItemize}\subsection*{Protected Member Functions}\begin{CompactItemize}\item \textbf{FileSyncSource} ({\bf SyncSource} \&s)\label{classFileSyncSource_54a4607ff1592d8a3cef66fa9df1ed3d}\item virtual bool \textbf{setItemData} (SyncItem $\ast$syncItem)\label{classFileSyncSource_ad5db9196b2c3bfca8814f9861c5bb75}\item int {\bf addedItem} (SyncItem \&item, const WCHAR $\ast$key)\begin{CompactList}\small\item\em must be called for each successfully added item \item\end{CompactList}\end{CompactItemize}\subsection*{Protected Attributes}\begin{CompactItemize}\item char $\ast$ \textbf{dir}\label{classFileSyncSource_045055271659347f20134782158ff299}\end{CompactItemize}\subsection*{Classes}\begin{CompactItemize}\item struct \textbf{ItemIteratorContainer}\end{CompactItemize}\subsection{Detailed Description}Synchronizes the content of files in a certain directory and the file attributes using a certain XML format. \begin{Desc}\item[{\bf Todo}]document what that XML format is \end{Desc}\begin{Desc}\item[{\bf Todo}]\doxyref{updateItem()}{p.}{classFileSyncSource_3cfc67d2d4906ffd0ecc244ba074bb80} is not implemented \end{Desc}\subsection{Member Function Documentation}\index{FileSyncSource@{FileSyncSource}!addedItem@{addedItem}}\index{addedItem@{addedItem}!FileSyncSource@{FileSyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int FileSyncSource::addedItem (SyncItem \& {\em item}, const WCHAR $\ast$ {\em key})\hspace{0.3cm}{\tt [protected]}}\label{classFileSyncSource_42adb8b7d7038cb559baa73421243d18}must be called for each successfully added item \begin{Desc}\item[Parameters:]\begin{description}\item[{\em item}]the added item \item[{\em key}]the key of that item \end{description}\end{Desc}\begin{Desc}\item[Returns:]SyncML status code, STC\_\-ITEM\_\-ADDED on success \end{Desc}\index{FileSyncSource@{FileSyncSource}!setDir@{setDir}}\index{setDir@{setDir}!FileSyncSource@{FileSyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void FileSyncSource::setDir (const char $\ast$ {\em p})}\label{classFileSyncSource_a5990c6776d93f50c308d7ef27b49adc}The directory synchronized by this source. \begin{Desc}\item[Parameters:]\begin{description}\item[{\em p}]an absolute or relative path to the directory \end{description}\end{Desc}\index{FileSyncSource@{FileSyncSource}!setFileNode@{setFileNode}}\index{setFileNode@{setFileNode}!FileSyncSource@{FileSyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void FileSyncSource::setFileNode (ManagementNode $\ast$ {\em mn})\hspace{0.3cm}{\tt [inline]}}\label{classFileSyncSource_64ff56b7e5904ddbc879f94657e81a7d}Tracking changes requires persistent storage: for each item sent to the server a property is set to the item's modification time. The caller is responsible for storing these properties after a successful sync and continues to own the node instance itself.During the next \doxyref{beginSync()}{p.}{classFileSyncSource_d6d5dcd4c70c95498ecb696157e6a23b} the information will be used to identify added, updated and deleted items. \index{FileSyncSource@{FileSyncSource}!getFirstItem@{getFirstItem}}\index{getFirstItem@{getFirstItem}!FileSyncSource@{FileSyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SyncItem$\ast$ FileSyncSource::getFirstItem ()\hspace{0.3cm}{\tt [inline, virtual]}}\label{classFileSyncSource_c1fbb0cf67f42a0957fdaa76b6c3e363}Return the first SyncItem of all. It is used in case of slow sync and retrieve the entire data source content. Implements {\bf SyncSource} \doxyref{}{p.}{classSyncSource_e7377f9362faff63ac51841946bbfc1c}.\index{FileSyncSource@{FileSyncSource}!getNextItem@{getNextItem}}\index{getNextItem@{getNextItem}!FileSyncSource@{FileSyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SyncItem$\ast$ FileSyncSource::getNextItem ()\hspace{0.3cm}{\tt [inline, virtual]}}\label{classFileSyncSource_8d7bb2e24c40d47afc99499409c9c003}Return the next SyncItem of all. It is used in case of slow sync and retrieve the entire data source content. Implements {\bf SyncSource} \doxyref{}{p.}{classSyncSource_441e612a947bc60b1f25306e3130cc1b}.\index{FileSyncSource@{FileSyncSource}!getFirstNewItem@{getFirstNewItem}}\index{getFirstNewItem@{getFirstNewItem}!FileSyncSource@{FileSyncSource}}\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SyncItem$\ast$ FileSyncSource::getFirstNewItem ()\hspace{0.3cm}{\tt [inline, virtual]}}\label{classFileSyncSource_6e2257f8011bb2cf41cd13d60da5e9ca}Return the first SyncItem of new one.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -