Changeset 941
- Timestamp:
- 06/05/20 17:11:29 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/virtfile/stringfile.h
r887 r941 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 16 16 int pos; 17 17 public: 18 StringFILE(string& s, int _pos=0): VirtFILE(""), str(s), pos(_pos) {}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 size_t Vwrite(const void *ptr, size_t size, size_t nmemb) { str.append((const char*)ptr, (int)(size *nmemb)); return nmemb; }20 size_t Vwrite(const void *ptr, size_t size, size_t nmemb) { str.append((const char*)ptr, (int)(size * nmemb)); return nmemb; } 21 21 int Veof() { return pos >= int(str.size()); } 22 22 int Vputc(int c) { str += (char)c; return c; } … … 36 36 string str; 37 37 public: 38 StringFILE2(const string& s,int pos=0) :StringFILE(str,pos), str(s) {} 38 StringFILE2(const string& s, int pos = 0) :StringFILE(str, pos), str(s) {} 39 StringFILE2(const char* s, int pos = 0) :StringFILE(str, pos), str(s) {} 39 40 StringFILE2() :StringFILE(str) {} 40 41 }; … … 43 44 { 44 45 public: 45 StringFileSystem(VirtFileSystem *_chain = NULL) :ChainFileSystem(_chain) {}46 StringFileSystem(VirtFileSystem *_chain = NULL) :ChainFileSystem(_chain) {} 46 47 VirtFILE *Vfopen(const char* path, const char*mode); 47 48 static const char PREFIX[];
Note: See TracChangeset
for help on using the changeset viewer.