open_toontown_panda3d/dtool/src/parser-inc/iostream

134 lines
3.0 KiB
Plaintext

// Filename: iostream
// Created by: drose (12May00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.
#ifndef IOSTREAM_H
#define IOSTREAM_H
#include <stdtypedefs.h>
#ifdef _WIN64
typedef long long streamoff;
typedef long long streamsize;
#elif defined(_WIN32)
typedef long streamoff;
typedef int streamsize;
#else
typedef long long streamoff;
typedef ptrdiff_t streamsize;
#endif
// 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.
// 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,
};
enum openmode {
};
// Don't define these lest interrogate get tempted to actually
// substitute in the values, which are implementation-defined.
static const openmode app;
static const openmode binary;
static const openmode in;
static const openmode out;
static const openmode trunc;
protected:
// Force this to be a non-trivial type.
ios_base() {};
private:
ios_base(const ios_base &);
};
class ios : public ios_base {
__published:
typedef long fmtflags;
bool good() const;
bool eof() const;
bool fail() const;
bool bad() const;
void clear();
protected:
ios();
};
// We actually want to wrap streampos as streamoff.
#define streampos streamoff
class ostream : virtual public ios {
__published:
ostream(const ostream&) = delete;
void put(char c);
void flush();
streampos tellp();
void seekp(streampos pos);
void seekp(streamoff off, ios_base::seekdir dir);
};
class istream : virtual public ios {
__published:
istream(const istream&) = delete;
int get();
streampos tellg();
void seekg(streampos pos);
void seekg(streamoff off, ios_base::seekdir dir);
};
class iostream : public istream, public ostream {
__published:
iostream(const iostream&) = delete;
void flush();
};
class ofstream : public ostream {
__published:
ofstream();
void close();
};
class ifstream : public istream {
__published:
ifstream();
void close();
};
class fstream : public iostream {
__published:
fstream();
void close();
};
class ostringstream : public ostream {};
class istringstream : public istream {};
class stringstream : public iostream {};
class streambuf {};
extern istream cin;
extern ostream cout;
extern ostream cerr;
#endif