123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <!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.9.1"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>openPilotLog: src/database/database.h Source File</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>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- <link href="custom_dark_theme.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="projectlogo"><img alt="Logo" src="icon_main.png"/></td>
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">openPilotLog
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.9.1 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
- /* @license-end */
- </script>
- <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('',true,false,'search.php','Search');
- $(document).ready(function() { init_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('database_8h_source.html',''); initResizable(); });
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="headertitle">
- <div class="title">database.h</div> </div>
- </div><!--header-->
- <div class="contents">
- <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
- <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> *openPilotLog - A FOSS Pilot Logbook Application</span></div>
- <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *Copyright (C) 2020-2022 Felix Turowsky</span></div>
- <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *This program is free software: you can redistribute it and/or modify</span></div>
- <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> *it under the terms of the GNU General Public License as published by</span></div>
- <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *the Free Software Foundation, either version 3 of the License, or</span></div>
- <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *(at your option) any later version.</span></div>
- <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> *This program is distributed in the hope that it will be useful,</span></div>
- <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> *but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
- <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
- <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *GNU General Public License for more details.</span></div>
- <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> *You should have received a copy of the GNU General Public License</span></div>
- <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> *along with this program. If not, see <https://www.gnu.org/licenses/>.</span></div>
- <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> */</span></div>
- <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef DATABASE_H</span></div>
- <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#define DATABASE_H</span></div>
- <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  </div>
- <div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <QPair></span></div>
- <div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <QHash></span></div>
- <div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <QString></span></div>
- <div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <QDir></span></div>
- <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <QSqlDatabase></span></div>
- <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <QSqlDriver></span></div>
- <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <QSqlQuery></span></div>
- <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <QSqlError></span></div>
- <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <QSqlTableModel></span></div>
- <div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <QSqlQuery></span></div>
- <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <QSqlRecord></span></div>
- <div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <QSqlField></span></div>
- <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div>
- <div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "src/classes/paths.h"</span></div>
- <div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include "src/opl.h"</span></div>
- <div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "src/database/row.h"</span></div>
- <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
- <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
- <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  </div>
- <div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">namespace </span><a class="code" href="namespace_o_p_l.html">OPL</a> {</div>
- <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  </div>
- <div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">//using RowData_T = QHash<QString, QVariant>;</span></div>
- <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  </div>
- <div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#define DB OPL::Database::instance()</span></div>
- <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
- <div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html"> 57</a></span> <span class="keyword">class </span><a class="code" href="class_o_p_l_1_1_database.html">Database</a> : <span class="keyword">public</span> QObject {</div>
- <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  </div>
- <div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">private</span>:</div>
- <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  Q_OBJECT</div>
- <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="class_o_p_l_1_1_database.html">Database</a>()</div>
- <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  : databaseFile(<a class="code" href="class_o_p_l_1_1_paths.html#a1636e1c04163319f63f56868142f1d1f">OPL::Paths::databaseFileInfo</a>())</div>
- <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  {}</div>
- <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keyword">static</span> <a class="code" href="class_o_p_l_1_1_database.html">Database</a>* <span class="keyword">self</span>;</div>
- <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">const</span> QFileInfo databaseFile;</div>
- <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  QStringList tableNames;</div>
- <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  QHash<QString, QStringList> tableColumns;</div>
- <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  </div>
- <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keyword">static</span> QString SQLITE_DRIVER = QStringLiteral(<span class="stringliteral">"QSQLITE"</span>);</div>
- <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keyword">static</span> QList<OPL::DbTable> USER_TABLES = {</div>
- <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  OPL::DbTable::Flights,</div>
- <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  OPL::DbTable::Pilots,</div>
- <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  OPL::DbTable::Tails</div>
- <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  };</div>
- <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keyword">static</span> QList<OPL::DbTable> TEMPLATE_TABLES = {</div>
- <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  OPL::DbTable::Aircraft,</div>
- <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  OPL::DbTable::Airports,</div>
- <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  OPL::DbTable::Currencies,</div>
- <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  OPL::DbTable::Changelog,</div>
- <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  };</div>
- <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
- <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
- <div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">public</span>:</div>
- <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="class_o_p_l_1_1_database.html">Database</a>(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_database.html">Database</a>&) = <span class="keyword">delete</span>;</div>
- <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_database.html">Database</a>&) = <span class="keyword">delete</span>;</div>
- <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keyword">static</span> <a class="code" href="class_o_p_l_1_1_database.html">Database</a>* instance();</div>
- <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div>
- <div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#aa5b783822a603bdcfd1d8c93ba0af34b"> 96</a></span>  QSqlError <a class="code" href="class_o_p_l_1_1_database.html#aa5b783822a603bdcfd1d8c93ba0af34b">lastError</a>;</div>
- <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  </div>
- <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a15dbcef162931776a0bdf6610fdd4cde">connect</a>();</div>
- <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  </div>
- <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordtype">void</span> <a class="code" href="class_o_p_l_1_1_database.html#aceb1bb497d30d413f87d6541716a873b">disconnect</a>();</div>
- <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  </div>
- <div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordtype">void</span> <a class="code" href="class_o_p_l_1_1_database.html#a55a01dac1e447f7c41474a39d8f621ef">updateLayout</a>();</div>
- <div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div>
- <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keyword">const</span> QString <a class="code" href="class_o_p_l_1_1_database.html#a6df6e6b98679011f747862ca48a3498c">version</a>() <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  </div>
- <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keyword">const</span> QString <a class="code" href="class_o_p_l_1_1_database.html#a0b20bec0f8bef0277325492a1dee33ef">sqliteVersion</a>() <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  </div>
- <div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keyword">const</span> QStringList <a class="code" href="class_o_p_l_1_1_database.html#a9d09969956b08b86bf83277872354247">getTableNames</a>() <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  </div>
- <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keyword">const</span> QStringList <a class="code" href="class_o_p_l_1_1_database.html#ac5b344097eeb2579da9bcfc7941d074c">getTableColumns</a>(<a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table_name) <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  </div>
- <div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keyword">static</span> QSqlDatabase <a class="code" href="class_o_p_l_1_1_database.html#a233943791f4bca3aa083f46562eb6d50">database</a>();</div>
- <div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  </div>
- <div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  QVector<QVariant> <a class="code" href="class_o_p_l_1_1_database.html#abf45cf7ba5d25bb5d8f8aac1105bb728">customQuery</a>(QString statement, <span class="keywordtype">int</span> return_values);</div>
- <div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  </div>
- <div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a69f4a4fa1e496e86224e87612edba548">exists</a>(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_row.html">OPL::Row</a> &row);</div>
- <div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  </div>
- <div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#aa342b9d852daecb85fb77ec2f19234a5">clear</a>();</div>
- <div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  </div>
- <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#ad9aab9c8bc43009bbc2595409004e20b">commit</a>(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_row.html">OPL::Row</a> &row);</div>
- <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  </div>
- <div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#ad9aab9c8bc43009bbc2595409004e20b">commit</a>(<span class="keyword">const</span> QJsonArray &json_arr, <span class="keyword">const</span> <a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table);</div>
- <div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  </div>
- <div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#aa3bbfc0dd7ff7bd34c2c1c847f539168">insert</a>(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_row.html">OPL::Row</a> &new_row);</div>
- <div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  </div>
- <div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a4938319e593b9e5d5a334f794301d873">update</a>(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_row.html">OPL::Row</a> &updated_row);</div>
- <div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  </div>
- <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a29362ea9a2b1805d42e5ef7823c42e50">remove</a>(<span class="keyword">const</span> <a class="code" href="class_o_p_l_1_1_row.html">OPL::Row</a> &row);</div>
- <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  </div>
- <div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a6c2ebefc6cf6d948d64dfe71bec08540">removeMany</a>(<a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table, <span class="keyword">const</span> QList<int> &row_id_list);</div>
- <div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  </div>
- <div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="class_o_p_l_1_1_row.html">OPL::Row</a> <a class="code" href="class_o_p_l_1_1_database.html#ae38dc30cb955ffc0e3235e51104dd912">getRow</a>(<span class="keyword">const</span> <a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table, <span class="keyword">const</span> <span class="keywordtype">int</span> row_id);</div>
- <div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  </div>
- <div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  RowData_T <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(<span class="keyword">const</span> <a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table, <span class="keyword">const</span> <span class="keywordtype">int</span> row_id);</div>
- <div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  </div>
- <div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a2834aeb5c47bde300c898021eb9bbc48"> 206</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_pilot_entry.html">OPL::PilotEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#a2834aeb5c47bde300c898021eb9bbc48">getPilotEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  {</div>
- <div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Pilots, row_id);</div>
- <div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_pilot_entry.html">OPL::PilotEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  }</div>
- <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  </div>
- <div class="line"><a name="l00215"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a95340bb482ca788e748a597d013424ea"> 215</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_tail_entry.html">OPL::TailEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#a95340bb482ca788e748a597d013424ea">getTailEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  {</div>
- <div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Tails, row_id);</div>
- <div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_tail_entry.html">OPL::TailEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  }</div>
- <div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  </div>
- <div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a84b40aff7668c0782ae25a8d07f60922"> 224</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_aircraft_entry.html">OPL::AircraftEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#a84b40aff7668c0782ae25a8d07f60922">getAircraftEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  {</div>
- <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Aircraft, row_id);</div>
- <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_aircraft_entry.html">OPL::AircraftEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  }</div>
- <div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  </div>
- <div class="line"><a name="l00233"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a568d32e69f438bc165a2a9c1477eaaed"> 233</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_flight_entry.html">OPL::FlightEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#a568d32e69f438bc165a2a9c1477eaaed">getFlightEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  {</div>
- <div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Flights, row_id);</div>
- <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_flight_entry.html">OPL::FlightEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  }</div>
- <div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  </div>
- <div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a9e7e61e354d4438dab48a39fb6de1777"> 242</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_simulator_entry.html">OPL::SimulatorEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#a9e7e61e354d4438dab48a39fb6de1777">getSimEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  {</div>
- <div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Simulators, row_id);</div>
- <div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_simulator_entry.html">OPL::SimulatorEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  }</div>
- <div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  </div>
- <div class="line"><a name="l00251"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#affb40bf4566d45bdf2a68203b53be4db"> 251</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_currency_entry.html">OPL::CurrencyEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#affb40bf4566d45bdf2a68203b53be4db">getCurrencyEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  {</div>
- <div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Currencies, row_id);</div>
- <div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_currency_entry.html">OPL::CurrencyEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  }</div>
- <div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  </div>
- <div class="line"><a name="l00260"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a56ae415d548dca9c6ab3cc0fe0bc818d"> 260</a></span>  <span class="keyword">inline</span> <a class="code" href="class_o_p_l_1_1_airport_entry.html">OPL::AirportEntry</a> <a class="code" href="class_o_p_l_1_1_database.html#a56ae415d548dca9c6ab3cc0fe0bc818d">getAirportEntry</a>(<span class="keywordtype">int</span> row_id)</div>
- <div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  {</div>
- <div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keyword">const</span> <span class="keyword">auto</span> data = <a class="code" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a>(OPL::DbTable::Airports, row_id);</div>
- <div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordflow">return</span> <a class="code" href="class_o_p_l_1_1_airport_entry.html">OPL::AirportEntry</a>(row_id, data);</div>
- <div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  }</div>
- <div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  </div>
- <div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordtype">int</span> <a class="code" href="class_o_p_l_1_1_database.html#aebf3371c149463c49e818999c427ce6a">getLastEntry</a>(<a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table);</div>
- <div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  </div>
- <div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  QList<int> <a class="code" href="class_o_p_l_1_1_database.html#a4eb45d764952d44a3c45f16aea2e26d7">getForeignKeyConstraints</a>(<span class="keywordtype">int</span> foreign_row_id, <a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table);</div>
- <div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  </div>
- <div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  QVector<RowData_T> <a class="code" href="class_o_p_l_1_1_database.html#a8145a21f5980cb3c55778fbe94ef52a0">getTable</a>(<a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table);</div>
- <div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  </div>
- <div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="keyword">const</span> QList<OPL::DbTable> &<a class="code" href="class_o_p_l_1_1_database.html#ac0db9f1a1817bb62302b17a22327bfeb">getUserTables</a>() <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  </div>
- <div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keyword">const</span> QList<OPL::DbTable> &<a class="code" href="class_o_p_l_1_1_database.html#ad7cd939e58af8f1fd46f835ee34567e3">getTemplateTables</a>() <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  </div>
- <div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="comment">// Maintenance and setup</span></div>
- <div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  </div>
- <div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a92c22cb18c5a23858edd38e0ed9d7117">createSchema</a>();</div>
- <div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a4be4811cb27c836070a6b8c09dee6a3b">importTemplateData</a>(<span class="keywordtype">bool</span> use_local_ressources);</div>
- <div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  </div>
- <div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a63af56a9fbd8cd0290494cc28d327824">resetUserData</a>();</div>
- <div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  </div>
- <div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a40cdc1cce81919c42f91e2e16a63df4a">createBackup</a>(<span class="keyword">const</span> QString& dest_file);</div>
- <div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  </div>
- <div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordtype">bool</span> <a class="code" href="class_o_p_l_1_1_database.html#a77003350c44e7c6e1c8c4316cc324496">restoreBackup</a>(<span class="keyword">const</span> QString& backup_file);</div>
- <div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  </div>
- <div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  </div>
- <div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  </div>
- <div class="line"><a name="l00332"></a><span class="lineno"> 332</span> signals:</div>
- <div class="line"><a name="l00339"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#a8e99ff7cf4173ca1a87ede9acc02be00"> 339</a></span>  <span class="keywordtype">void</span> <a class="code" href="class_o_p_l_1_1_database.html#a8e99ff7cf4173ca1a87ede9acc02be00">dataBaseUpdated</a>(<span class="keyword">const</span> <a class="code" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">DbTable</a> table);</div>
- <div class="line"><a name="l00344"></a><span class="lineno"><a class="line" href="class_o_p_l_1_1_database.html#acc87b25e9ab6a6a6dce1883821292882"> 344</a></span>  <span class="keywordtype">void</span> <a class="code" href="class_o_p_l_1_1_database.html#acc87b25e9ab6a6a6dce1883821292882">connectionReset</a>();</div>
- <div class="line"><a name="l00345"></a><span class="lineno"> 345</span> };</div>
- <div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  </div>
- <div class="line"><a name="l00347"></a><span class="lineno"> 347</span> } <span class="comment">// namespace OPL</span></div>
- <div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  </div>
- <div class="line"><a name="l00349"></a><span class="lineno"> 349</span> <span class="preprocessor">#endif </span><span class="comment">// DATABASE_H</span></div>
- <div class="ttc" id="aclass_o_p_l_1_1_aircraft_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_aircraft_entry.html">OPL::AircraftEntry</a></div><div class="ttdoc">A Row representing an Aircraft entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:85</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_airport_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_airport_entry.html">OPL::AirportEntry</a></div><div class="ttdoc">A Row representing an Airport entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:155</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_currency_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_currency_entry.html">OPL::CurrencyEntry</a></div><div class="ttdoc">A Row representing a Currency entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:144</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html"><div class="ttname"><a href="class_o_p_l_1_1_database.html">OPL::Database</a></div><div class="ttdoc">The DB class encapsulates the SQL database by providing fast access to hot database data.</div><div class="ttdef"><b>Definition:</b> database.h:57</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a0b20bec0f8bef0277325492a1dee33ef"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a0b20bec0f8bef0277325492a1dee33ef">OPL::Database::sqliteVersion</a></div><div class="ttdeci">const QString sqliteVersion() const</div><div class="ttdoc">Database::sqliteVersion returns the database sqlite version. See also dbRevision()</div><div class="ttdef"><b>Definition:</b> database.cpp:117</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a15dbcef162931776a0bdf6610fdd4cde"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a15dbcef162931776a0bdf6610fdd4cde">OPL::Database::connect</a></div><div class="ttdeci">bool connect()</div><div class="ttdoc">Connect to the database and populate database information.</div><div class="ttdef"><b>Definition:</b> database.cpp:26</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a233943791f4bca3aa083f46562eb6d50"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a233943791f4bca3aa083f46562eb6d50">OPL::Database::database</a></div><div class="ttdeci">static QSqlDatabase database()</div><div class="ttdoc">Can be used to access the database connection.</div><div class="ttdef"><b>Definition:</b> database.cpp:126</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a2834aeb5c47bde300c898021eb9bbc48"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a2834aeb5c47bde300c898021eb9bbc48">OPL::Database::getPilotEntry</a></div><div class="ttdeci">OPL::PilotEntry getPilotEntry(int row_id)</div><div class="ttdoc">retreives a PilotEntry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:206</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a29362ea9a2b1805d42e5ef7823c42e50"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a29362ea9a2b1805d42e5ef7823c42e50">OPL::Database::remove</a></div><div class="ttdeci">bool remove(const OPL::Row &row)</div><div class="ttdoc">deletes an entry from the database.</div><div class="ttdef"><b>Definition:</b> database.cpp:186</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a3657d55721b0d3599ce6df55120017de"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">OPL::Database::getRowData</a></div><div class="ttdeci">RowData_T getRowData(const OPL::DbTable table, const int row_id)</div><div class="ttdoc">retreive a Map of <column name, column content> for a specific row in the database.</div><div class="ttdef"><b>Definition:</b> database.cpp:427</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a40cdc1cce81919c42f91e2e16a63df4a"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a40cdc1cce81919c42f91e2e16a63df4a">OPL::Database::createBackup</a></div><div class="ttdeci">bool createBackup(const QString &dest_file)</div><div class="ttdoc">Database::createBackup copies the currently used database to an external backup location provided by ...</div><div class="ttdef"><b>Definition:</b> database.cpp:582</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a4938319e593b9e5d5a334f794301d873"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a4938319e593b9e5d5a334f794301d873">OPL::Database::update</a></div><div class="ttdeci">bool update(const OPL::Row &updated_row)</div><div class="ttdoc">Updates entry in database from existing entry tweaked by the user.</div><div class="ttdef"><b>Definition:</b> database.cpp:303</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a4be4811cb27c836070a6b8c09dee6a3b"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a4be4811cb27c836070a6b8c09dee6a3b">OPL::Database::importTemplateData</a></div><div class="ttdeci">bool importTemplateData(bool use_local_ressources)</div><div class="ttdoc">importTemplateData fills an empty database with the template data (Aircraft, Airports,...</div><div class="ttdef"><b>Definition:</b> database.cpp:666</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a4eb45d764952d44a3c45f16aea2e26d7"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a4eb45d764952d44a3c45f16aea2e26d7">OPL::Database::getForeignKeyConstraints</a></div><div class="ttdeci">QList< int > getForeignKeyConstraints(int foreign_row_id, OPL::DbTable table)</div><div class="ttdoc">returns a list of ROWID's in the flights table for which foreign key constraints exist.</div><div class="ttdef"><b>Definition:</b> database.cpp:472</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a55a01dac1e447f7c41474a39d8f621ef"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a55a01dac1e447f7c41474a39d8f621ef">OPL::Database::updateLayout</a></div><div class="ttdeci">void updateLayout()</div><div class="ttdoc">Updates the member variables tableNames and tableColumns with up-to-date layout information if the da...</div><div class="ttdef"><b>Definition:</b> database.cpp:92</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a568d32e69f438bc165a2a9c1477eaaed"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a568d32e69f438bc165a2a9c1477eaaed">OPL::Database::getFlightEntry</a></div><div class="ttdeci">OPL::FlightEntry getFlightEntry(int row_id)</div><div class="ttdoc">retreives a flight entry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:233</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a56ae415d548dca9c6ab3cc0fe0bc818d"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a56ae415d548dca9c6ab3cc0fe0bc818d">OPL::Database::getAirportEntry</a></div><div class="ttdeci">OPL::AirportEntry getAirportEntry(int row_id)</div><div class="ttdoc">Retreives an airport entry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:260</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a63af56a9fbd8cd0290494cc28d327824"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a63af56a9fbd8cd0290494cc28d327824">OPL::Database::resetUserData</a></div><div class="ttdeci">bool resetUserData()</div><div class="ttdoc">Delete all rows from the user data tables (flights, pliots, tails)</div><div class="ttdef"><b>Definition:</b> database.cpp:706</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a69f4a4fa1e496e86224e87612edba548"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a69f4a4fa1e496e86224e87612edba548">OPL::Database::exists</a></div><div class="ttdeci">bool exists(const OPL::Row &row)</div><div class="ttdoc">Checks if an entry exists in the database, based on position data.</div><div class="ttdef"><b>Definition:</b> database.cpp:259</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a6c2ebefc6cf6d948d64dfe71bec08540"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a6c2ebefc6cf6d948d64dfe71bec08540">OPL::Database::removeMany</a></div><div class="ttdeci">bool removeMany(OPL::DbTable table, const QList< int > &row_id_list)</div><div class="ttdoc">deletes a batch of entries from the database. Optimised for speed when deleting many entries....</div><div class="ttdef"><b>Definition:</b> database.cpp:217</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a6df6e6b98679011f747862ca48a3498c"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a6df6e6b98679011f747862ca48a3498c">OPL::Database::version</a></div><div class="ttdeci">const QString version() const</div><div class="ttdoc">Return the database revision number (not the sqlite version number).</div><div class="ttdef"><b>Definition:</b> database.cpp:65</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a77003350c44e7c6e1c8c4316cc324496"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a77003350c44e7c6e1c8c4316cc324496">OPL::Database::restoreBackup</a></div><div class="ttdeci">bool restoreBackup(const QString &backup_file)</div><div class="ttdoc">Database::restoreBackup restores the database from a given backup file and replaces the currently act...</div><div class="ttdef"><b>Definition:</b> database.cpp:600</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a8145a21f5980cb3c55778fbe94ef52a0"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a8145a21f5980cb3c55778fbe94ef52a0">OPL::Database::getTable</a></div><div class="ttdeci">QVector< RowData_T > getTable(OPL::DbTable table)</div><div class="ttdoc">getTable returns all contents of a given table from the database</div><div class="ttdef"><b>Definition:</b> database.cpp:537</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a84b40aff7668c0782ae25a8d07f60922"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a84b40aff7668c0782ae25a8d07f60922">OPL::Database::getAircraftEntry</a></div><div class="ttdeci">OPL::AircraftEntry getAircraftEntry(int row_id)</div><div class="ttdoc">retreives a TailEntry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:224</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a8e99ff7cf4173ca1a87ede9acc02be00"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a8e99ff7cf4173ca1a87ede9acc02be00">OPL::Database::dataBaseUpdated</a></div><div class="ttdeci">void dataBaseUpdated(const DbTable table)</div><div class="ttdoc">updated is emitted whenever the database contents have been updated. This can be either a commit,...</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a92c22cb18c5a23858edd38e0ed9d7117"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a92c22cb18c5a23858edd38e0ed9d7117">OPL::Database::createSchema</a></div><div class="ttdeci">bool createSchema()</div><div class="ttdoc">Create or restore the database to its ready-to-use but empty state.</div><div class="ttdef"><b>Definition:</b> database.cpp:631</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a95340bb482ca788e748a597d013424ea"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a95340bb482ca788e748a597d013424ea">OPL::Database::getTailEntry</a></div><div class="ttdeci">OPL::TailEntry getTailEntry(int row_id)</div><div class="ttdoc">retreives a TailEntry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:215</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a9d09969956b08b86bf83277872354247"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a9d09969956b08b86bf83277872354247">OPL::Database::getTableNames</a></div><div class="ttdeci">const QStringList getTableNames() const</div><div class="ttdoc">Return the names of all tables in the database.</div><div class="ttdef"><b>Definition:</b> database.cpp:87</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_a9e7e61e354d4438dab48a39fb6de1777"><div class="ttname"><a href="class_o_p_l_1_1_database.html#a9e7e61e354d4438dab48a39fb6de1777">OPL::Database::getSimEntry</a></div><div class="ttdeci">OPL::SimulatorEntry getSimEntry(int row_id)</div><div class="ttdoc">retreives a Simulator entry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:242</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_aa342b9d852daecb85fb77ec2f19234a5"><div class="ttname"><a href="class_o_p_l_1_1_database.html#aa342b9d852daecb85fb77ec2f19234a5">OPL::Database::clear</a></div><div class="ttdeci">bool clear()</div><div class="ttdoc">clear resets the database, i.e. deletes all content in the tables containing userdata (pilots,...</div><div class="ttdef"><b>Definition:</b> database.cpp:288</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_aa3bbfc0dd7ff7bd34c2c1c847f539168"><div class="ttname"><a href="class_o_p_l_1_1_database.html#aa3bbfc0dd7ff7bd34c2c1c847f539168">OPL::Database::insert</a></div><div class="ttdeci">bool insert(const OPL::Row &new_row)</div><div class="ttdoc">Create new entry in the databse based on UserInput.</div><div class="ttdef"><b>Definition:</b> database.cpp:346</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_aa5b783822a603bdcfd1d8c93ba0af34b"><div class="ttname"><a href="class_o_p_l_1_1_database.html#aa5b783822a603bdcfd1d8c93ba0af34b">OPL::Database::lastError</a></div><div class="ttdeci">QSqlError lastError</div><div class="ttdoc">Holds information about the last error that ocurred during a SQL operation. If the error type is QSql...</div><div class="ttdef"><b>Definition:</b> database.h:96</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_abf45cf7ba5d25bb5d8f8aac1105bb728"><div class="ttname"><a href="class_o_p_l_1_1_database.html#abf45cf7ba5d25bb5d8f8aac1105bb728">OPL::Database::customQuery</a></div><div class="ttdeci">QVector< QVariant > customQuery(QString statement, int return_values)</div><div class="ttdoc">Can be used to send a complex query to the database.</div><div class="ttdef"><b>Definition:</b> database.cpp:509</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_ac0db9f1a1817bb62302b17a22327bfeb"><div class="ttname"><a href="class_o_p_l_1_1_database.html#ac0db9f1a1817bb62302b17a22327bfeb">OPL::Database::getUserTables</a></div><div class="ttdeci">const QList< OPL::DbTable > & getUserTables() const</div><div class="ttdoc">getUserTables returns a list of the of the tables that contain user-created data (flights,...</div><div class="ttdef"><b>Definition:</b> database.cpp:77</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_ac5b344097eeb2579da9bcfc7941d074c"><div class="ttname"><a href="class_o_p_l_1_1_database.html#ac5b344097eeb2579da9bcfc7941d074c">OPL::Database::getTableColumns</a></div><div class="ttdeci">const QStringList getTableColumns(OPL::DbTable table_name) const</div><div class="ttdoc">Return the names of a given table in the database.</div><div class="ttdef"><b>Definition:</b> database.cpp:82</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_acc87b25e9ab6a6a6dce1883821292882"><div class="ttname"><a href="class_o_p_l_1_1_database.html#acc87b25e9ab6a6a6dce1883821292882">OPL::Database::connectionReset</a></div><div class="ttdeci">void connectionReset()</div><div class="ttdoc">connectionReset is emitted whenever the database connection is reset, for example when creating or re...</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_aceb1bb497d30d413f87d6541716a873b"><div class="ttname"><a href="class_o_p_l_1_1_database.html#aceb1bb497d30d413f87d6541716a873b">OPL::Database::disconnect</a></div><div class="ttdeci">void disconnect()</div><div class="ttdoc">closes the database connection.</div><div class="ttdef"><b>Definition:</b> database.cpp:53</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_ad7cd939e58af8f1fd46f835ee34567e3"><div class="ttname"><a href="class_o_p_l_1_1_database.html#ad7cd939e58af8f1fd46f835ee34567e3">OPL::Database::getTemplateTables</a></div><div class="ttdeci">const QList< OPL::DbTable > & getTemplateTables() const</div><div class="ttdoc">getTemplateTables returns a list of the tables that contain template data (aiports,...</div><div class="ttdef"><b>Definition:</b> database.cpp:72</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_ad9aab9c8bc43009bbc2595409004e20b"><div class="ttname"><a href="class_o_p_l_1_1_database.html#ad9aab9c8bc43009bbc2595409004e20b">OPL::Database::commit</a></div><div class="ttdeci">bool commit(const OPL::Row &row)</div><div class="ttdoc">commits an entry to the database, calls either insert or update, based on position data</div><div class="ttdef"><b>Definition:</b> database.cpp:131</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_ae38dc30cb955ffc0e3235e51104dd912"><div class="ttname"><a href="class_o_p_l_1_1_database.html#ae38dc30cb955ffc0e3235e51104dd912">OPL::Database::getRow</a></div><div class="ttdeci">OPL::Row getRow(const OPL::DbTable table, const int row_id)</div><div class="ttdoc">retreive a Row from the database</div><div class="ttdef"><b>Definition:</b> database.cpp:395</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_aebf3371c149463c49e818999c427ce6a"><div class="ttname"><a href="class_o_p_l_1_1_database.html#aebf3371c149463c49e818999c427ce6a">OPL::Database::getLastEntry</a></div><div class="ttdeci">int getLastEntry(OPL::DbTable table)</div><div class="ttdoc">returns the ROWID for the newest entry in the respective table.</div><div class="ttdef"><b>Definition:</b> database.cpp:459</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_database_html_affb40bf4566d45bdf2a68203b53be4db"><div class="ttname"><a href="class_o_p_l_1_1_database.html#affb40bf4566d45bdf2a68203b53be4db">OPL::Database::getCurrencyEntry</a></div><div class="ttdeci">OPL::CurrencyEntry getCurrencyEntry(int row_id)</div><div class="ttdoc">Retreives a currency entry from the database. See row class for details.</div><div class="ttdef"><b>Definition:</b> database.h:251</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_flight_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_flight_entry.html">OPL::FlightEntry</a></div><div class="ttdoc">A Row representing a Flight entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:133</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_paths_html_a1636e1c04163319f63f56868142f1d1f"><div class="ttname"><a href="class_o_p_l_1_1_paths.html#a1636e1c04163319f63f56868142f1d1f">OPL::Paths::databaseFileInfo</a></div><div class="ttdeci">static const QFileInfo databaseFileInfo()</div><div class="ttdoc">returns a QFileInfo for the default database file.</div><div class="ttdef"><b>Definition:</b> paths.cpp:39</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_pilot_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_pilot_entry.html">OPL::PilotEntry</a></div><div class="ttdoc">A Row representing a Pilot entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:110</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_row_html"><div class="ttname"><a href="class_o_p_l_1_1_row.html">OPL::Row</a></div><div class="ttdoc">The Row class provides an interface for retreiving and submitting entries from the database.</div><div class="ttdef"><b>Definition:</b> row.h:46</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_simulator_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_simulator_entry.html">OPL::SimulatorEntry</a></div><div class="ttdoc">A Row representing a Simulator entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:122</div></div>
- <div class="ttc" id="aclass_o_p_l_1_1_tail_entry_html"><div class="ttname"><a href="class_o_p_l_1_1_tail_entry.html">OPL::TailEntry</a></div><div class="ttdoc">A Row representing a Tail (Registration) entry. See Row class for details.</div><div class="ttdef"><b>Definition:</b> row.h:96</div></div>
- <div class="ttc" id="anamespace_o_p_l_html"><div class="ttname"><a href="namespace_o_p_l.html">OPL</a></div><div class="ttdoc">A namespace to collect constants and enums used throughout the application.</div><div class="ttdef"><b>Definition:</b> paths.cpp:3</div></div>
- <div class="ttc" id="anamespace_o_p_l_html_ada86eb02cea54d91c8c11c9112ec1cf7"><div class="ttname"><a href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a></div><div class="ttdeci">DbTable</div><div class="ttdoc">Enumerates the tables in the database.</div><div class="ttdef"><b>Definition:</b> opl.h:122</div></div>
- </div><!-- fragment --></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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_803ee67260c130b45d29089798491ab2.html">database</a></li><li class="navelem"><b>database.h</b></li>
- <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
- </ul>
- </div>
- </body>
- </html>
|