ADataBaseSetup.3 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. .TH "DataBaseSetup" 3 "Tue Jul 27 2021" "openPilotLog" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. DataBaseSetup \- The \fBDataBaseSetup\fP class is responsible for the inital setup of the database when the application is first launched\&. It creates the database in the specified default location and creates all required tables and views\&. It can also be used to reset the database currently used\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <databasesetup\&.h>\fP
  11. .SS "Static Public Member Functions"
  12. .in +1c
  13. .ti -1c
  14. .RI "static void \fBdebug\fP ()"
  15. .br
  16. .RI "dbSetup::debug prints Database Layout "
  17. .ti -1c
  18. .RI "static bool \fBcreateDatabase\fP ()"
  19. .br
  20. .ti -1c
  21. .RI "static bool \fBdownloadTemplates\fP ()"
  22. .br
  23. .ti -1c
  24. .RI "static bool \fBbackupOldData\fP ()"
  25. .br
  26. .ti -1c
  27. .RI "static bool \fBfillTemplates\fP ()"
  28. .br
  29. .ti -1c
  30. .RI "static bool \fBimportDefaultData\fP (bool use_local_data)"
  31. .br
  32. .ti -1c
  33. .RI "static bool \fBresetToDefault\fP ()"
  34. .br
  35. .RI "DbSetup::resetToDefault Empties all user-generated content in the database\&. "
  36. .ti -1c
  37. .RI "static bool \fBcommitData\fP (QVector< QStringList > from_csv, const QString &table_name)"
  38. .br
  39. .RI "DbSetup::commitData inserts the data parsed from a csv file into the database\&. The first line of the csv file has to contain the column names of the corresponding table in the database\&. "
  40. .ti -1c
  41. .RI "static bool \fBcommitDataJson\fP (const QJsonArray &json_arr, const QString &table_name)"
  42. .br
  43. .RI "commitDataJson Commits data read from a JSON array to the database\&. "
  44. .in -1c
  45. .SH "Detailed Description"
  46. .PP
  47. The \fBDataBaseSetup\fP class is responsible for the inital setup of the database when the application is first launched\&. It creates the database in the specified default location and creates all required tables and views\&. It can also be used to reset the database currently used\&.
  48. .SH "Member Function Documentation"
  49. .PP
  50. .SS "QT_DEPRECATED bool DataBaseSetup::commitData (QVector< QStringList > from_csv, const QString & table_name)\fC [static]\fP"
  51. .PP
  52. DbSetup::commitData inserts the data parsed from a csv file into the database\&. The first line of the csv file has to contain the column names of the corresponding table in the database\&.
  53. .PP
  54. \fBParameters\fP
  55. .RS 4
  56. \fIfromCSV\fP input as parsed from CSV::read()
  57. .br
  58. \fItableName\fP as in the database
  59. .RE
  60. .PP
  61. \fBReturns\fP
  62. .RS 4
  63. .RE
  64. .PP
  65. .SS "QT_DEPRECATED bool DataBaseSetup::commitDataJson (const QJsonArray & json_arr, const QString & table_name)\fC [static]\fP"
  66. .PP
  67. commitDataJson Commits data read from a JSON array to the database\&.
  68. .PP
  69. \fBParameters\fP
  70. .RS 4
  71. \fIjson_arr\fP
  72. .br
  73. \fItable_name\fP The table that will be written to
  74. .RE
  75. .PP
  76. .SS "QT_DEPRECATED bool DataBaseSetup::resetToDefault ()\fC [static]\fP"
  77. .PP
  78. DbSetup::resetToDefault Empties all user-generated content in the database\&.
  79. .PP
  80. \fBReturns\fP
  81. .RS 4
  82. true on success
  83. .RE
  84. .PP
  85. .SH "Author"
  86. .PP
  87. Generated automatically by Doxygen for openPilotLog from the source code\&.