Expr.h 945 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright: All Rights Reserved
  2. // Author: egametang@gmail.com (tanghai)
  3. #ifndef ORM_EXPRESSION_H
  4. #define ORM_EXPRESSION_H
  5. #include <string>
  6. namespace Egametang {
  7. class Expr
  8. {
  9. protected:
  10. std::string exprStr;
  11. public:
  12. virtual ~Expr();
  13. Expr& operator=(const Expr& expr);
  14. std::string ToString() const;
  15. bool Empty();
  16. };
  17. class Not: public Expr
  18. {
  19. public:
  20. Not(const Expr& expr);
  21. };
  22. class And: public Expr
  23. {
  24. public:
  25. And(const Expr& left, const Expr& right);
  26. };
  27. class Or: public Expr
  28. {
  29. public:
  30. Or(const Expr& left, const Expr& right);
  31. };
  32. class Column;
  33. // > < >= <= != like
  34. class Oper: public Expr
  35. {
  36. public:
  37. Oper(const Column& left, const std::string& op, const std::string& right);
  38. Oper(const Column& left, const std::string& op, const Column& right);
  39. Oper(const Column& left, const std::string& op, int right);
  40. Oper(const Column& left, const std::string& op, double right);
  41. };
  42. } // namespace Egametang
  43. #endif // ORM_EXPRESSION_H