summaryrefslogtreecommitdiffstats
path: root/private/crtlib/include/strstrea.h
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crtlib/include/strstrea.h
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/crtlib/include/strstrea.h')
-rw-r--r--private/crtlib/include/strstrea.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/private/crtlib/include/strstrea.h b/private/crtlib/include/strstrea.h
new file mode 100644
index 000000000..7eed5fead
--- /dev/null
+++ b/private/crtlib/include/strstrea.h
@@ -0,0 +1,89 @@
+/***
+*strstream.h - definitions/declarations for strstreambuf, strstream
+*
+* Copyright (c) 1991-1993, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the classes, values, macros, and functions
+* used by the strstream and strstreambuf classes.
+* [AT&T C++]
+*
+****/
+
+#ifndef _INC_STRSTREAM
+#define _INC_STRSTREAM
+
+#include <iostream.h>
+
+// Force word packing to avoid possible -Zp override
+#pragma pack(4)
+
+#pragma warning(disable:4505) // disable unwanted /W4 warning
+// #pragma warning(default:4505) // use this to reenable, if necessary
+
+class strstreambuf : public streambuf {
+public:
+ strstreambuf();
+ strstreambuf(int);
+ strstreambuf(char *, int, char * = 0);
+ strstreambuf(unsigned char *, int, unsigned char * = 0);
+ strstreambuf(signed char *, int, signed char * = 0);
+ strstreambuf(void * (*a)(long), void (*f) (void *));
+ ~strstreambuf();
+
+ void freeze(int =1);
+ char * str();
+
+virtual int overflow(int);
+virtual int underflow();
+virtual streambuf* setbuf(char *, int);
+virtual streampos seekoff(streamoff, ios::seek_dir, int);
+virtual int sync(); // not in spec.
+
+protected:
+virtual int doallocate();
+private:
+ int x_dynamic;
+ int x_bufmin;
+ int _fAlloc;
+ int x_static;
+ void * (* x_alloc)(long);
+ void (* x_free)(void *);
+};
+
+class istrstream : public istream {
+public:
+ istrstream(char *);
+ istrstream(char *, int);
+ ~istrstream();
+
+inline strstreambuf* rdbuf() const { return (strstreambuf*) ios::rdbuf(); }
+inline char * str() { return rdbuf()->str(); }
+};
+
+class ostrstream : public ostream {
+public:
+ ostrstream();
+ ostrstream(char *, int, int = ios::out);
+ ~ostrstream();
+
+inline int pcount() const { return rdbuf()->out_waiting(); }
+inline strstreambuf* rdbuf() const { return (strstreambuf*) ios::rdbuf(); }
+inline char * str() { return rdbuf()->str(); }
+};
+
+class strstream : public iostream { // strstreambase ???
+public:
+ strstream();
+ strstream(char *, int, int);
+ ~strstream();
+
+inline int pcount() const { return rdbuf()->out_waiting(); } // not in spec.
+inline strstreambuf* rdbuf() const { return (strstreambuf*) ostream::rdbuf(); }
+inline char * str() { return rdbuf()->str(); }
+};
+
+// Restore default packing
+#pragma pack()
+
+#endif // !_INC_STRSTREAM