trick/trick_source/codegen/Interface_Code_Gen/Utilities.hh
2016-10-06 13:54:06 -05:00

29 lines
997 B
C++

#ifndef UTILITIES_HH
#define UTILITIES_HH
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceLocation.h"
#include "HeaderSearchDirs.hh"
enum Color {
ERROR = 31,
WARNING = 33,
INFO = 34
};
std::string trim( const std::string& str, const std::string& whitespace = " \t\n\r" ) ;
bool isInUserCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ;
bool isInUserOrTrickCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ;
std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ;
char * almostRealPath( const char * in_path ) ;
std::string color(const Color& color, const std::string& text);
std::string bold(const std::string& text);
std::string underline(const std::string& text);
std::string underline(const std::string& text, unsigned length);
std::string quote(const std::string& text);
#endif