Files
@ e691d05c4786
Branch filter:
Location: libtransport.git/backends/twitter/userdb.h - annotation
e691d05c4786
800 B
text/plain
Using storage backend for stroing user data (Buggy code)
db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 db3a434e6299 | #ifndef USERDB_H
#define USERDB_H
#include <iostream>
#include <sqlite3.h>
#include <vector>
#include <set>
#include "transport/logging.h"
struct UserData
{
std::string user;
std::string accessTokenKey;
std::string accessTokenSecret;
UserData(){}
UserData(std::string _user, std::string key, std::string secret) {
user = _user;
accessTokenKey = key;
accessTokenSecret = secret;
}
};
class UserDB {
private:
sqlite3 *db;
char *errMsg;
char **result;
int rc;
int nRow,nCol;
bool dbOpen;
std::vector< std::vector<std::string> > data;
public:
UserDB (std::string database);
int exe(std::string s_exe);
void insert(UserData info);
void fetch(std::string user, std::vector<std::string> &row);
std::set<std::string> getRegisteredUsers();
~UserDB();
};
#endif
|