nodejs-db-informix  master
nodejs bindings for Informix
 All Classes Functions Pages
result.h
1 #ifndef __RESULT_H_INCLUDED__
2 #define __RESULT_H_INCLUDED__
3 
4 #include <stdint.h>
5 #include <stdexcept>
6 #include <string>
7 #include <vector>
8 #include "exception.h"
9 
10 namespace nodejs_db {
11 class Result {
12  public:
13  class Column {
14  public:
15  typedef enum {
16  STRING,
17  TEXT,
18  INT,
19  NUMBER,
20  MONEY,
21  DATE,
22  TIME,
23  INTERVAL,
24  DATETIME,
25  BOOL,
26  BLOB,
27  SET,
28  ROW,
29  COLLECTION,
30  CONSTRUCTED,
31  } type_t;
32 
33  virtual ~Column();
34  virtual std::string getName() const = 0;
35  virtual type_t getType() const = 0;
36  virtual bool isBinary() const;
37  };
38 
39  virtual ~Result();
40  virtual void release() throw();
41  virtual bool hasNext() const throw(Exception&) = 0;
42  virtual std::vector<std::string>* next() throw(Exception&) = 0;
43  virtual unsigned long* columnLengths() throw(Exception&) = 0;
44  virtual uint64_t index() const throw(std::out_of_range&) = 0;
45  virtual Column* column(uint16_t i) const throw(std::out_of_range&) = 0;
46  virtual uint64_t insertId() const throw(Exception&);
47  virtual uint64_t affectedCount() const throw() = 0;
48  virtual uint16_t warningCount() const throw(Exception&);
49  virtual uint16_t columnCount() const throw() = 0;
50  virtual uint64_t count() const throw(Exception&);
51  virtual bool isBuffered() const throw() = 0;
52  virtual bool isEmpty() const throw() = 0;
53 };
54 }
55 
56 #endif // __RESULT_H_INCLUDED__