Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: adfdd996aa
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (25 sloc) 0.583 kb
#include "utils.h"
std::string Utils::to_lower(std::string s)
{
for(unsigned int i=0; i<s.size(); ++i) {
s[i] = std::tolower(s[i]);
}
return s;
}
std::string Utils::to_upper(std::string s)
{
for(unsigned int i=0; i<s.size(); ++i) {
s[i] = std::toupper(s[i]);
}
return s;
}
std::string Utils::err_header(int line_number)
{
std::stringstream ss;
ss << "ERROR: line " << line_number << ": ";
return ss.str();
}
bool Utils::insensitive_equals(std::string s1, std::string s2)
{
return to_lower(s1).compare(to_lower(s2)) == 0;
}
Jump to Line
Something went wrong with that request. Please try again.