AJson.3 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. .TH "AJson" 3 "Mon Jul 11 2022" "openPilotLog" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. AJson \- The AJSON class is responsible for parsing the database (sqlite) to and from JSON\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <ajson\&.h>\fP
  11. .SS "Public Member Functions"
  12. .in +1c
  13. .ti -1c
  14. .RI "\fBAJson\fP (QFileInfo database_file)"
  15. .br
  16. .in -1c
  17. .SS "Static Public Member Functions"
  18. .in +1c
  19. .ti -1c
  20. .RI "static void \fBexportDatabase\fP ()"
  21. .br
  22. .RI "exportDatabase exports the currently active database to JSON\&. "
  23. .ti -1c
  24. .RI "static void \fBimportDatabase\fP ()"
  25. .br
  26. .RI "importDatabase imports a dataset from JSON\&. Files need to be at AStanardPaths::JSON for now\&. "
  27. .ti -1c
  28. .RI "static QJsonDocument \fBreadFileToDoc\fP (const QString &file_path)"
  29. .br
  30. .RI "readToDocument reads data from a JSON file into a QJSonDocument "
  31. .ti -1c
  32. .RI "static void \fBwriteDocToFile\fP (const QJsonDocument &doc, const QString &file_name)"
  33. .br
  34. .RI "writes a QJsonDocument to a file "
  35. .in -1c
  36. .SH "Detailed Description"
  37. .PP
  38. The AJSON class is responsible for parsing the database (sqlite) to and from JSON\&.
  39. .SH "Member Function Documentation"
  40. .PP
  41. .SS "void AJson::exportDatabase ()\fC [static]\fP"
  42. .PP
  43. exportDatabase exports the currently active database to JSON\&. QJsonObject can be constructed from QHash<QString, QVariant> aka QVariantmap\&. All rows are put into a QJsonArray and the Array is embedded into a QJsonDocument, which can be exported\&. The files are created at AStandardPaths::JSON\&.
  44. .SS "QJsonDocument AJson::readFileToDoc (const QString & file_path)\fC [static]\fP"
  45. .PP
  46. readToDocument reads data from a JSON file into a QJSonDocument
  47. .PP
  48. \fBParameters\fP
  49. .RS 4
  50. \fIfile_path\fP
  51. .RE
  52. .PP
  53. .SH "Author"
  54. .PP
  55. Generated automatically by Doxygen for openPilotLog from the source code\&.