Changeset 247 for cpp/frams/virtfile/stringfile.h
- Timestamp:
- 11/07/14 17:51:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/virtfile/stringfile.h
r207 r247 16 16 public: 17 17 StringFILE(SString& s):str(s),pos(0) {} 18 int Vread(void *ptr, size_t size, size_t nmemb);19 int Vwrite(const void *ptr, size_t size, size_t nmemb) {str.append((const char*)ptr,size*nmemb); return size*nmemb;}18 size_t Vread(void *ptr, size_t size, size_t nmemb); 19 size_t Vwrite(const void *ptr, size_t size, size_t nmemb) {str.append((const char*)ptr,(int)(size*nmemb)); return size*nmemb;} 20 20 int Veof() {return pos>=str.len();} 21 21 int Vputc(int c) {str+=(char)c; return c;} 22 int Vputs(const char *s) {str.append(s, strlen(s)); return 0;}22 int Vputs(const char *s) {str.append(s,(int)strlen(s)); return 0;} 23 23 int Vgetc(); 24 24 char *Vgets(char *s, int size); 25 25 int Vseek(long offset, int whence); 26 intVtell() {return pos;}26 long Vtell() {return pos;} 27 27 int Vflush() {return 0;} 28 28 };
Note: See TracChangeset
for help on using the changeset viewer.