a bit of refactoring
This commit is contained in:
6
row.h
6
row.h
@@ -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"); };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user