Subversion Repositories gelsvn

Rev

Rev 25 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25 Rev 37
Line 3... Line 3...
3
#include <fcntl.h>
3
#include <fcntl.h>
4
#include <iostream>
4
#include <iostream>
5
 
5
 
6
#if defined(_MSC_VER)
6
#if defined(_MSC_VER)
7
#include <io.h>
7
#include <io.h>
-
 
8
 
-
 
9
#pragma message("Note: including lib: expat.lib\n")
-
 
10
#pragma comment(lib, "expat.lib")
-
 
11
 
8
#else
12
#else
9
#include <unistd.h>
13
#include <unistd.h>
10
#endif
14
#endif
11
#include <expat.h>
15
#include <expat.h>
12
 
16
 
Line 134... Line 138...
134
    }
138
    }
135
 
139
 
136
    struct stat stat_buf;
140
    struct stat stat_buf;
137
    fstat(in, &stat_buf);
141
    fstat(in, &stat_buf);
138
 
142
 
139
    const int BUF_SIZE = CGLA::s_min(5000000, static_cast<int>(stat_buf.st_size));
143
    const int BUF_SIZE = CGLA::s_min(50000000, static_cast<int>(stat_buf.st_size));
-
 
144
		cout << "buffer size : " << BUF_SIZE << endl;
140
    char* buf2 = new char[BUF_SIZE];
145
    char* buf2 = new char[BUF_SIZE];
141
    size_t len;
146
    size_t len;
142
    do {
147
    do {
143
      len = read(in, buf2, BUF_SIZE);
148
      len = read(in, buf2, BUF_SIZE);
144
      if (len!=BUF_SIZE)
149
      if (len!=BUF_SIZE)