a bit of refactoring

This commit is contained in:
2021-12-18 14:52:33 +01:00
parent 906df74847
commit eebb270f47
11 changed files with 96 additions and 96 deletions

6
row.h
View File

@@ -15,6 +15,7 @@ struct ColValue {
virtual long getIntegerValue() const = 0;
virtual double getDoubleValue() const = 0;
virtual std::string getStringValue() const = 0;
virtual std::string getCsvStringValue() const { return getStringValue(); };
virtual long getDateValue() const = 0;
virtual bool getBoolValue() const = 0;
@@ -87,6 +88,11 @@ struct ColStringValue : ColValue {
long getIntegerValue() const override { return std::stoi(*m_string); };
double getDoubleValue() const override { return std::stod(*m_string); };
std::string getStringValue() const override { return *m_string; };
std::string getCsvStringValue() const override {
// TODO handle correctly CSV string
// ?? return std::regex_replace(getStringValue(), std::regex( "\"" ), "\\\"" );
return getStringValue();
};
long getDateValue() const override { return std::stoi(*m_string); };
bool getBoolValue() const override { throw Exception("Not supported on ColStringValue"); };