V8 Project
v8::internal::OStream Class Referenceabstract

#include <ostreams.h>

+ Inheritance diagram for v8::internal::OStream:
+ Collaboration diagram for v8::internal::OStream:

Public Member Functions

 OStream ()
 
virtual ~OStream ()
 
OStreamoperator<< (OStream &(*manipulator)(OStream &os))
 
OStreamoperator<< (short x)
 
OStreamoperator<< (unsigned short x)
 
OStreamoperator<< (int x)
 
OStreamoperator<< (unsigned int x)
 
OStreamoperator<< (long x)
 
OStreamoperator<< (unsigned long x)
 
OStreamoperator<< (long long x)
 
OStreamoperator<< (unsigned long long x)
 
OStreamoperator<< (double x)
 
OStreamoperator<< (void *x)
 
OStreamoperator<< (char x)
 
OStreamoperator<< (signed char x)
 
OStreamoperator<< (unsigned char x)
 
OStreamoperator<< (const char *s)
 
OStreamput (char c)
 
OStreamdec ()
 
OStreamhex ()
 
virtual OStreamwrite (const char *s, size_t n)=0
 
virtual OStreamflush ()=0
 

Private Member Functions

template<class T >
OStreamprint (const char *format, T x)
 
 DISALLOW_COPY_AND_ASSIGN (OStream)
 

Private Attributes

bool hex_
 

Detailed Description

Definition at line 19 of file ostreams.h.

Constructor & Destructor Documentation

◆ OStream()

v8::internal::OStream::OStream ( )
inline

Definition at line 21 of file ostreams.h.

21 : hex_(false) { }

◆ ~OStream()

virtual v8::internal::OStream::~OStream ( )
inlinevirtual

Definition at line 22 of file ostreams.h.

22 { }

Member Function Documentation

◆ dec()

OStream & v8::internal::OStream::dec ( )

Definition at line 95 of file ostreams.cc.

95  {
96  hex_ = false;
97  return *this;
98 }

References hex_.

Referenced by v8::internal::dec().

+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::OStream::DISALLOW_COPY_AND_ASSIGN ( OStream  )
private

◆ flush()

virtual OStream& v8::internal::OStream::flush ( )
pure virtual

Implemented in v8::internal::OFStream, and v8::internal::OStringStream.

Referenced by v8::internal::flush().

+ Here is the caller graph for this function:

◆ hex()

OStream & v8::internal::OStream::hex ( )

Definition at line 101 of file ostreams.cc.

101  {
102  hex_ = true;
103  return *this;
104 }

References hex_.

Referenced by v8::internal::hex().

+ Here is the caller graph for this function:

◆ operator<<() [1/15]

OStream & v8::internal::OStream::operator<< ( char  x)

Definition at line 80 of file ostreams.cc.

80  {
81  return put(x);
82 }
OStream & put(char c)
Definition: ostreams.h:46

References put().

+ Here is the call graph for this function:

◆ operator<<() [2/15]

OStream& v8::internal::OStream::operator<< ( const char *  s)
inline

Definition at line 45 of file ostreams.h.

45 { return write(s, strlen(s)); }
virtual OStream & write(const char *s, size_t n)=0

References write().

+ Here is the call graph for this function:

◆ operator<<() [3/15]

OStream & v8::internal::OStream::operator<< ( double  x)

Definition at line 68 of file ostreams.cc.

68  {
69  if (std::isinf(x)) return *this << (x < 0 ? "-inf" : "inf");
70  if (std::isnan(x)) return *this << "nan";
71  return print("%g", x);
72 }
OStream & print(const char *format, T x)
Definition: ostreams.cc:21

References print().

+ Here is the call graph for this function:

◆ operator<<() [4/15]

OStream & v8::internal::OStream::operator<< ( int  x)

Definition at line 38 of file ostreams.cc.

38  {
39  return print(hex_ ? "%x" : "%d", x);
40 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [5/15]

OStream & v8::internal::OStream::operator<< ( long long  x)

Definition at line 58 of file ostreams.cc.

58  { // NOLINT(runtime/int)
59  return print(hex_ ? "%llx" : "%lld", x);
60 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [6/15]

OStream & v8::internal::OStream::operator<< ( long  x)

Definition at line 48 of file ostreams.cc.

48  { // NOLINT(runtime/int)
49  return print(hex_ ? "%lx" : "%ld", x);
50 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [7/15]

OStream& v8::internal::OStream::operator<< ( OStream &(*)(OStream &os)  manipulator)
inline

Definition at line 25 of file ostreams.h.

25  {
26  return manipulator(*this);
27  }

◆ operator<<() [8/15]

OStream & v8::internal::OStream::operator<< ( short  x)

Definition at line 28 of file ostreams.cc.

28  { // NOLINT(runtime/int)
29  return print(hex_ ? "%hx" : "%hd", x);
30 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [9/15]

OStream & v8::internal::OStream::operator<< ( signed char  x)

Definition at line 85 of file ostreams.cc.

85  {
86  return put(x);
87 }

References put().

+ Here is the call graph for this function:

◆ operator<<() [10/15]

OStream & v8::internal::OStream::operator<< ( unsigned char  x)

Definition at line 90 of file ostreams.cc.

90  {
91  return put(x);
92 }

References put().

+ Here is the call graph for this function:

◆ operator<<() [11/15]

OStream & v8::internal::OStream::operator<< ( unsigned int  x)

Definition at line 43 of file ostreams.cc.

43  {
44  return print(hex_ ? "%x" : "%u", x);
45 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [12/15]

OStream & v8::internal::OStream::operator<< ( unsigned long long  x)

Definition at line 63 of file ostreams.cc.

63  { // NOLINT(runtime/int)
64  return print(hex_ ? "%llx" : "%llu", x);
65 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [13/15]

OStream & v8::internal::OStream::operator<< ( unsigned long  x)

Definition at line 53 of file ostreams.cc.

53  { // NOLINT(runtime/int)
54  return print(hex_ ? "%lx" : "%lu", x);
55 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [14/15]

OStream & v8::internal::OStream::operator<< ( unsigned short  x)

Definition at line 33 of file ostreams.cc.

33  { // NOLINT(runtime/int)
34  return print(hex_ ? "%hx" : "%hu", x);
35 }

References hex_, and print().

+ Here is the call graph for this function:

◆ operator<<() [15/15]

OStream & v8::internal::OStream::operator<< ( void *  x)

Definition at line 75 of file ostreams.cc.

75  {
76  return print("%p", x);
77 }

References print().

+ Here is the call graph for this function:

◆ print()

template<class T >
OStream & v8::internal::OStream::print ( const char *  format,
T  x 
)
private

Definition at line 21 of file ostreams.cc.

21  {
22  char buf[32];
23  int n = snprintf(buf, sizeof(buf), format, x);
24  return (n < 0) ? *this : write(buf, n);
25 }

References write().

Referenced by operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ put()

OStream& v8::internal::OStream::put ( char  c)
inline

Definition at line 46 of file ostreams.h.

46 { return write(&c, 1); }

References write().

Referenced by v8::internal::endl(), and operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write()

virtual OStream& v8::internal::OStream::write ( const char *  s,
size_t  n 
)
pure virtual

Implemented in v8::internal::OFStream, and v8::internal::OStringStream.

Referenced by operator<<(), print(), and put().

+ Here is the caller graph for this function:

Member Data Documentation

◆ hex_

bool v8::internal::OStream::hex_
private

Definition at line 58 of file ostreams.h.

Referenced by dec(), hex(), and operator<<().


The documentation for this class was generated from the following files: