summaryrefslogtreecommitdiffstats
path: root/src/ftextstream.h
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-05-07 19:37:33 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-05-07 19:37:33 (GMT)
commit0fb3f32dfd7ac31a2677d76647700cd3fb730ef6 (patch)
tree58636054e8f52c5851109b908053cc4da26b060a /src/ftextstream.h
parent600fbfb8b03442ff97f4fb94964b2e0e11d14bd4 (diff)
downloadDoxygen-0fb3f32dfd7ac31a2677d76647700cd3fb730ef6.zip
Doxygen-0fb3f32dfd7ac31a2677d76647700cd3fb730ef6.tar.gz
Doxygen-0fb3f32dfd7ac31a2677d76647700cd3fb730ef6.tar.bz2
Release-1.6.3-20100507
Diffstat (limited to 'src/ftextstream.h')
-rw-r--r--src/ftextstream.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/ftextstream.h b/src/ftextstream.h
new file mode 100644
index 0000000..63ef244
--- /dev/null
+++ b/src/ftextstream.h
@@ -0,0 +1,82 @@
+#ifndef FTEXTSTREAM_H
+#define FTEXTSTREAM_H
+
+#include "qtbc.h"
+#include "qiodevice.h"
+#include "qstring.h"
+#include "qgstring.h"
+#include <stdio.h>
+
+/** @brief Simplified and optimized version of QTextStream */
+class FTextStream
+{
+ public:
+ FTextStream();
+ FTextStream( QIODevice * );
+ FTextStream( QGString * );
+ FTextStream( FILE * );
+ virtual ~FTextStream();
+
+ QIODevice *device() const;
+ void setDevice( QIODevice * );
+ void unsetDevice();
+
+ FTextStream &operator<<( char );
+ FTextStream &operator<<( const char *);
+ FTextStream &operator<<( const QString & );
+ FTextStream &operator<<( const QCString & );
+ FTextStream &operator<<( signed short );
+ FTextStream &operator<<( unsigned short );
+ FTextStream &operator<<( signed int );
+ FTextStream &operator<<( unsigned int );
+ FTextStream &operator<<( signed long );
+ FTextStream &operator<<( unsigned long );
+ FTextStream &operator<<( float );
+ FTextStream &operator<<( double );
+
+ private:
+ QIODevice *m_dev;
+ bool m_owndev;
+ FTextStream &output_int( ulong n, bool neg );
+
+ private: // Disabled copy constructor and operator=
+#if defined(Q_DISABLE_COPY)
+ FTextStream( const FTextStream & );
+ FTextStream &operator=( const FTextStream & );
+#endif
+};
+
+inline FTextStream &FTextStream::operator<<( char c)
+{
+ m_dev->putch(c);
+ return *this;
+}
+
+inline FTextStream &FTextStream::operator<<( const char* s)
+{
+ uint len = qstrlen( s );
+ m_dev->writeBlock( s, len );
+ return *this;
+}
+
+inline FTextStream &FTextStream::operator<<( const QString & s)
+{
+ return operator<<(s.data());
+}
+
+inline FTextStream &FTextStream::operator<<( const QCString &s)
+{
+ return operator<<(s.data());
+}
+
+typedef FTextStream & (*FTSFUNC)(FTextStream &);// manipulator function
+
+inline FTextStream &operator<<( FTextStream &s, FTSFUNC f )
+{ return (*f)( s ); }
+
+inline FTextStream &endl( FTextStream & s)
+{
+ return s << '\n';
+}
+
+#endif // FTEXTSTREAM_H