| 42 | } |
| 43 | |
| 44 | bool hsclient::open_tbl(const char* dbn, const char* tbl, |
| 45 | const char* idx, const char* flds, bool auto_open /* = true */) |
| 46 | { |
| 47 | string key(dbn); |
| 48 | |
| 49 | key << '|' << tbl << '|' << idx << '|' << flds; |
| 50 | key.lower(); |
| 51 | |
| 52 | if (stream_.opened()) { |
| 53 | std::map<string, hstable*>::iterator it = tables_.find(key); |
| 54 | if (it != tables_.end()) { |
| 55 | tbl_curr_ = it->second; |
| 56 | return true; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | if (!auto_open) { |
| 61 | error_ = HS_ERR_NOT_OPEN; |
| 62 | tbl_curr_ = NULL; |
| 63 | return false; |
| 64 | } |
| 65 | return open_tbl(dbn, tbl, idx, flds, key.c_str()); |
| 66 | } |
| 67 | |
| 68 | |
| 69 | bool hsclient::open_tbl(const char* dbn, const char* tbl, |
no test coverage detected