dbvalidate.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. *openPilot Log - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020 Felix Turowsky
  4. *
  5. *This program is free software: you can redistribute it and/or modify
  6. *it under the terms of the GNU General Public License as published by
  7. *the Free Software Foundation, either version 3 of the License, or
  8. *(at your option) any later version.
  9. *
  10. *This program is distributed in the hope that it will be useful,
  11. *but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. *GNU General Public License for more details.
  14. *
  15. *You should have received a copy of the GNU General Public License
  16. *along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef DBVALIDATE_H
  19. #define DBVALIDATE_H
  20. #include <QCoreApplication>
  21. #include <QRegularExpression>
  22. /*!
  23. * \brief The dbValidate class provides functions providing validation functionality
  24. * for data entries. All return types are boolean (true = valid, false = invalid) and
  25. * all input types are QString.
  26. */
  27. class dbValidate
  28. {
  29. public:
  30. bool isValid;
  31. //dbValidate();
  32. //dbValidate(QString table, QString field, QString value);
  33. static bool verify_id(QString);
  34. static bool verify_doft(QString);
  35. static bool verify_dept(QString);
  36. static bool verify_dest(QString);
  37. static bool verify_tofb(QString);
  38. static bool verify_tonb(QString);
  39. static bool verify_pic(QString);
  40. static bool verify_acft(QString);
  41. static bool verify_tblk(QString);
  42. static bool verify_tSPSE(QString);
  43. static bool verify_tSPME(QString);
  44. static bool verify_tMP(QString);
  45. static bool verify_tNIGHT(QString);
  46. static bool verify_tIFR(QString);
  47. static bool verify_tPIC(QString);
  48. static bool verify_tPICUS(QString);
  49. static bool verify_tSIC(QString);
  50. static bool verify_tDual(QString);
  51. static bool verify_tFI(QString);
  52. static bool verify_tSIM(QString);
  53. static bool verify_pilotFlying(QString);
  54. static bool verify_toDay(QString);
  55. static bool verify_toNight(QString);
  56. static bool verify_ldgDay(QString);
  57. static bool verify_ldgNight(QString);
  58. static bool verify_autoland(QString);
  59. static bool verify_secondPilot(QString);
  60. static bool verify_thirdPilot(QString);
  61. static bool verify_FlightNumber(QString);
  62. static bool verify_Remarks(QString);
  63. static bool verify_time(QString time);
  64. };
  65. #endif // DBVALIDATE_H