iu9-ca-web-chat/src/http_server/engine_engine_number_9/baza.h

35 lines
861 B
C++

#ifndef ENGINE_ENGINE_NUMBER_9_BAZA_H
#define ENGINE_ENGINE_NUMBER_9_BAZA_H
#include <string>
#include <memory>
namespace een9 {
class ServerError : public std::exception{
std::string err;
std::string FILE;
std::string func;
int LINE;
std::string WHAT;
public:
ServerError(const std::string &err, const std::string &file, const std::string &func, int line);
const char *what() const noexcept override;
};
std::string prettyprint_errno(const std::string& pref);
bool strIn(const std::string& str, const char* arr[]);
bool endsIn(const std::string& a, const std::string& b);
/* In case of error, throws een9::ServerError */
std::string getSubstring(const std::string& str, size_t A, size_t B);
template<typename T>
using uptr = std::unique_ptr<T>;
}
#endif