Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_book_db.html
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 6 43e37759235e
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582

<!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"/>
<title>TB9.2 Example Applications: CBookDb Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2 -->
<div class="contents">
<h1>CBookDb Class Reference</h1><!-- doxytag: class="CBookDb" -->
<p><a href="class_c_book_db-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a1cff43523b8c167b07ab7cd530f06cf2">~CBookDb</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#adad67a3cd76d53b953e568e6800d39fa">OpenDb</a> (const TFileName &amp;aExistingBookFile)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a63294e77864336caff068a0d8328084c">CreateDb</a> (const TFileName &amp;aNewBookFile)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a2a68483e682d42b6cbde02dc2abaf7b1">RemoveDb</a> (const TFileName &amp;aExistingBookFile)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a3487424c728056eb2a95b0108dd46473">Close</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TBool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#adf1b55c6f6f22739b4546dd180f39967">IsOpen</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a3137b55dcff9d2135230a40211321476">AddBookWithSql</a> (const TDesC &amp;aAuthor, const TDesC &amp;aTitle, const TDesC &amp;aDescription)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#aef6806bae5307151073caedaea88e81f">AddBookWithCppApiL</a> (const TDesC &amp;aAuthor, const TDesC &amp;aTitle, const TDesC &amp;aDescription)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">CDesCArrayFlat *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a748adb83e450c321b2c9af57eaf029e4">GetAllBooksL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">CDesCArrayFlat *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a6b153d0c0eb9d365b1163ec1301be78e">GetBooksByKeyL</a> (const TDesC &amp;aColumnName, const TDesC &amp;aSearchString)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a3f4fd01c0f549c6c564955f2faa6ee62">GetABookFast</a> (const TDesC &amp;aTitle, TDes &amp;aResult)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#ac4a202bf6ebb76155ef0dc65ece5a386">RemoveBooks</a> (const TDesC &amp;aTitle, TInt &amp;aResultCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a96f6946ac8885c20f831300cbf0d55b0">RemoveAllBooks</a> (TInt &amp;aResultCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a558090a1a44e419fd420f7113e80b310">UpdateBookTitle</a> (const TDesC &amp;aOldTitleKey, const TDesC &amp;aNewTitle)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">CDesCArrayFlat *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a5f13ae296de4d79beed916a416e67530">ColumnNamesAndSizesL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a60d34d3250835e8341808b33d09733bc">HasDateColumn</a> (TBool &amp;aReturnValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a72ca4025b97842c2e743b93cbf2b013a">AddDateColumn</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a470d106d843cea950d8c5bb8ccfeb122">RemoveDateColumn</a> ()</td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_c_book_db.html">CBookDb</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_book_db.html#a87b80f9d2487d6ad27c109293c7d6bdd">NewL</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Class: <a class="el" href="class_c_book_db.html">CBookDb</a></p>
<p>Description: An instance of class <a class="el" href="class_c_book_db.html">CBookDb</a> provides simple Book database access: creating &amp; manipulating Book database files and database entries (books).</p>
<p>Database definition:</p>
<p>The Book contains one table as follows:</p>
<p>Table name: Books Column: Type: Max length: ------ ----- ----------- Author EDbColText 50 (using default) Title EDbColText 60 (see KTitleMaxLength) Description EDbColLongText 128 (see KDescriptionMaxLength) In run time: PublishDate EDbColDateTime</p>
<p>Note that underlying database allows description to be up to 2GB long, but this engine limits the size to 128 unicode characters. The PublishDate does not exist, when the database is created. It can be added on the fly (see AddDateColumnL method).</p>
<p>There is also index for Books table with name "BooksIndex". It consists of two columns:</p>
<p>Author, Title</p>
<p>Index provides quick find. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8h_source.html#l00074">74</a> of file <a class="el" href="_d_b_m_s_engine_8h_source.html">DBMSEngine.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a1cff43523b8c167b07ab7cd530f06cf2"></a><!-- doxytag: member="CBookDb::~CBookDb" ref="a1cff43523b8c167b07ab7cd530f06cf2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CBookDb::~CBookDb </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: ~CBookDb</p>
<p>Description: Destroy the object. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00034">34</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a87b80f9d2487d6ad27c109293c7d6bdd"></a><!-- doxytag: member="CBookDb::NewL" ref="a87b80f9d2487d6ad27c109293c7d6bdd" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_c_book_db.html">CBookDb</a> * CBookDb::NewL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: NewL</p>
<p>Description: Get instance of a <a class="el" href="class_c_book_db.html">CBookDb</a> object. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00020">20</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="adad67a3cd76d53b953e568e6800d39fa"></a><!-- doxytag: member="CBookDb::OpenDb" ref="adad67a3cd76d53b953e568e6800d39fa" args="(const TFileName &amp;aExistingBookFile)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::OpenDb </td>
          <td>(</td>
          <td class="paramtype">const TFileName &amp;&nbsp;</td>
          <td class="paramname"> <em>aExistingBookFile</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: OpenDbL</p>
<p>Description: Open existing Book database in exclusive (non-shared) mode.</p>
<p>Param: aExistingBookFile is full path to Book database file.</p>
<p>Return: KErrNone, if no error. KErrNotFound, if the file does not exist.</p>
<p>Leaves: With one of the system wide error codes, if the file is not a correct database file. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00067">67</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a63294e77864336caff068a0d8328084c"></a><!-- doxytag: member="CBookDb::CreateDb" ref="a63294e77864336caff068a0d8328084c" args="(const TFileName &amp;aNewBookFile)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::CreateDb </td>
          <td>(</td>
          <td class="paramtype">const TFileName &amp;&nbsp;</td>
          <td class="paramname"> <em>aNewBookFile</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: CreateDbL</p>
<p>Description: Creates and opens a new Book database. Creates a database file, table structure and an index. The database will be open in exclusive (non-shareable) mode. The database must be closed, when not used any more. If the database exists, it is replaced.</p>
<p>Param: aNewBookFile Name of the new database file. Is a full path (incl. the filename). Operations following this call are performed to the new database file.</p>
<p>Return: returns always KErrNone</p>
<p>Leaves: If the file cannot be created or database initialized. Leaves with system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00096">96</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a2a68483e682d42b6cbde02dc2abaf7b1"></a><!-- doxytag: member="CBookDb::RemoveDb" ref="a2a68483e682d42b6cbde02dc2abaf7b1" args="(const TFileName &amp;aExistingBookFile)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::RemoveDb </td>
          <td>(</td>
          <td class="paramtype">const TFileName &amp;&nbsp;</td>
          <td class="paramname"> <em>aExistingBookFile</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: RemoveDbL</p>
<p>Description: Removes Book database. Closes any open database, before dropping the database.</p>
<p>Param: aExistingBookFile is full path to Book database file.</p>
<p>Leaves: If the file file is not a valid database file or the database does not containt Books table, the method leaves with system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00126">126</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a3487424c728056eb2a95b0108dd46473"></a><!-- doxytag: member="CBookDb::Close" ref="a3487424c728056eb2a95b0108dd46473" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::Close </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: Close</p>
<p>Description: Closes the database opened with either OpenDbL or CreateDbL. It is safe to close the database even if it is closed.</p>
<p>Return: KErrNone, if no error. KErrNotFound, if the file does not exist. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00156">156</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="adf1b55c6f6f22739b4546dd180f39967"></a><!-- doxytag: member="CBookDb::IsOpen" ref="adf1b55c6f6f22739b4546dd180f39967" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TBool CBookDb::IsOpen </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: IsOpen</p>
<p>Description: Return status, whether the database is open and ready for operations. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00173">173</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a3137b55dcff9d2135230a40211321476"></a><!-- doxytag: member="CBookDb::AddBookWithSql" ref="a3137b55dcff9d2135230a40211321476" args="(const TDesC &amp;aAuthor, const TDesC &amp;aTitle, const TDesC &amp;aDescription)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::AddBookWithSql </td>
          <td>(</td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aAuthor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aTitle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aDescription</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: AddBookWithSql</p>
<p>Description: Adds a new book to Books table. The book is inserted using SQL and RDbView.</p>
<p>Param: aAuthor Author of the book. Must be shorter than the default max text length in Book API (=50). Must not be empty.</p>
<p>Param: aTitle Title of the book. Must be shorter than KTitleMaxLength. Must not be empty.</p>
<p>Param: aDescription Description of the book. It must not be longer than KDescriptionMaxLength. Must not be empty. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00254">254</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aef6806bae5307151073caedaea88e81f"></a><!-- doxytag: member="CBookDb::AddBookWithCppApiL" ref="aef6806bae5307151073caedaea88e81f" args="(const TDesC &amp;aAuthor, const TDesC &amp;aTitle, const TDesC &amp;aDescription)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::AddBookWithCppApiL </td>
          <td>(</td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aAuthor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aTitle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aDescription</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: AddBookWithCppApiL</p>
<p>Description: Adds a new book to Books table. The book is inserted using RDbTable API.</p>
<p>Param: aAuthor Author of the book. Must be shorter than the default max text length in Book API (=50). Must not be empty.</p>
<p>Param: aTitle Title of the book. Must be shorter than KTitleMaxLength. Must not be empty.</p>
<p>Param: aDescription Description of the book. It must not be longer than KDescriptionMaxLength. Must not be empty. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00326">326</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a748adb83e450c321b2c9af57eaf029e4"></a><!-- doxytag: member="CBookDb::GetAllBooksL" ref="a748adb83e450c321b2c9af57eaf029e4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CDesCArrayFlat * CBookDb::GetAllBooksL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: GetAllBooksL</p>
<p>Description: Retrieve all books from database.</p>
<p>Returns: Array of books. Each array item is represented as follows: &lt;Author&gt;|&lt;Title&gt;| Maximum length of each item is KBookItemMaxLength Caller takes ownership of the array. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00385">385</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a6b153d0c0eb9d365b1163ec1301be78e"></a><!-- doxytag: member="CBookDb::GetBooksByKeyL" ref="a6b153d0c0eb9d365b1163ec1301be78e" args="(const TDesC &amp;aColumnName, const TDesC &amp;aSearchString)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CDesCArrayFlat * CBookDb::GetBooksByKeyL </td>
          <td>(</td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aColumnName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aSearchString</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: GetBooksByKeyL</p>
<p>Description: Retrieve books from database, which match given column and search pattern. Implementation uses SQL.</p>
<p>Param: aColumnName Name of the column to apply the search pattern. Must be either KBooksAuthorCol or KBooksTitleCol</p>
<p>Param: aSearchString Search pattern used to restrict results to.</p>
<p>Returns: Array of books. Each array item is represented as follows: &lt;Author&gt;|&lt;Title&gt;| Maximum length of each item is KBookItemMaxLength Caller takes ownership of the array. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00515">515</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a3f4fd01c0f549c6c564955f2faa6ee62"></a><!-- doxytag: member="CBookDb::GetABookFast" ref="a3f4fd01c0f549c6c564955f2faa6ee62" args="(const TDesC &amp;aTitle, TDes &amp;aResult)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::GetABookFast </td>
          <td>(</td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aTitle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TDes &amp;&nbsp;</td>
          <td class="paramname"> <em>aResult</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: GetABookFast</p>
<p>Description: Retrieves book information for given book name. This method uses index to find first occurrence of the book. Implementation uses exact match.</p>
<p>Param: aTitle is name of the book to search for.</p>
<p>Param: aResult If there is a matching book, the complete book info is written to aResult. It is in the following format: &lt;Author&gt;|&lt;Title&gt;| Length of the given descriptor must be KBookItemMaxLength </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00441">441</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac4a202bf6ebb76155ef0dc65ece5a386"></a><!-- doxytag: member="CBookDb::RemoveBooks" ref="ac4a202bf6ebb76155ef0dc65ece5a386" args="(const TDesC &amp;aTitle, TInt &amp;aResultCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::RemoveBooks </td>
          <td>(</td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aTitle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TInt &amp;&nbsp;</td>
          <td class="paramname"> <em>aResultCount</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: RemoveBooks</p>
<p>Description: Deletes book(s) from database.</p>
<p>Param: aTitle is name of the book to delete. It can contain wildcard characters (% for single char, * for zero or multiple chars).</p>
<p>Param: aResultCount will contain number of deleted books.</p>
<p>Returns: KErrNone or one of the system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00604">604</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a96f6946ac8885c20f831300cbf0d55b0"></a><!-- doxytag: member="CBookDb::RemoveAllBooks" ref="a96f6946ac8885c20f831300cbf0d55b0" args="(TInt &amp;aResultCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::RemoveAllBooks </td>
          <td>(</td>
          <td class="paramtype">TInt &amp;&nbsp;</td>
          <td class="paramname"> <em>aResultCount</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: RemoveAllBooksL</p>
<p>Description: Deletes all books from database.</p>
<p>Param: aResultCount will contain number of deleted books.</p>
<p>Returns: KErrNone or one of the system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00646">646</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a558090a1a44e419fd420f7113e80b310"></a><!-- doxytag: member="CBookDb::UpdateBookTitle" ref="a558090a1a44e419fd420f7113e80b310" args="(const TDesC &amp;aOldTitleKey, const TDesC &amp;aNewTitle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::UpdateBookTitle </td>
          <td>(</td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aOldTitleKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const TDesC &amp;&nbsp;</td>
          <td class="paramname"> <em>aNewTitle</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: UpdateBookTitle</p>
<p>Description: Changes the title for a book (or books, if there are multiple books with the name aOldTitleKey).</p>
<p>Param: aOldTitleKey Book title used for getting books for update.</p>
<p>Param: aNewTitle New title for the book(s).</p>
<p>Returns: KErrNone or one of the system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00681">681</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a5f13ae296de4d79beed916a416e67530"></a><!-- doxytag: member="CBookDb::ColumnNamesAndSizesL" ref="a5f13ae296de4d79beed916a416e67530" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CDesCArrayFlat * CBookDb::ColumnNamesAndSizesL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: ColumnNamesAndSizes</p>
<p>Description: Get array of colum names in the Books table. The result array includes also the size of the textual columns. This is here just to demonstrate iterating column names from a table.</p>
<p>Returns: Array of column names. Caller takes ownership. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00704">704</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a60d34d3250835e8341808b33d09733bc"></a><!-- doxytag: member="CBookDb::HasDateColumn" ref="a60d34d3250835e8341808b33d09733bc" args="(TBool &amp;aReturnValue)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::HasDateColumn </td>
          <td>(</td>
          <td class="paramtype">TBool &amp;&nbsp;</td>
          <td class="paramname"> <em>aReturnValue</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: HasDateColumn</p>
<p>Description: Tests whether the Books table has date column.</p>
<p>Returns: KErrNone or one of the system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00754">754</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a72ca4025b97842c2e743b93cbf2b013a"></a><!-- doxytag: member="CBookDb::AddDateColumn" ref="a72ca4025b97842c2e743b93cbf2b013a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::AddDateColumn </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: AddDateColumn</p>
<p>Description: Adds date column to Books table. This here just to demonstrate how to alter table definition. This fails, if the date column already exists.</p>
<p>Returns: KErrNone or one of the system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00794">794</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a470d106d843cea950d8c5bb8ccfeb122"></a><!-- doxytag: member="CBookDb::RemoveDateColumn" ref="a470d106d843cea950d8c5bb8ccfeb122" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CBookDb::RemoveDateColumn </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function: RemoveDateColumn</p>
<p>Description: Removes date column from Books table. This here just to demonstrate how to alter table definition. This fails, if the date column does not exist.</p>
<p>Returns: KErrNone or one of the system wide error codes. </p>

<p>Definition at line <a class="el" href="_d_b_m_s_engine_8cpp_source.html#l00805">805</a> of file <a class="el" href="_d_b_m_s_engine_8cpp_source.html">DBMSEngine.cpp</a>.</p>

</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>