| 153 | } |
| 154 | |
| 155 | long getFileSize(const std::string &fileName) |
| 156 | { |
| 157 | FILE *fp = fopen(fileName.c_str(), "rb"); |
| 158 | if(fp == NULL) { |
| 159 | return -1; |
| 160 | } |
| 161 | |
| 162 | fseek(fp, 0, SEEK_END); |
| 163 | |
| 164 | long pos = ftell(fp); |
| 165 | |
| 166 | fclose(fp); |
| 167 | |
| 168 | return pos; |
| 169 | } |
| 170 | |
| 171 | bool readLinesFromStream(const std::string &fileName, std::vector<std::string> &lines) |
| 172 | { |