<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/> <meta name="generator" content="Doxygen 1.8.15"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>libzypp: zypp::WatchFile Class Reference</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="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(initResizable); /* @license-end */</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 id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">libzypp  <span id="projectnumber">17.9.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.15 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('classzypp_1_1WatchFile.html','');}); /* @license-end */ </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="#pri-attribs">Private Attributes</a> | <a href="classzypp_1_1WatchFile-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">zypp::WatchFile Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>Remember a files attributes to detect content changes. <a href="classzypp_1_1WatchFile.html#details">More...</a></p> <p><code>#include <<a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>></code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:ab9153dd84d8e4610cf656ed967f4b562"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562">Initial</a> { <a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562a375746bba584174232a45b6ec7f23ed8">NO_INIT</a>, <a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562ab1013a2519b5f7b4609c91bebe26009a">INIT</a> }</td></tr> <tr class="separator:ab9153dd84d8e4610cf656ed967f4b562"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a02833c4f29c7bea7149e14616c535566"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#a02833c4f29c7bea7149e14616c535566">WatchFile</a> (const <a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a> &path_r=<a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a>(), <a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562">Initial</a> mode=<a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562ab1013a2519b5f7b4609c91bebe26009a">INIT</a>)</td></tr> <tr class="separator:a02833c4f29c7bea7149e14616c535566"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4d1f2f0147266e7000a43c3eb299d9ac"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#a4d1f2f0147266e7000a43c3eb299d9ac">path</a> () const</td></tr> <tr class="separator:a4d1f2f0147266e7000a43c3eb299d9ac"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a97dbd12dc96d559b7897d5df7d1ff93c"><td class="memItemLeft" align="right" valign="top">off_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#a97dbd12dc96d559b7897d5df7d1ff93c">lastSize</a> () const</td></tr> <tr class="separator:a97dbd12dc96d559b7897d5df7d1ff93c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae1ff43073b3ca84adee19b6046b393f2"><td class="memItemLeft" align="right" valign="top">time_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#ae1ff43073b3ca84adee19b6046b393f2">lastMtime</a> () const</td></tr> <tr class="separator:ae1ff43073b3ca84adee19b6046b393f2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a871f4ab782ed090ec146e94ec320f851"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#a871f4ab782ed090ec146e94ec320f851">isDirty</a> () const</td></tr> <tr class="separator:a871f4ab782ed090ec146e94ec320f851"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a76b1cfbf1923c82a0cfdb22a2effe776"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#a76b1cfbf1923c82a0cfdb22a2effe776">hasChanged</a> ()</td></tr> <tr class="separator:a76b1cfbf1923c82a0cfdb22a2effe776"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a> Private Attributes</h2></td></tr> <tr class="memitem:ac075058b31b34968d4fb34f41dbc6ce2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#ac075058b31b34968d4fb34f41dbc6ce2">_path</a></td></tr> <tr class="separator:ac075058b31b34968d4fb34f41dbc6ce2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa74d7b525200a4d8b33712735593ecb1"><td class="memItemLeft" align="right" valign="top">off_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#aa74d7b525200a4d8b33712735593ecb1">_size</a></td></tr> <tr class="separator:aa74d7b525200a4d8b33712735593ecb1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1143c95fc40e3000238c83eac0a5eafd"><td class="memItemLeft" align="right" valign="top">time_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1WatchFile.html#a1143c95fc40e3000238c83eac0a5eafd">_mtime</a></td></tr> <tr class="separator:a1143c95fc40e3000238c83eac0a5eafd"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Remember a files attributes to detect content changes. </p> <p>Repeatedly call <a class="el" href="classzypp_1_1WatchFile.html#a76b1cfbf1923c82a0cfdb22a2effe776">hasChanged</a> to check whether the content has changed since the last call. Creation or deletion of the file will be reported as change as well.</p> <p>Per default the ctor stats the file, so <a class="el" href="classzypp_1_1WatchFile.html#a76b1cfbf1923c82a0cfdb22a2effe776">hasChanged</a> will detect changes done after <a class="el" href="classzypp_1_1WatchFile.html">WatchFile</a> was created.</p> <p>You may omit the initial stat by passing <code>NO_INIT</code> as second argument to the ctor. <a class="el" href="classzypp_1_1WatchFile.html">WatchFile</a> will behave as if the file did not exist at the time <a class="el" href="classzypp_1_1WatchFile.html">WatchFile</a> was created.</p> <div class="fragment"><div class="line"><span class="keyword">static</span> <a class="code" href="classzypp_1_1WatchFile.html#a02833c4f29c7bea7149e14616c535566">WatchFile</a> sysconfigFile( <span class="stringliteral">"/etc/sysconfig/SuSEfirewall2"</span>,</div><div class="line"> <a class="code" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562a375746bba584174232a45b6ec7f23ed8">WatchFile::NO_INIT</a> );</div><div class="line"><span class="keywordflow">if</span> ( sysconfigFile.hasChanged() )</div><div class="line">{</div><div class="line"> <span class="comment">// reload the file...</span></div><div class="line">}</div></div><!-- fragment --> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00049">49</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div><h2 class="groupheader">Member Enumeration Documentation</h2> <a id="ab9153dd84d8e4610cf656ed967f4b562"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab9153dd84d8e4610cf656ed967f4b562">◆ </a></span>Initial</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562">zypp::WatchFile::Initial</a></td> </tr> </table> </div><div class="memdoc"> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ab9153dd84d8e4610cf656ed967f4b562a375746bba584174232a45b6ec7f23ed8"></a>NO_INIT </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="ab9153dd84d8e4610cf656ed967f4b562ab1013a2519b5f7b4609c91bebe26009a"></a>INIT </td><td class="fielddoc"></td></tr> </table> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00052">52</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="a02833c4f29c7bea7149e14616c535566"></a> <h2 class="memtitle"><span class="permalink"><a href="#a02833c4f29c7bea7149e14616c535566">◆ </a></span>WatchFile()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">zypp::WatchFile::WatchFile </td> <td>(</td> <td class="paramtype">const <a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a> & </td> <td class="paramname"><em>path_r</em> = <code><a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a>()</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562">Initial</a> </td> <td class="paramname"><em>mode</em> = <code><a class="el" href="classzypp_1_1WatchFile.html#ab9153dd84d8e4610cf656ed967f4b562ab1013a2519b5f7b4609c91bebe26009a">INIT</a></code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00056">56</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a4d1f2f0147266e7000a43c3eb299d9ac"></a> <h2 class="memtitle"><span class="permalink"><a href="#a4d1f2f0147266e7000a43c3eb299d9ac">◆ </a></span>path()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a>& zypp::WatchFile::path </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00065">65</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <a id="a97dbd12dc96d559b7897d5df7d1ff93c"></a> <h2 class="memtitle"><span class="permalink"><a href="#a97dbd12dc96d559b7897d5df7d1ff93c">◆ </a></span>lastSize()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">off_t zypp::WatchFile::lastSize </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00068">68</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <a id="ae1ff43073b3ca84adee19b6046b393f2"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae1ff43073b3ca84adee19b6046b393f2">◆ </a></span>lastMtime()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">time_t zypp::WatchFile::lastMtime </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00071">71</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <a id="a871f4ab782ed090ec146e94ec320f851"></a> <h2 class="memtitle"><span class="permalink"><a href="#a871f4ab782ed090ec146e94ec320f851">◆ </a></span>isDirty()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classbool.html">bool</a> zypp::WatchFile::isDirty </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00074">74</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <a id="a76b1cfbf1923c82a0cfdb22a2effe776"></a> <h2 class="memtitle"><span class="permalink"><a href="#a76b1cfbf1923c82a0cfdb22a2effe776">◆ </a></span>hasChanged()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classbool.html">bool</a> zypp::WatchFile::hasChanged </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00080">80</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a id="ac075058b31b34968d4fb34f41dbc6ce2"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac075058b31b34968d4fb34f41dbc6ce2">◆ </a></span>_path</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classzypp_1_1filesystem_1_1Pathname.html">Pathname</a> zypp::WatchFile::_path</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">private</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00093">93</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <a id="aa74d7b525200a4d8b33712735593ecb1"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa74d7b525200a4d8b33712735593ecb1">◆ </a></span>_size</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">off_t zypp::WatchFile::_size</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">private</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00094">94</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <a id="a1143c95fc40e3000238c83eac0a5eafd"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1143c95fc40e3000238c83eac0a5eafd">◆ </a></span>_mtime</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">time_t zypp::WatchFile::_mtime</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">private</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="WatchFile_8h_source.html#l00095">95</a> of file <a class="el" href="WatchFile_8h_source.html">WatchFile.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>zypp/base/<a class="el" href="WatchFile_8h_source.html">WatchFile.h</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespacezypp.html">zypp</a></li><li class="navelem"><a class="el" href="classzypp_1_1WatchFile.html">WatchFile</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li> </ul> </div> </body> </html>