cstlcompilerattributes.h 998 B

12345678910111213141516171819202122232425262728293031323334
  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 CSTLCOMPILERATTRIBUTES_H
  8. #define CSTLCOMPILERATTRIBUTES_H
  9. #include <QMap>
  10. #include <QString>
  11. #include <QObject>
  12. #include <QXmlStreamAttributes>
  13. #include "cppwebframework_global.h"
  14. CWF_BEGIN_NAMESPACE
  15. /**
  16. * @brief This class search for expressions #{obj.get} and compiles it.
  17. */
  18. class CPPWEBFRAMEWORKSHARED_EXPORT CSTLCompilerAttributes
  19. {
  20. QMap<QString, QObject *> &objects;
  21. public:
  22. explicit CSTLCompilerAttributes(QMap<QString, QObject *> &objects);
  23. QString buildAttributes(QMap<QString, QString> &attr, bool keyValue = true);
  24. void compileAttributes(QMap<QString, QString> &attr);
  25. void compile(QString &text, QString &outPutText);
  26. QMap<QString, QString> getAttributes(const QXmlStreamAttributes &attributes);
  27. };
  28. CWF_END_NAMESPACE
  29. #endif // CSTLCOMPILERATTRIBUTES_H