Changeset 720 for cpp/common/virtfile
- Timestamp:
- 01/14/18 11:24:22 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/virtfile/stringfile.h
r382 r720 16 16 int pos; 17 17 public: 18 StringFILE(string& s ): VirtFILE(""), str(s), pos(0) {}18 StringFILE(string& s,int _pos=0): VirtFILE(""), str(s), pos(_pos) {} 19 19 size_t Vread(void *ptr, size_t size, size_t nmemb); 20 20 size_t Vwrite(const void *ptr, size_t size, size_t nmemb) { str.append((const char*)ptr, (int)(size*nmemb)); return size*nmemb; } … … 27 27 long Vtell() { return pos; } 28 28 int Vflush() { return 0; } 29 30 const string& getString() { return str; } 29 31 }; 30 32 … … 34 36 string str; 35 37 public: 36 StringFILE2(const string& s ) :StringFILE(str), str(s) {}38 StringFILE2(const string& s,int pos=0) :StringFILE(str,pos), str(s) {} 37 39 StringFILE2() :StringFILE(str) {} 38 const string& getString() { return str; }39 40 }; 40 41
Note: See TracChangeset
for help on using the changeset viewer.