Column.h 1009 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef ORM_COLUMN_H
  2. #define ORM_COLUMN_H
  3. #include <string>
  4. #include "Orm/Expr.h"
  5. namespace Egametang {
  6. class Column
  7. {
  8. private:
  9. std::string columnStr;
  10. public:
  11. Column(const std::string name);
  12. ~Column();
  13. Column& operator()(std::string& name);
  14. bool Empty();
  15. std::string ToString() const;
  16. template <typename T>
  17. Expr operator>(const T& value)
  18. {
  19. return Oper(*this,">", value);
  20. }
  21. template <typename T>
  22. Expr operator>=(const T& value)
  23. {
  24. return Oper(*this, ">=", value);
  25. }
  26. template <typename T>
  27. Expr operator<(const T& value)
  28. {
  29. return Oper(*this, "<", value);
  30. }
  31. template <typename T>
  32. Expr operator<=(const T& value)
  33. {
  34. return Oper(*this, "<=", value);
  35. }
  36. template <typename T>
  37. Expr operator!=(const T& value)
  38. {
  39. return Oper(*this, "<>", value);
  40. }
  41. template <typename T>
  42. Expr operator==(const T& value)
  43. {
  44. return Oper(*this, "=", value);
  45. }
  46. Expr like(const std::string value)
  47. {
  48. return Oper(*this, "like", value);
  49. }
  50. };
  51. } // namespace Egametang
  52. #endif // ORM_COLUMN_H