|
| 1 | +#include "CSVAppendParser.h" |
| 2 | + |
| 3 | +CSVAppendParser::CSVAppendParser(ICsvParser *original_parser) : original_parser(original_parser), cols(0), rows(0), |
| 4 | + values(nullptr) |
| 5 | +{ |
| 6 | +} |
| 7 | + |
| 8 | +void CSVAppendParser::clear_append_data() |
| 9 | +{ |
| 10 | + dispose(true); |
| 11 | +} |
| 12 | + |
| 13 | +void CSVAppendParser::initialize_csv(std::vector<std::wstring> const &values) |
| 14 | +{ |
| 15 | + clear_append_data(); |
| 16 | +} |
| 17 | + |
| 18 | +ICsvParser *CSVAppendParser::dispose(bool disposing) |
| 19 | +{ |
| 20 | + delete[] values; |
| 21 | + values = nullptr; |
| 22 | + |
| 23 | + original_parser->dispose(disposing); |
| 24 | + |
| 25 | + if (disposing) |
| 26 | + delete this; |
| 27 | + return this; |
| 28 | +} |
| 29 | + |
| 30 | +void CSVAppendParser::get_as_bytes(int col, int row, void *dest, int size) |
| 31 | +{ |
| 32 | + original_parser->get_as_bytes(col, row, dest, size); |
| 33 | +} |
| 34 | + |
| 35 | +int CSVAppendParser::copy_str(int col, int row, std::string *str) |
| 36 | +{ |
| 37 | + return original_parser->copy_str(col, row, str); |
| 38 | +} |
| 39 | + |
| 40 | +void CSVAppendParser::get_as_string(int col, int row, void *dest, int size) |
| 41 | +{ |
| 42 | + original_parser->get_as_string(col, row, dest, size); |
| 43 | +} |
| 44 | + |
| 45 | +int CSVAppendParser::get_as_int(int col, int row) |
| 46 | +{ |
| 47 | + return original_parser->get_as_int(col, row); |
| 48 | +} |
| 49 | + |
| 50 | +float CSVAppendParser::get_as_float(int col, int row) |
| 51 | +{ |
| 52 | + return original_parser->get_as_float(col, row); |
| 53 | +} |
| 54 | + |
| 55 | +int CSVAppendParser::get_cell_strlen(int col, int row) |
| 56 | +{ |
| 57 | + return original_parser->get_cell_strlen(col, row); |
| 58 | +} |
| 59 | + |
| 60 | +int CSVAppendParser::get_cell_byte_length(int col, int row) |
| 61 | +{ |
| 62 | + return original_parser->get_cell_byte_length(col, row); |
| 63 | +} |
| 64 | + |
| 65 | +bool CSVAppendParser::is_valid_cell(int col, int row) |
| 66 | +{ |
| 67 | + return original_parser->is_valid_cell(col, row); |
| 68 | +} |
| 69 | + |
| 70 | +bool CSVAppendParser::is_valid() |
| 71 | +{ |
| 72 | + return original_parser->is_valid(); |
| 73 | +} |
| 74 | + |
| 75 | +int CSVAppendParser::get_cols() |
| 76 | +{ |
| 77 | + return original_parser->get_cols(); |
| 78 | +} |
| 79 | + |
| 80 | +int CSVAppendParser::get_rows() |
| 81 | +{ |
| 82 | + return original_parser->get_rows(); |
| 83 | +} |
| 84 | + |
| 85 | +int CSVAppendParser::get_as_bool(int col, int row) |
| 86 | +{ |
| 87 | + return original_parser->get_as_bool(col, row); |
| 88 | +} |
0 commit comments