| 1166 | }; |
| 1167 | |
| 1168 | int Result_buffer::append_header(cdb2_hndl_tp *hndl) { |
| 1169 | std::list<std::string> header; |
| 1170 | int ncols; |
| 1171 | char *col; |
| 1172 | |
| 1173 | ncols = cdb2_numcolumns(cdb2h); |
| 1174 | if (ncols == 0) { |
| 1175 | return 0; |
| 1176 | } |
| 1177 | |
| 1178 | for (int i = 0; i < ncols; i ++) { |
| 1179 | col = (char *) cdb2_column_name(cdb2h, i); |
| 1180 | if (printmode & DISP_COLTYPE) { |
| 1181 | std::string typeStr(col); |
| 1182 | typeStr.append(" COLTYPE"); |
| 1183 | header.push_back(typeStr); |
| 1184 | width.push_back(typeStr.length()); |
| 1185 | } |
| 1186 | header.push_back(std::string(col)); |
| 1187 | width.push_back(strlen(col)); |
| 1188 | } |
| 1189 | result.push_back(header); |
| 1190 | return 0; |
| 1191 | } |
| 1192 | |
| 1193 | int Result_buffer::append_row(cdb2_hndl_tp *hndl) { |
| 1194 | std::list<std::string> row; |
no test coverage detected