Column: Made ::validate const

This commit is contained in:
Paul Beckingham 2016-02-01 23:56:39 -05:00
parent 575433542f
commit db7ebf9029
4 changed files with 10 additions and 10 deletions

View file

@ -47,7 +47,7 @@ ColumnUDAString::ColumnUDAString ()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool ColumnUDAString::validate (std::string& value) bool ColumnUDAString::validate (const std::string& value) const
{ {
// No restrictions. // No restrictions.
if (_values.size () == 0) if (_values.size () == 0)
@ -143,7 +143,7 @@ ColumnUDANumeric::ColumnUDANumeric ()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool ColumnUDANumeric::validate (std::string& value) bool ColumnUDANumeric::validate (const std::string& value) const
{ {
// No restrictions. // No restrictions.
if (_values.size () == 0) if (_values.size () == 0)
@ -231,7 +231,7 @@ ColumnUDADate::ColumnUDADate ()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool ColumnUDADate::validate (std::string& value) bool ColumnUDADate::validate (const std::string& value) const
{ {
// No restrictions. // No restrictions.
if (_values.size () == 0) if (_values.size () == 0)
@ -345,7 +345,7 @@ ColumnUDADuration::ColumnUDADuration ()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool ColumnUDADuration::validate (std::string& value) bool ColumnUDADuration::validate (const std::string& value) const
{ {
// No restrictions. // No restrictions.
if (_values.size () == 0) if (_values.size () == 0)

View file

@ -37,7 +37,7 @@ class ColumnUDAString : public ColumnTypeString
{ {
public: public:
ColumnUDAString (); ColumnUDAString ();
bool validate (std::string&); bool validate (const std::string&) const;
void measure (Task&, unsigned int&, unsigned int&); void measure (Task&, unsigned int&, unsigned int&);
void render (std::vector <std::string>&, Task&, int, Color&); void render (std::vector <std::string>&, Task&, int, Color&);
@ -53,7 +53,7 @@ class ColumnUDANumeric : public ColumnTypeNumeric
{ {
public: public:
ColumnUDANumeric (); ColumnUDANumeric ();
bool validate (std::string&); bool validate (const std::string&) const;
void measure (Task&, unsigned int&, unsigned int&); void measure (Task&, unsigned int&, unsigned int&);
void render (std::vector <std::string>&, Task&, int, Color&); void render (std::vector <std::string>&, Task&, int, Color&);
@ -66,7 +66,7 @@ class ColumnUDADate : public ColumnTypeDate
{ {
public: public:
ColumnUDADate (); ColumnUDADate ();
bool validate (std::string&); bool validate (const std::string&) const;
void measure (Task&, unsigned int&, unsigned int&); void measure (Task&, unsigned int&, unsigned int&);
void render (std::vector <std::string>&, Task&, int, Color&); void render (std::vector <std::string>&, Task&, int, Color&);
@ -79,7 +79,7 @@ class ColumnUDADuration : public ColumnTypeDuration
{ {
public: public:
ColumnUDADuration (); ColumnUDADuration ();
bool validate (std::string&); bool validate (const std::string&) const;
void measure (Task&, unsigned int&, unsigned int&); void measure (Task&, unsigned int&, unsigned int&);
void render (std::vector <std::string>&, Task&, int, Color&); void render (std::vector <std::string>&, Task&, int, Color&);

View file

@ -283,7 +283,7 @@ void Column::setStyle (const std::string& style)
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool Column::validate (std::string& input) bool Column::validate (const std::string& input) const
{ {
return input.length () ? true : false; return input.length () ? true : false;
} }

View file

@ -57,7 +57,7 @@ public:
virtual void setLabel (const std::string& value) { _label = value; } virtual void setLabel (const std::string& value) { _label = value; }
virtual void setReport (const std::string& value) { _report = value; } virtual void setReport (const std::string& value) { _report = value; }
virtual bool validate (std::string&); virtual bool validate (const std::string&) const;
virtual void measure (const std::string&, unsigned int&, unsigned int&) {}; virtual void measure (const std::string&, unsigned int&, unsigned int&) {};
virtual void measure (Task&, unsigned int&, unsigned int&) {}; virtual void measure (Task&, unsigned int&, unsigned int&) {};
virtual void renderHeader (std::vector <std::string>&, int, Color&); virtual void renderHeader (std::vector <std::string>&, int, Color&);