mysqli_bind.h 736 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __MYSQL_BIND_H
  2. #define __MYSQL_BIND_H
  3. #ifndef nullptr
  4. #define nullptr 0
  5. #endif
  6. #include <mysql.h>
  7. class mysqli_bind
  8. {
  9. public:
  10. mysqli_bind(int size);
  11. mysqli_bind(MYSQL_BIND &bind,int size);
  12. ~mysqli_bind();
  13. int size() const;
  14. void clear();
  15. MYSQL_BIND *operator[](int index) { check_index_range(index); return _bind+index; };
  16. operator MYSQL_BIND*() { return _bind; };
  17. void bind(int index,short &value);
  18. void bind(int index,int &value);
  19. void bind(int index,const char *string,int buffer_size,unsigned long &length);
  20. bool is_null(int index) const;
  21. bool is_error(int index) const;
  22. private:
  23. void allocate(int size);
  24. void check_index_range(int index) const;
  25. int _size;
  26. MYSQL_BIND *_bind;
  27. bool _is_on_stack;
  28. };
  29. #endif