claugeas/utils.h

14 lines
495 B
C++

#include "string"
#include <iostream>
// Some guards
#define CHECK_RET_VOID(bx, msg) if(bx) {std::cout << msg << std::endl; return;}
#define CHECK_RET_NULLPTR(bx, msg) if(bx) {std::cout << msg << std::endl; return nullptr;}
#define CHECK_RET_BOOL(bx, msg) if(bx) {std::cout << msg << std::endl; return false;}
#define CHECK_RET_INT(bx, msg) if(bx) {std::cout << msg << std::endl; return -1;}
#define INVALID_STATE "Augeas is in invalid state."
bool path_exists(const std::string &name);