database_8h.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.10"/>
  7. <title>CoffeePi: database.h File Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td id="projectalign" style="padding-left: 0.5em;">
  26. <div id="projectname">CoffeePi
  27. </div>
  28. <div id="projectbrief">Coffee machine control for Raspberry Pi</div>
  29. </td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </div>
  34. <!-- end header part -->
  35. <!-- Generated by Doxygen 1.8.10 -->
  36. <script type="text/javascript">
  37. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  38. </script>
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  43. <li class="current"><a href="files.html"><span>Files</span></a></li>
  44. <li>
  45. <div id="MSearchBox" class="MSearchBoxInactive">
  46. <span class="left">
  47. <img id="MSearchSelect" src="search/mag_sel.png"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. alt=""/>
  51. <input type="text" id="MSearchField" value="Search" accesskey="S"
  52. onfocus="searchBox.OnSearchFieldFocus(true)"
  53. onblur="searchBox.OnSearchFieldFocus(false)"
  54. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  55. </span><span class="right">
  56. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  57. </span>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. <div id="navrow2" class="tabs2">
  63. <ul class="tablist">
  64. <li><a href="files.html"><span>File&#160;List</span></a></li>
  65. <li><a href="globals.html"><span>Globals</span></a></li>
  66. </ul>
  67. </div>
  68. <!-- window showing the filter options -->
  69. <div id="MSearchSelectWindow"
  70. onmouseover="return searchBox.OnSearchSelectShow()"
  71. onmouseout="return searchBox.OnSearchSelectHide()"
  72. onkeydown="return searchBox.OnSearchSelectKey(event)">
  73. </div>
  74. <!-- iframe showing the search results (closed by default) -->
  75. <div id="MSearchResultsWindow">
  76. <iframe src="javascript:void(0)" frameborder="0"
  77. name="MSearchResults" id="MSearchResults">
  78. </iframe>
  79. </div>
  80. </div><!-- top -->
  81. <div class="header">
  82. <div class="summary">
  83. <a href="#enum-members">Enumerations</a> &#124;
  84. <a href="#func-members">Functions</a> </div>
  85. <div class="headertitle">
  86. <div class="title">database.h File Reference</div> </div>
  87. </div><!--header-->
  88. <div class="contents">
  89. <div class="textblock"><code>#include &lt;string&gt;</code><br />
  90. <code>#include &lt;stdexcept&gt;</code><br />
  91. <code>#include &lt;cstdio&gt;</code><br />
  92. <code>#include &lt;stdlib.h&gt;</code><br />
  93. <code>#include &lt;inttypes.h&gt;</code><br />
  94. <code>#include &lt;cstdarg&gt;</code><br />
  95. <code>#include &quot;sqlite/sqlite3.h&quot;</code><br />
  96. </div>
  97. <p><a href="database_8h_source.html">Go to the source code of this file.</a></p>
  98. <table class="memberdecls">
  99. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
  100. Enumerations</h2></td></tr>
  101. <tr class="memitem:ae1822373f950fb4881633b7ec843f4df"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4df">config_key_t</a> { <a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4dfa4be4c7f723934d3333a26575662e916e">CFGbrewcounter</a> = 1,
  102. <a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4dfa3c1d629019edc36dce2a7852d3d65968">CFGHeatingTime</a> = 2,
  103. <a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4dfab9f0f19359d390e5602d46e39949ede4">CFGdisplaylang</a> = 3
  104. }<tr class="separator:ae1822373f950fb4881633b7ec843f4df"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. </td></tr>
  106. </table><table class="memberdecls">
  107. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  108. Functions</h2></td></tr>
  109. <tr class="memitem:a1885a74e6af3ee510f30f98e60372e3e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a1885a74e6af3ee510f30f98e60372e3e">sqlOpen</a> ()</td></tr>
  110. <tr class="memdesc:a1885a74e6af3ee510f30f98e60372e3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens and initializes a sqlite3 database connection. <a href="#a1885a74e6af3ee510f30f98e60372e3e">More...</a><br /></td></tr>
  111. <tr class="separator:a1885a74e6af3ee510f30f98e60372e3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  112. <tr class="memitem:a7264f51f982e908b32635e91e6dc0062"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a7264f51f982e908b32635e91e6dc0062">sqlClose</a> ()</td></tr>
  113. <tr class="memdesc:a7264f51f982e908b32635e91e6dc0062"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the database connection. <a href="#a7264f51f982e908b32635e91e6dc0062">More...</a><br /></td></tr>
  114. <tr class="separator:a7264f51f982e908b32635e91e6dc0062"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <tr class="memitem:aaed3fb776c9dc76d262df026803d3b8c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#aaed3fb776c9dc76d262df026803d3b8c">sqlSetup</a> ()</td></tr>
  116. <tr class="memdesc:aaed3fb776c9dc76d262df026803d3b8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets up the database and creates the needed structure. <a href="#aaed3fb776c9dc76d262df026803d3b8c">More...</a><br /></td></tr>
  117. <tr class="separator:aaed3fb776c9dc76d262df026803d3b8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  118. <tr class="memitem:afd88a963f835215b8dad9ee9e49866dc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#afd88a963f835215b8dad9ee9e49866dc">sqlExecute</a> (string query)</td></tr>
  119. <tr class="memdesc:afd88a963f835215b8dad9ee9e49866dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes a SQL statement. <a href="#afd88a963f835215b8dad9ee9e49866dc">More...</a><br /></td></tr>
  120. <tr class="separator:afd88a963f835215b8dad9ee9e49866dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:a437086982a7400d7205f3ab6600e6dcf"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a437086982a7400d7205f3ab6600e6dcf">inttochar</a> (uint8_t *guid)</td></tr>
  122. <tr class="memdesc:a437086982a7400d7205f3ab6600e6dcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts the GUID from int to char array. <a href="#a437086982a7400d7205f3ab6600e6dcf">More...</a><br /></td></tr>
  123. <tr class="separator:a437086982a7400d7205f3ab6600e6dcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  124. <tr class="memitem:ad2d2a73c367513b8b71aff5546276a3c"><td class="memItemLeft" align="right" valign="top">uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#ad2d2a73c367513b8b71aff5546276a3c">chartoint</a> (const unsigned char *guid)</td></tr>
  125. <tr class="memdesc:ad2d2a73c367513b8b71aff5546276a3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts the GUID from char to int array. <a href="#ad2d2a73c367513b8b71aff5546276a3c">More...</a><br /></td></tr>
  126. <tr class="separator:ad2d2a73c367513b8b71aff5546276a3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. <tr class="memitem:a28dbbb9e24e2035535645629105aea46"><td class="memItemLeft" align="right" valign="top">uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a28dbbb9e24e2035535645629105aea46">int64to8bit</a> (sqlite_int64 guid)</td></tr>
  128. <tr class="memdesc:a28dbbb9e24e2035535645629105aea46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts the GUID from int64 to int8 array. <a href="#a28dbbb9e24e2035535645629105aea46">More...</a><br /></td></tr>
  129. <tr class="separator:a28dbbb9e24e2035535645629105aea46"><td class="memSeparator" colspan="2">&#160;</td></tr>
  130. <tr class="memitem:a99cc529fd785c752cd4b73ea7989521d"><td class="memItemLeft" align="right" valign="top">sqlite_int64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a99cc529fd785c752cd4b73ea7989521d">int8to64bit</a> (uint8_t *guid)</td></tr>
  131. <tr class="separator:a99cc529fd785c752cd4b73ea7989521d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:a5d0363e5d886e2c3e4bb5ca46d265ba7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a5d0363e5d886e2c3e4bb5ca46d265ba7">sqltest</a> ()</td></tr>
  133. <tr class="separator:a5d0363e5d886e2c3e4bb5ca46d265ba7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  134. <tr class="memitem:a6c0bc3256310fd400a26243d8a8f1652"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a6c0bc3256310fd400a26243d8a8f1652">string_sprintf</a> (const char *format,...)</td></tr>
  135. <tr class="memdesc:a6c0bc3256310fd400a26243d8a8f1652"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allows the format of printf but returns a string Source: <a href="http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output">http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output</a>. <a href="#a6c0bc3256310fd400a26243d8a8f1652">More...</a><br /></td></tr>
  136. <tr class="separator:a6c0bc3256310fd400a26243d8a8f1652"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:aad0e803eda7a440a6063a447cfeca0cd"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#aad0e803eda7a440a6063a447cfeca0cd">sqlGetConf</a> (<a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4df">config_key_t</a> id)</td></tr>
  138. <tr class="memdesc:aad0e803eda7a440a6063a447cfeca0cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a configuration key from the database. <a href="#aad0e803eda7a440a6063a447cfeca0cd">More...</a><br /></td></tr>
  139. <tr class="separator:aad0e803eda7a440a6063a447cfeca0cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  140. <tr class="memitem:a1ce0ac0c58916c138a92d3282f569784"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="database_8h.html#a1ce0ac0c58916c138a92d3282f569784">sqlSetConf</a> (<a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4df">config_key_t</a> id, uint64_t value)</td></tr>
  141. <tr class="memdesc:a1ce0ac0c58916c138a92d3282f569784"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves a configuration key to the database. <a href="#a1ce0ac0c58916c138a92d3282f569784">More...</a><br /></td></tr>
  142. <tr class="separator:a1ce0ac0c58916c138a92d3282f569784"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. </table>
  144. <h2 class="groupheader">Enumeration Type Documentation</h2>
  145. <a class="anchor" id="ae1822373f950fb4881633b7ec843f4df"></a>
  146. <div class="memitem">
  147. <div class="memproto">
  148. <table class="memname">
  149. <tr>
  150. <td class="memname">enum <a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4df">config_key_t</a></td>
  151. </tr>
  152. </table>
  153. </div><div class="memdoc">
  154. <table class="fieldtable">
  155. <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ae1822373f950fb4881633b7ec843f4dfa4be4c7f723934d3333a26575662e916e"></a>CFGbrewcounter&#160;</td><td class="fielddoc">
  156. </td></tr>
  157. <tr><td class="fieldname"><a class="anchor" id="ae1822373f950fb4881633b7ec843f4dfa3c1d629019edc36dce2a7852d3d65968"></a>CFGHeatingTime&#160;</td><td class="fielddoc">
  158. </td></tr>
  159. <tr><td class="fieldname"><a class="anchor" id="ae1822373f950fb4881633b7ec843f4dfab9f0f19359d390e5602d46e39949ede4"></a>CFGdisplaylang&#160;</td><td class="fielddoc">
  160. </td></tr>
  161. </table>
  162. </div>
  163. </div>
  164. <h2 class="groupheader">Function Documentation</h2>
  165. <a class="anchor" id="ad2d2a73c367513b8b71aff5546276a3c"></a>
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">uint8_t* chartoint </td>
  171. <td>(</td>
  172. <td class="paramtype">const unsigned char *&#160;</td>
  173. <td class="paramname"><em>guid</em></td><td>)</td>
  174. <td></td>
  175. </tr>
  176. </table>
  177. </div><div class="memdoc">
  178. <p>Converts the GUID from char to int array. </p>
  179. <dl class="params"><dt>Parameters</dt><dd>
  180. <table class="params">
  181. <tr><td class="paramname">*guid</td><td>Pointer to the char GUID </td></tr>
  182. </table>
  183. </dd>
  184. </dl>
  185. <dl class="section return"><dt>Returns</dt><dd>pointer to the converted int array </dd></dl>
  186. </div>
  187. </div>
  188. <a class="anchor" id="a28dbbb9e24e2035535645629105aea46"></a>
  189. <div class="memitem">
  190. <div class="memproto">
  191. <table class="memname">
  192. <tr>
  193. <td class="memname">uint8_t* int64to8bit </td>
  194. <td>(</td>
  195. <td class="paramtype">sqlite_int64&#160;</td>
  196. <td class="paramname"><em>guid</em></td><td>)</td>
  197. <td></td>
  198. </tr>
  199. </table>
  200. </div><div class="memdoc">
  201. <p>Converts the GUID from int64 to int8 array. </p>
  202. <dl class="params"><dt>Parameters</dt><dd>
  203. <table class="params">
  204. <tr><td class="paramname">guid</td><td>64bit GUID </td></tr>
  205. </table>
  206. </dd>
  207. </dl>
  208. <dl class="section return"><dt>Returns</dt><dd>pointer to the converted int array </dd></dl>
  209. </div>
  210. </div>
  211. <a class="anchor" id="a99cc529fd785c752cd4b73ea7989521d"></a>
  212. <div class="memitem">
  213. <div class="memproto">
  214. <table class="memname">
  215. <tr>
  216. <td class="memname">sqlite_int64 int8to64bit </td>
  217. <td>(</td>
  218. <td class="paramtype">uint8_t *&#160;</td>
  219. <td class="paramname"><em>guid</em></td><td>)</td>
  220. <td></td>
  221. </tr>
  222. </table>
  223. </div><div class="memdoc">
  224. </div>
  225. </div>
  226. <a class="anchor" id="a437086982a7400d7205f3ab6600e6dcf"></a>
  227. <div class="memitem">
  228. <div class="memproto">
  229. <table class="memname">
  230. <tr>
  231. <td class="memname">char* inttochar </td>
  232. <td>(</td>
  233. <td class="paramtype">uint8_t *&#160;</td>
  234. <td class="paramname"><em>guid</em></td><td>)</td>
  235. <td></td>
  236. </tr>
  237. </table>
  238. </div><div class="memdoc">
  239. <p>Converts the GUID from int to char array. </p>
  240. <dl class="params"><dt>Parameters</dt><dd>
  241. <table class="params">
  242. <tr><td class="paramname">*guid</td><td>Pointer to the uint8_t GUID </td></tr>
  243. </table>
  244. </dd>
  245. </dl>
  246. <dl class="section return"><dt>Returns</dt><dd>pointer to the converted string </dd></dl>
  247. </div>
  248. </div>
  249. <a class="anchor" id="a7264f51f982e908b32635e91e6dc0062"></a>
  250. <div class="memitem">
  251. <div class="memproto">
  252. <table class="memname">
  253. <tr>
  254. <td class="memname">void sqlClose </td>
  255. <td>(</td>
  256. <td class="paramname"></td><td>)</td>
  257. <td></td>
  258. </tr>
  259. </table>
  260. </div><div class="memdoc">
  261. <p>Closes the database connection. </p>
  262. </div>
  263. </div>
  264. <a class="anchor" id="afd88a963f835215b8dad9ee9e49866dc"></a>
  265. <div class="memitem">
  266. <div class="memproto">
  267. <table class="memname">
  268. <tr>
  269. <td class="memname">int sqlExecute </td>
  270. <td>(</td>
  271. <td class="paramtype">string&#160;</td>
  272. <td class="paramname"><em>query</em></td><td>)</td>
  273. <td></td>
  274. </tr>
  275. </table>
  276. </div><div class="memdoc">
  277. <p>Executes a SQL statement. </p>
  278. <dl class="params"><dt>Parameters</dt><dd>
  279. <table class="params">
  280. <tr><td class="paramname">*query</td><td>SQL query string </td></tr>
  281. </table>
  282. </dd>
  283. </dl>
  284. <dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
  285. </div>
  286. </div>
  287. <a class="anchor" id="aad0e803eda7a440a6063a447cfeca0cd"></a>
  288. <div class="memitem">
  289. <div class="memproto">
  290. <table class="memname">
  291. <tr>
  292. <td class="memname">uint64_t sqlGetConf </td>
  293. <td>(</td>
  294. <td class="paramtype"><a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4df">config_key_t</a>&#160;</td>
  295. <td class="paramname"><em>id</em></td><td>)</td>
  296. <td></td>
  297. </tr>
  298. </table>
  299. </div><div class="memdoc">
  300. <p>Reads a configuration key from the database. </p>
  301. <dl class="params"><dt>Parameters</dt><dd>
  302. <table class="params">
  303. <tr><td class="paramname">id</td><td>Config ID key </td></tr>
  304. </table>
  305. </dd>
  306. </dl>
  307. <dl class="section return"><dt>Returns</dt><dd>value as integer (up to 64bit), 0 for not found </dd></dl>
  308. </div>
  309. </div>
  310. <a class="anchor" id="a1885a74e6af3ee510f30f98e60372e3e"></a>
  311. <div class="memitem">
  312. <div class="memproto">
  313. <table class="memname">
  314. <tr>
  315. <td class="memname">int sqlOpen </td>
  316. <td>(</td>
  317. <td class="paramname"></td><td>)</td>
  318. <td></td>
  319. </tr>
  320. </table>
  321. </div><div class="memdoc">
  322. <p>Opens and initializes a sqlite3 database connection. </p>
  323. <dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
  324. </div>
  325. </div>
  326. <a class="anchor" id="a1ce0ac0c58916c138a92d3282f569784"></a>
  327. <div class="memitem">
  328. <div class="memproto">
  329. <table class="memname">
  330. <tr>
  331. <td class="memname">int sqlSetConf </td>
  332. <td>(</td>
  333. <td class="paramtype"><a class="el" href="database_8h.html#ae1822373f950fb4881633b7ec843f4df">config_key_t</a>&#160;</td>
  334. <td class="paramname"><em>id</em>, </td>
  335. </tr>
  336. <tr>
  337. <td class="paramkey"></td>
  338. <td></td>
  339. <td class="paramtype">uint64_t&#160;</td>
  340. <td class="paramname"><em>value</em>&#160;</td>
  341. </tr>
  342. <tr>
  343. <td></td>
  344. <td>)</td>
  345. <td></td><td></td>
  346. </tr>
  347. </table>
  348. </div><div class="memdoc">
  349. <p>Saves a configuration key to the database. </p>
  350. <dl class="params"><dt>Parameters</dt><dd>
  351. <table class="params">
  352. <tr><td class="paramname">id</td><td>Config ID key </td></tr>
  353. <tr><td class="paramname">value</td><td>Integer value </td></tr>
  354. </table>
  355. </dd>
  356. </dl>
  357. <dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
  358. </div>
  359. </div>
  360. <a class="anchor" id="aaed3fb776c9dc76d262df026803d3b8c"></a>
  361. <div class="memitem">
  362. <div class="memproto">
  363. <table class="memname">
  364. <tr>
  365. <td class="memname">int sqlSetup </td>
  366. <td>(</td>
  367. <td class="paramname"></td><td>)</td>
  368. <td></td>
  369. </tr>
  370. </table>
  371. </div><div class="memdoc">
  372. <p>Sets up the database and creates the needed structure. </p>
  373. <dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
  374. </div>
  375. </div>
  376. <a class="anchor" id="a5d0363e5d886e2c3e4bb5ca46d265ba7"></a>
  377. <div class="memitem">
  378. <div class="memproto">
  379. <table class="memname">
  380. <tr>
  381. <td class="memname">void sqltest </td>
  382. <td>(</td>
  383. <td class="paramname"></td><td>)</td>
  384. <td></td>
  385. </tr>
  386. </table>
  387. </div><div class="memdoc">
  388. </div>
  389. </div>
  390. <a class="anchor" id="a6c0bc3256310fd400a26243d8a8f1652"></a>
  391. <div class="memitem">
  392. <div class="memproto">
  393. <table class="memname">
  394. <tr>
  395. <td class="memname">std::string string_sprintf </td>
  396. <td>(</td>
  397. <td class="paramtype">const char *&#160;</td>
  398. <td class="paramname"><em>format</em>, </td>
  399. </tr>
  400. <tr>
  401. <td class="paramkey"></td>
  402. <td></td>
  403. <td class="paramtype">&#160;</td>
  404. <td class="paramname"><em>...</em>&#160;</td>
  405. </tr>
  406. <tr>
  407. <td></td>
  408. <td>)</td>
  409. <td></td><td></td>
  410. </tr>
  411. </table>
  412. </div><div class="memdoc">
  413. <p>Allows the format of printf but returns a string Source: <a href="http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output">http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output</a>. </p>
  414. <dl class="section return"><dt>Returns</dt><dd>printf formatted string </dd></dl>
  415. <dl class="params"><dt>Parameters</dt><dd>
  416. <table class="params">
  417. <tr><td class="paramname">format</td><td>input string as char array </td></tr>
  418. </table>
  419. </dd>
  420. </dl>
  421. </div>
  422. </div>
  423. </div><!-- contents -->
  424. <!-- start footer part -->
  425. <hr class="footer"/><address class="footer"><small>
  426. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  427. <img class="footer" src="doxygen.png" alt="doxygen"/>
  428. </a> 1.8.10
  429. </small></address>
  430. </body>
  431. </html>