File utils.hpp
File List > e-paper-board > src > utils > utils.hpp
Go to the documentation of this file.
#pragma once
#include "display/gfxlatin2.h"
#include "string.h"
#include <string>
static const char* printCz(const char* str) {
static char text[100];
strcpy(text, str);
utf8tocp(text);
return text;
}
static const char* printCz(std::string str) {
return printCz(str.c_str());
}
static int secToMs(int sec) {
return sec * 1000;
}
static int minToSec(int minutes) {
return minutes * 60;
}
static const char* substr(std::string text, int start, int end) {
if(text.length() > end) {
return std::string(text.substr(start, end) + "..").c_str();
} else {
return text.c_str();
}
}