Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include <math.h>
- #include <sstream>
- #include <fstream>
- #include <cerrno>
- using namespace std;
- class FilePro{
- private:
- ifstream fileProce;
- string name;
- long size;
- public:
- FilePro(string name){
- this->name = name;
- }
- string toString(){
- std::ifstream in(name, ios::in | ios::binary);
- if (in)
- {
- string str;
- in.seekg(0, ios::end);
- str.resize(in.tellg());
- in.seekg(0, ios::beg);
- in.read(&str[0], str.size());
- in.close();
- return(str);
- }
- throw(errno);
- }
- long sizeFile(){
- return size;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement