2015-02-26 15:02:31 +00:00
|
|
|
|
2015-03-23 21:03:14 +00:00
|
|
|
#ifndef UTILITIES_HH
|
|
|
|
#define UTILITIES_HH
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
#include "clang/Frontend/CompilerInstance.h"
|
|
|
|
#include "clang/Basic/FileManager.h"
|
|
|
|
#include "clang/Basic/SourceLocation.h"
|
|
|
|
#include "HeaderSearchDirs.hh"
|
|
|
|
|
2016-10-06 18:54:06 +00:00
|
|
|
enum Color {
|
|
|
|
ERROR = 31,
|
|
|
|
WARNING = 33,
|
2017-03-15 20:53:56 +00:00
|
|
|
INFO = 34,
|
|
|
|
SKIP = 95
|
2016-10-06 18:54:06 +00:00
|
|
|
};
|
|
|
|
|
2020-09-01 20:55:19 +00:00
|
|
|
std::string sanitize(const std::string&) ;
|
2015-02-26 15:02:31 +00:00
|
|
|
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 ) ;
|
2016-10-21 20:06:35 +00:00
|
|
|
char * almostRealPath( const std::string& in_path ) ;
|
2015-02-26 15:02:31 +00:00
|
|
|
char * almostRealPath( const char * in_path ) ;
|
|
|
|
|
2016-10-06 18:54:06 +00:00
|
|
|
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);
|
2020-09-01 20:55:19 +00:00
|
|
|
std::string & replace_special_chars( std::string & str);
|
2016-10-06 18:54:06 +00:00
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
#endif
|