more bugfixing
This commit is contained in:
@@ -24,7 +24,7 @@ public:
|
||||
virtual ~Display() = default;
|
||||
|
||||
virtual void write_score(uint64_t score) = 0;
|
||||
virtual void write_content(std::string & content) = 0;
|
||||
virtual void write_content(const std::string content) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -54,12 +54,13 @@ std::string Display::fit_score_string(std::string & score_string, const unsigned
|
||||
return score_string;
|
||||
}
|
||||
|
||||
void Display::write_content(std::string & content, const unsigned int & length)
|
||||
void Display::write_content(const std::string content, const unsigned int & length)
|
||||
{
|
||||
if(content.size() > length)
|
||||
{
|
||||
CLOG(WARNING, OUTPUT_LOGGER) << "Cannot write more than " << length << " digits on " << length << "-Digit Display. Truncating!";
|
||||
content = content.substr(0, length);
|
||||
this->content = content.substr(0, length);
|
||||
return;
|
||||
}
|
||||
|
||||
this->content = content;
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
virtual ~Display() = default;
|
||||
|
||||
void write_score(const uint64_t & score, const unsigned int & length);
|
||||
void write_content(std::string & content, const unsigned int & length);
|
||||
void write_content(const std::string content, const unsigned int & length);
|
||||
|
||||
std::string get_content() const override;
|
||||
uint8_t get_address() const override;
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
detail::Display::write_score(score, 8);
|
||||
}
|
||||
|
||||
void write_content(std::string & content) override
|
||||
void write_content(const std::string content) override
|
||||
{
|
||||
detail::Display::write_content(content, 8);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
{
|
||||
detail::Display::write_score(score, 7);
|
||||
}
|
||||
void write_content(std::string & content) override
|
||||
void write_content(const std::string content) override
|
||||
{
|
||||
detail::Display::write_content(content, 7);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user