forked from mariano/node-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult.h
50 lines (45 loc) · 1.56 KB
/
result.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2011 Mariano Iglesias <[email protected]>
#ifndef RESULT_H_
#define RESULT_H_
#include <stdint.h>
#include <stdexcept>
#include <string>
#include "./exception.h"
namespace node_db {
class Result {
public:
class Column {
public:
typedef enum {
STRING,
TEXT,
INT,
NUMBER,
DATE,
TIME,
DATETIME,
BOOL,
SET
} type_t;
virtual ~Column();
virtual std::string getName() const = 0;
virtual type_t getType() const = 0;
virtual bool isBinary() const;
};
virtual ~Result();
virtual void release() throw();
virtual bool hasNext() const throw(Exception&) = 0;
virtual char** next() throw(Exception&) = 0;
virtual unsigned long* columnLengths() throw(Exception&) = 0;
virtual uint64_t index() const throw(std::out_of_range&) = 0;
virtual Column* column(uint16_t i) const throw(std::out_of_range&) = 0;
virtual uint64_t insertId() const throw(Exception&);
virtual uint64_t affectedCount() const throw() = 0;
virtual uint16_t warningCount() const throw(Exception&);
virtual uint16_t columnCount() const throw() = 0;
virtual uint64_t count() const throw(Exception&);
virtual bool isBuffered() const throw() = 0;
virtual bool isEmpty() const throw() = 0;
};
}
#endif // RESULT_H_