Files
igl/examples/file_contents_as_string/example.cpp
T
jalec 36947b1cd1 added file -> string function and example,
better comments on pathinfo, basename, dirname,
added functions to assist creation, loading of GLSL shaders (some of which is translated from Denis Kovacs's NYU code)
2011-09-26 15:31:57 +00:00

27 lines
497 B
C++

#include "file_contents_as_string.h"
using namespace igl;
#include <cstdio>
#include <string>
using namespace std;
int main(int argc, char * argv[])
{
if(argc <= 1)
{
printf("USAGE:\n ./example [path_1] [path_2] ... [path_n]\n");
return 1;
}
// loop over arguments
for(int i = 1; i < argc; i++)
{
string content;
bool success = file_contents_as_string(argv[i],content);
if(!success)
{
return 1;
}
printf("%s",content.c_str());
}
return 0;
}