InfoVis 2013  1.0
Information Visualisation project - "Mapping Text with Phrase Nets"
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
utility.h
Go to the documentation of this file.
1 #ifndef UTILITY_H
2 #define UTILITY_H
3 
4 #define STRINGIFY(x) #x
5 #define TOSTRING(x) STRINGIFY(x)
6 #define AT __FILE__ ":" TOSTRING(__LINE__)
7 //Returns the last thrown OpenGL error, if existing
8 #define getGLError() getLastGLErrorLocation(AT)
9 
10 #include <string>
11 
12 bool fileExists(const std::string &filename);
13 
14 std::string readFile(const std::string &filename);
15 
16 // Query OpenGL errors and print error messages to STDERR.
17 void getLastGLErrorLocation(const char *location);
18 
20 
21 //Extracts and returns the filename from a filepath
22 std::string retrieveFilenameWithExtFromPath(const std::string& filepath);
23 
24 //Extracts and returns the filename from a filepath
25 std::string retrieveFilenameWithoutExtFromPath(const std::string& filepath);
26 
27 #endif