#ifndef TextStream_h
#define TextStream_h
#include <wtf/Forward.h>
#include <wtf/text/StringBuilder.h>
namespace WebCore {
class IntPoint;
class IntRect;
class FloatPoint;
class FloatSize;
class LayoutPoint;
class LayoutRect;
class LayoutUnit;
class TextStream {
public:
struct FormatNumberRespectingIntegers {
FormatNumberRespectingIntegers(double number) : value(number) { }
double value;
};
TextStream& operator<<(bool);
TextStream& operator<<(int);
TextStream& operator<<(unsigned);
TextStream& operator<<(long);
TextStream& operator<<(unsigned long);
TextStream& operator<<(long long);
TextStream& operator<<(unsigned long long);
TextStream& operator<<(float);
TextStream& operator<<(double);
TextStream& operator<<(const char*);
TextStream& operator<<(const void*);
TextStream& operator<<(const String&);
TextStream& operator<<(const FormatNumberRespectingIntegers&);
TextStream& operator<<(const IntPoint&);
TextStream& operator<<(const IntRect&);
TextStream& operator<<(const FloatPoint&);
TextStream& operator<<(const FloatSize&);
TextStream& operator<<(const LayoutUnit&);
TextStream& operator<<(const LayoutPoint&);
TextStream& operator<<(const LayoutRect&);
template<typename Item>
TextStream& operator<<(const Vector<Item>& vector)
{
*this << "[";
unsigned size = vector.size();
for (unsigned i = 0; i < size; ++i) {
*this << vector[i];
if (i < size - 1)
*this << ", ";
}
return *this << "]";
}
String release();
private:
StringBuilder m_text;
};
void writeIndent(TextStream&, int indent);
}
#endif