---------------------------------------------------------------------------
| 814 | |
| 815 | //--------------------------------------------------------------------------- |
| 816 | bool readFile(const std::string &filename, std::string &s) |
| 817 | { |
| 818 | long n = fileSize(filename); |
| 819 | if (n == -1) |
| 820 | return false; |
| 821 | FILE *fpIO = fopen(filename.c_str(), "rb"); |
| 822 | if (fpIO == NULL) |
| 823 | return false; |
| 824 | s.clear(); |
| 825 | s.resize(n); |
| 826 | //char *in = new char[n]; |
| 827 | long bytes = static_cast<long>(fread(&(s[0]), sizeof(char), n, fpIO)); |
| 828 | //delete in; |
| 829 | fclose(fpIO); |
| 830 | return (bytes == n); |
| 831 | } |
| 832 | |
| 833 | //--------------------------------------------------------------------------- |
| 834 | bool readFile(const std::string &filename, std::vector<std::string> &vs) |