Browse Source

iostream stuff

David Rose 18 năm trước cách đây
mục cha
commit
ac64a7ef97
1 tập tin đã thay đổi với 31 bổ sung6 xóa
  1. 31 6
      dtool/src/parser-inc/iostream

+ 31 - 6
dtool/src/parser-inc/iostream

@@ -24,22 +24,47 @@
 #ifndef IOSTREAM_H
 #define IOSTREAM_H
 
-// We don't care about the actual definition of the various iostream
-// classes, but we do need to know the classnames that are available.
+// We don't care (much) about the actual definition of the various
+// iostream classes, but we do need to know the classnames that are
+// available.
 
 // We need to expose one method in each class to force it to publish.
-// We should fix that sometime.
-class ios {
+// But we'd like to expose some of these methods anyway, so no
+// problem.
+class ios_base {
+__published:
+  enum seekdir {
+    beg = 0,
+    cur = 1,
+    end = 2,
+  };
+};
+class ios : public ios_base {
+__published:
   typedef long fmtflags;
+  typedef unsigned long streampos;
+  typedef long streamoff;
+
+  bool good() const;
+  bool eof() const;
+  bool fail() const;
+  bool bad() const;
+  void clear();
 };
-class ostream {
+class ostream : virtual public ios {
 __published:
   void put(char c);
   void flush();
+  streampos tellp();
+  void seekp(streampos pos);
+  void seekp(streamoff off, ios_base::seekdir dir);
 };
-class istream {
+class istream : virtual public ios {
 __published:
   int get();
+  streampos tellg();
+  void seekg(streampos pos);
+  void seekg(streamoff off, ios_base::seekdir dir);
 };
 class iostream : public istream, public ostream {
 __published: