aboutsummaryrefslogtreecommitdiff
path: root/utils.hpp
blob: a0ca68d56ce585b1b08c6907410a7a2344c5985c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Chris Xiong 2018
//3-Clause BSD License
#ifndef UTILS_HPP
#define UTILS_HPP
#include <string>
#include <vector>
#define LOG(type,format,...) fprintf(stderr,"%c: " format "\n",type,__VA_ARGS__)
int readint(const char* path);
float readfloat(const char* path);
std::string readstr(const char* path,int max_length=256);
void writeint(const char* path,int v);
std::string trim(std::string s);
void split(std::string s,char c,std::vector<std::string>& v);
template<typename T>void ignore_result(T){}
#endif