README: explain further musl-specific tweaks
[rofl0r-df-libgraphics.git] / g_src / textlines.cpp
blobe56515a2c3f30c41c6129658152a65b3e9cbb43f
1 #include "platform.h"
2 #include <string.h>
3 #include <math.h>
4 #include <iosfwd>
5 #include <iostream>
6 #include <ios>
7 #include <streambuf>
8 #include <istream>
9 #include <ostream>
10 #include <iomanip>
11 #include <sstream>
12 #include <cstdlib>
13 #include <fstream>
14 #include <zlib.h>
16 #include "svector.h"
17 using std::string;
19 #include "endian.h"
21 #include "files.h"
23 #include "enabler.h"
25 #include "textlines.h"
27 #include "basics.h"
29 extern char filecomp_buffer[20000];
30 extern char filecomp_buffer2[80000];
31 extern char filecomp_buffer_aux[20000];
32 extern char filecomp_buffer2_aux[80000];
35 void textlinesst::load_raw_to_lines(char *filename)
37 clean_lines();
39 //LOAD THE FILE
40 std::ifstream fseed(filename);
41 if(fseed.is_open())
43 string str;
45 while(std::getline(fseed,str))
47 long end=str.length();
49 while(end>0)
51 if(isspace(str[end-1]))end--;
52 else break;
55 str.resize(end);
57 if(str.length()>0)text.add_string(str);
60 fseed.close();