//Auto-generated by kalyptus. DO NOT EDIT.
namespace Qyoto {
    using System;
    using System.Runtime.InteropServices;
    [SmokeClass("QDataStream")]
    public class QDataStream : Object, IDisposable {
        protected SmokeInvocation interceptor = null;
        private IntPtr smokeObject;
        protected QDataStream(Type dummy) {}
        protected void CreateProxy() {
            interceptor = new SmokeInvocation(typeof(QDataStream), this);
        }
        public enum Version {
            Qt_1_0 = 1,
            Qt_2_0 = 2,
            Qt_2_1 = 3,
            Qt_3_0 = 4,
            Qt_3_1 = 5,
            Qt_3_3 = 6,
            Qt_4_0 = 7,
            Qt_4_1 = Qt_4_0,
            Qt_4_2 = 8,
            Qt_4_3 = 9,
            Qt_4_4 = 10,
            Qt_4_5 = 11,
        }
        public enum Status {
            Ok = 0,
            ReadPastEnd = 1,
            ReadCorruptData = 2,
        }
        // ByteOrder byteOrder(); >>>> NOT CONVERTED
        // void setByteOrder(ByteOrder arg1); >>>> NOT CONVERTED
        // QDataStream& operator<<(signed char arg1); >>>> NOT CONVERTED
        // QDataStream& operator<<(quint64 arg1); >>>> NOT CONVERTED
        public QDataStream() : this((Type) null) {
            CreateProxy();
            interceptor.Invoke("QDataStream", "QDataStream()", typeof(void));
        }
        public QDataStream(QIODevice arg1) : this((Type) null) {
            CreateProxy();
            interceptor.Invoke("QDataStream#", "QDataStream(QIODevice*)", typeof(void), typeof(QIODevice), arg1);
        }
        public QDataStream(QByteArray arg1, uint flags) : this((Type) null) {
            CreateProxy();
            interceptor.Invoke("QDataStream#$", "QDataStream(QByteArray*, QIODevice::OpenMode)", typeof(void), typeof(QByteArray), arg1, typeof(uint), flags);
        }
        public QDataStream(QByteArray arg1) : this((Type) null) {
            CreateProxy();
            interceptor.Invoke("QDataStream#", "QDataStream(const QByteArray&)", typeof(void), typeof(QByteArray), arg1);
        }
        public QIODevice Device() {
            return (QIODevice) interceptor.Invoke("device", "device() const", typeof(QIODevice));
        }
        public void SetDevice(QIODevice arg1) {
            interceptor.Invoke("setDevice#", "setDevice(QIODevice*)", typeof(void), typeof(QIODevice), arg1);
        }
        public void UnsetDevice() {
            interceptor.Invoke("unsetDevice", "unsetDevice()", typeof(void));
        }
        public bool AtEnd() {
            return (bool) interceptor.Invoke("atEnd", "atEnd() const", typeof(bool));
        }
        public QDataStream.Status status() {
            return (QDataStream.Status) interceptor.Invoke("status", "status() const", typeof(QDataStream.Status));
        }
        public void SetStatus(QDataStream.Status status) {
            interceptor.Invoke("setStatus$", "setStatus(QDataStream::Status)", typeof(void), typeof(QDataStream.Status), status);
        }
        public void ResetStatus() {
            interceptor.Invoke("resetStatus", "resetStatus()", typeof(void));
        }
        public int version() {
            return (int) interceptor.Invoke("version", "version() const", typeof(int));
        }
        public void SetVersion(int arg1) {
            interceptor.Invoke("setVersion$", "setVersion(int)", typeof(void), typeof(int), arg1);
        }
        public QDataStream Read(Pointer<sbyte> i) {
            return (QDataStream) interceptor.Invoke("operator>>$", "operator>>(signed char&)", typeof(QDataStream), typeof(Pointer<sbyte>), i);
        }
        public QDataStream Read(Pointer<byte> i) {
            return (QDataStream) interceptor.Invoke("operator>>$", "operator>>(unsigned char&)", typeof(QDataStream), typeof(Pointer<byte>), i);
        }
        public QDataStream Read(ref short i) {
            StackItem[] stack = new StackItem[2];
            stack[1].s_short = i;
            interceptor.Invoke("operator>>$", "operator>>(short&)", stack);
            i = stack[1].s_short;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
#if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
#else
            ((GCHandle) stack[0].s_class).SynchronizedFree();
#endif
            return (QDataStream) returnValue;
        }
        public QDataStream Read(ref int i) {
            StackItem[] stack = new StackItem[2];
            stack[1].s_int = i;
            interceptor.Invoke("operator>>$", "operator>>(int&)", stack);
            i = stack[1].s_int;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
#if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
#else
            ((GCHandle) stack[0].s_class).SynchronizedFree();
#endif
            return (QDataStream) returnValue;
        }
        public QDataStream Read(ref long i) {
            StackItem[] stack = new StackItem[2];
            stack[1].s_long = i;
            interceptor.Invoke("operator>>?", "operator>>(qint64&)", stack);
            i = stack[1].s_long;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
#if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
#else
            ((GCHandle) stack[0].s_class).SynchronizedFree();
#endif
            return (QDataStream) returnValue;
        }
        public QDataStream Read(ref ulong i) {
            StackItem[] stack = new StackItem[2];
            stack[1].s_ulong = i;
            interceptor.Invoke("operator>>?", "operator>>(quint64&)", stack);
            i = stack[1].s_ulong;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
#if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
#else
            ((GCHandle) stack[0].s_class).SynchronizedFree();
#endif
            return (QDataStream) returnValue;
        }
        public QDataStream Read(bool i) {
            return (QDataStream) interceptor.Invoke("operator>>$", "operator>>(bool&)", typeof(QDataStream), typeof(bool), i);
        }
        public QDataStream Read(ref float f) {
            StackItem[] stack = new StackItem[2];
            stack[1].s_float = f;
            interceptor.Invoke("operator>>$", "operator>>(float&)", stack);
            f = stack[1].s_float;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
#if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
#else
            ((GCHandle) stack[0].s_class).SynchronizedFree();
#endif
            return (QDataStream) returnValue;
        }
        public QDataStream Read(ref double f) {
            StackItem[] stack = new StackItem[2];
            stack[1].s_double = f;
            interceptor.Invoke("operator>>$", "operator>>(double&)", stack);
            f = stack[1].s_double;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
#if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
#else
            ((GCHandle) stack[0].s_class).SynchronizedFree();
#endif
            return (QDataStream) returnValue;
        }
        public QDataStream Write(ushort i) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(unsigned char)", typeof(QDataStream), typeof(ushort), i);
        }
        public QDataStream Write(short i) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(short)", typeof(QDataStream), typeof(short), i);
        }
        public QDataStream Write(int i) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(int)", typeof(QDataStream), typeof(int), i);
        }
        public QDataStream Write(uint i) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(unsigned int)", typeof(QDataStream), typeof(uint), i);
        }
        public QDataStream Write(long i) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(qint64)", typeof(QDataStream), typeof(long), i);
        }
        public QDataStream Write(bool i) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(bool)", typeof(QDataStream), typeof(bool), i);
        }
        public QDataStream Write(float f) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(float)", typeof(QDataStream), typeof(float), f);
        }
        public QDataStream Write(double f) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(double)", typeof(QDataStream), typeof(double), f);
        }
        public QDataStream Write(string str) {
            return (QDataStream) interceptor.Invoke("operator<<$", "operator<<(const char*)", typeof(QDataStream), typeof(string), str);
        }
        public QDataStream ReadBytes(Pointer<sbyte> arg1, uint len) {
            return (QDataStream) interceptor.Invoke("readBytes?$", "readBytes(char*&, uint&)", typeof(QDataStream), typeof(Pointer<sbyte>), arg1, typeof(uint), len);
        }
        public int ReadRawData(Pointer<sbyte> arg1, int len) {
            return (int) interceptor.Invoke("readRawData$$", "readRawData(char*, int)", typeof(int), typeof(Pointer<sbyte>), arg1, typeof(int), len);
        }
        public QDataStream WriteBytes(string arg1, uint len) {
            return (QDataStream) interceptor.Invoke("writeBytes$$", "writeBytes(const char*, uint)", typeof(QDataStream), typeof(string), arg1, typeof(uint), len);
        }
        public int WriteRawData(string arg1, int len) {
            return (int) interceptor.Invoke("writeRawData$$", "writeRawData(const char*, int)", typeof(int), typeof(string), arg1, typeof(int), len);
        }
        public int SkipRawData(int len) {
            return (int) interceptor.Invoke("skipRawData$", "skipRawData(int)", typeof(int), typeof(int), len);
        }
        ~QDataStream() {
            interceptor.Invoke("~QDataStream", "~QDataStream()", typeof(void));
        }
        public void Dispose() {
            interceptor.Invoke("~QDataStream", "~QDataStream()", typeof(void));
        }
    }
}
