cstlcompilerif.h 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Copyright 2017 Herik Lima de Castro and Marcelo Medeiros Eler
  3. Distributed under MIT license, or public domain if desired and
  4. recognized in your jurisdiction.
  5. See file LICENSE for detail.
  6. */
  7. #ifndef CSTLCOMPILERIF_H
  8. #define CSTLCOMPILERIF_H
  9. #include <QMap>
  10. #include <QXmlStreamAttributes>
  11. #include "cppwebframework_global.h"
  12. CWF_BEGIN_NAMESPACE
  13. enum class RelationalOperator : char {
  14. EQUAL,
  15. DIFFERENT,
  16. GREATER,
  17. GREATER_EQUAL,
  18. LESS,
  19. LESS_EQUAL,
  20. ERROR
  21. };
  22. /**
  23. * @brief Extracts and valites all attibutes from a "if" tag.
  24. */
  25. class CPPWEBFRAMEWORKSHARED_EXPORT CSTLCompilerIf
  26. {
  27. public:
  28. RelationalOperator relationalOperator;
  29. bool isNumber = false;
  30. QMap<QString, QString> attributes;
  31. /**
  32. * @brief This constructor processes and validates the attributes of "if" tag.
  33. * @param const QXmlStreamAttributes &attr : XML tag attributes.
  34. */
  35. explicit CSTLCompilerIf(const QXmlStreamAttributes &attr);
  36. };
  37. CWF_END_NAMESPACE
  38. #endif // CSTLCOMPILERIF_H