/usr/share/doc/libept-dev/html/index.html is in libept-dev 1.0.12.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | <!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"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>libept: EPT library documentation</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">libept
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main Page</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="headertitle">
<div class="title">EPT library documentation </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="Introduction"></a>
to the EPT library</h1>
<p>The EPT library is a collection of <em>data providers</em>, that are interface to access various kind of information about <em>packages</em>.</p>
<p>All data providers are independent from each other and can be instantiated alone. This allows to instantiate only the amount of infrastructure that is needed for a job, and to use alternative data provider implementations where appropriate.</p>
<p>Because of this, for example, libept can be used in applications that already use libapt-pkg directly: if the Apt object is not instantiated, then libept will not use the apt-pkg library at all.</p>
<p>Package names (and, where used, versions) are what brings all the data providers together: all the data providers access information about Debian packages, which have a well defined namespace. libept represents a package simply with a std::string containing its name: to get various kinds of information about a package, one just queries it by name to many data providers:</p>
<div class="fragment"><div class="line">Apt apt;</div>
<div class="line">Debtags debtags;</div>
<div class="line">Popcon popcon;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Get the Apt record for the debtags package</span></div>
<div class="line">PackageRecord record(apt.rawRecord(<span class="stringliteral">"debtags"</span>));</div>
<div class="line"></div>
<div class="line"><span class="comment">// Get the tags of the debtags package</span></div>
<div class="line">std::set<Tag> tags = debtags.getTagsOfItem(<span class="stringliteral">"debtags"</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Get the popcon score of the debtags package</span></div>
<div class="line"><span class="keywordtype">float</span> score = popcon.score(<span class="stringliteral">"debtags"</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Print the records of all image editors</span></div>
<div class="line">std::set<Tag> imageEditors;</div>
<div class="line">imageEditors.insert(debtags.vocabulary().tagByName(<span class="stringliteral">"use::editing"</span>));</div>
<div class="line">imageEditors.insert(debtags.vocabulary().tagByName(<span class="stringliteral">"works-with::image"</span>));</div>
<div class="line">imageEditors.insert(debtags.vocabulary().tagByName(<span class="stringliteral">"role::program"</span>));</div>
<div class="line">std::set<std::string> packages = debtags.getItemsHavingTags(imageEditors);</div>
<div class="line"><span class="keywordflow">for</span> (std::set<std::string>::const_iterator i = packages.begin();</div>
<div class="line"> i != packages.end(); ++i)</div>
<div class="line">{</div>
<div class="line"> PackageRecord rec(apt.rawRecord(*i));</div>
<div class="line"> PackageState state = apt.state(*i);</div>
<div class="line"> <span class="comment">// Also show whether a package is installed</span></div>
<div class="line"> <span class="keywordflow">if</span> (state.isInstalled())</div>
<div class="line"> std::cout << rec.package() << <span class="stringliteral">" i "</span> << rec.shortDescription();</div>
<div class="line"> <span class="keywordflow">else</span></div>
<div class="line"> std::cout << rec.package() << <span class="stringliteral">" - "</span> << rec.shortDescription();</div>
<div class="line">}</div>
</div><!-- fragment --><p>A data provider does not need to know about the others, nor it needs to implement a specific interface: the only requirement on a data provider is that it can be queried using package names.</p>
<p>The only methods that are found in all data providers are hasData() and <a class="el" href="namespaceept_1_1axi.html#ab8385de295b1a958087acee6cd73f0ce" title="Return the last update timestamp of the index. ">timestamp()</a>, that can be used to query if a data provider is working and how up to date it is.</p>
<p>The data providers currently implemented are:</p>
<ul>
<li><a class="el" href="classept_1_1apt_1_1Apt.html" title="High-level access to the Apt cache, as a data provider for the ept framework. ">ept::apt::Apt</a>: access the APT database. </li>
<li><a class="el" href="classept_1_1debtags_1_1Debtags.html" title="Access the on-disk Debtags tag database. ">ept::debtags::Debtags</a>: access the Debtags tag information. </li>
<li><a class="el" href="classept_1_1popcon_1_1Popcon.html" title="Maps Packages to IDs and vice-versa. ">ept::popcon::Popcon</a>: access Popcon package scores. </li>
<li>ept::textsearch::TextSearch: fast Xapian-based full text search on package description, and more.</li>
</ul>
<p>It is easy to implement more data providers. It is also easy to implement new data providers outside of this library, as long as they can be queried using package names. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 24 2013 20:23:12 for libept by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
|