aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-01-20 08:42:46 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-01-20 08:42:46 -0500
commit1e6676c35ce4990981e8cda389ba39108437d66d (patch)
treec1605794e8fa3d2e3dc9e29a91b0acaded59c8be /src/common.cpp
parent1eced16d75322832617a1b42ec94580a9713e8f0 (diff)
WIP save/load
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/common.cpp b/src/common.cpp
index 2d35313..334671e 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -93,7 +93,24 @@ void strVectorSortAlpha(std::vector<std::string> *v){
}while(change);
}
-
+const char *readFile(const char *path){
+ std::ifstream in (path,std::ios::in);
+ unsigned int size;
+ GLchar *buf;
+
+ if(!in.is_open()){
+ std::cout<<"Error reading file "<<path<<"!"<<std::endl;
+ abort();
+ }
+
+ in.seekg(0,in.end);
+ buf = new GLchar[(size = in.tellg())];
+ in.seekg(0,in.beg);
+ in.read(buf,size);
+
+ in.close();
+ return buf;
+}
/*int strCreateFunc(const char *equ){
static unsigned int size;