Row::ith_column() method removed

This commit is contained in:
2021-08-15 11:52:00 +02:00
parent 869e5881df
commit b37b0b55ff
5 changed files with 60 additions and 61 deletions

19
row.h
View File

@@ -17,7 +17,7 @@ namespace usql {
virtual long getDateValue() = 0;
virtual bool getBoolValue() = 0;
virtual int compare(ColValue * other) = 0;
virtual int compare(ColValue &other) = 0;
virtual ~ColValue() = default;
@@ -33,7 +33,7 @@ namespace usql {
long getDateValue() override { throw Exception("getDateValue not supported on ColNullValue"); };
bool getBoolValue() override { throw Exception("getDateValue not supported on ColNullValue"); };
int compare(ColValue * other) override;
int compare(ColValue &other) override;
};
@@ -48,7 +48,7 @@ namespace usql {
long getDateValue() override { return m_integer; };
bool getBoolValue() override { throw Exception("Not supported on ColIntegerValue"); };
int compare(ColValue * other) override;
int compare(ColValue &other) override;
long m_integer;
};
@@ -65,7 +65,7 @@ namespace usql {
long getDateValue() override { return (long) m_double; };
bool getBoolValue() override { throw Exception("Not supported on ColDoubleValue"); };
int compare(ColValue * other) override;
int compare(ColValue &other) override;
double m_double;
};
@@ -82,7 +82,7 @@ namespace usql {
long getDateValue() override { return std::stoi(m_string); };
bool getBoolValue() override { throw Exception("Not supported on ColStringValue"); };
int compare(ColValue * other) override;
int compare(ColValue &other) override;
std::string m_string;
};
@@ -98,7 +98,7 @@ namespace usql {
long getDateValue() override { return m_date; };
bool getBoolValue() override { throw Exception("Not supported on ColDateValue"); };
int compare(ColValue * other) override;
int compare(ColValue &other) override;
long m_date; // seconds since epoch for now
};
@@ -114,7 +114,7 @@ namespace usql {
long getDateValue() override { throw Exception("Not supported on ColBooleanValue"); };
bool getBoolValue() override { return m_bool; };
int compare(ColValue * other) override;
int compare(ColValue &other) override;
bool m_bool;
};
@@ -136,12 +136,11 @@ namespace usql {
void setDateColumnValue(int col_index, const std::string &value);
void setBoolColumnValue(int col_index, bool value);
void setBoolColumnValue(int col_index, const std::string &value);
void setColumnValue(ColDefNode *col_def, ColValue *col_value);
void setColumnValue(ColDefNode *col_def, ColValue &col_value);
void setColumnValue(ColDefNode *col_def, ValueNode *col_value);
ColValue &operator[](int i) { return *m_columns[i]; }
ColValue &operator[](int i) const { return *m_columns[i]; }
ColValue * ith_column(int i) const { return m_columns[i].get(); }
int compare(const Row &other) const;
void print(const std::vector<ColDefNode> &col_defs);