12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // Created by lloyd on 2020/10/14.
- //
- #ifndef GTCVR_GTPGCNN_H
- #define GTCVR_GTPGCNN_H
- #include "libpq-fe.h"
- class gtpgcnn {
- public:
- std::string cnnstr;
- private:
- PGconn *cnn;
- PGresult *res;
- /* std::mutex mtx;
- //0:init status;1: refrence status -1:already close
- int isalreadycloseres;*/
- public:
- gtpgcnn();
- void openCnn();
- bool closeCnn();
- bool readContent(std::string sql);
- bool writeContent(std::string sql);
- int getRowsNumFromResult();
- int getColsNumFromResult();
- std::string getValueFromResult(int row, int col);
- void clearRes();
- char *getValueFromResultChar(int row, int col);
- };
- #endif //GTCVR_GTPGCNN_H
|