ReactOS 0.4.16-dev-237-gd6eebaa
complex_io.cpp File Reference
#include "stlport_prefix.h"
#include <complex>
#include <istream>
Include dependency graph for complex_io.cpp:

Go to the source code of this file.

Functions

_STLP_BEGIN_NAMESPACE _STLP_OPERATOR_SPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< (basic_ostream< char, char_traits< char > > &__os, const complex< float > &__z)
 
_STLP_OPERATOR_SPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< (basic_ostream< char, char_traits< char > > &__os, const complex< double > &__z)
 
_STLP_OPERATOR_SPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< (basic_ostream< char, char_traits< char > > &__os, const complex< long double > &__z)
 
_STLP_OPERATOR_SPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> (basic_istream< char, char_traits< char > > &__is, complex< float > &__z)
 
_STLP_OPERATOR_SPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> (basic_istream< char, char_traits< char > > &__is, complex< double > &__z)
 
_STLP_OPERATOR_SPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> (basic_istream< char, char_traits< char > > &__is, complex< long double > &__z)
 
_STLP_OPERATOR_SPEC basic_istream< wchar_t, char_traits< wchar_t > > &_STLP_CALL operator>> (basic_istream< wchar_t, char_traits< wchar_t > > &, complex< float > &)
 
_STLP_OPERATOR_SPEC basic_istream< wchar_t, char_traits< wchar_t > > &_STLP_CALL operator>> (basic_istream< wchar_t, char_traits< wchar_t > > &, complex< double > &)
 
_STLP_OPERATOR_SPEC basic_istream< wchar_t, char_traits< wchar_t > > &_STLP_CALL operator>> (basic_istream< wchar_t, char_traits< wchar_t > > &, complex< long double > &)
 
_STLP_OPERATOR_SPEC basic_ostream< wchar_t, char_traits< wchar_t > > &_STLP_CALL operator<< (basic_ostream< wchar_t, char_traits< wchar_t > > &, const complex< long double > &)
 
_STLP_OPERATOR_SPEC basic_ostream< wchar_t, char_traits< wchar_t > > &_STLP_CALL operator<< (basic_ostream< wchar_t, char_traits< wchar_t > > &, const complex< float > &)
 
_STLP_OPERATOR_SPEC basic_ostream< wchar_t, char_traits< wchar_t > > &_STLP_CALL operator<< (basic_ostream< wchar_t, char_traits< wchar_t > > &, const complex< double > &)
 

Function Documentation

◆ operator<<() [1/6]

_STLP_OPERATOR_SPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< ( basic_ostream< char, char_traits< char > > &  __os,
const complex< double > &  __z 
)

Definition at line 34 of file complex_io.cpp.

36{ return __os << '(' << __z.real() << ',' << __z.imag() << ')'; }
value_type imag() const
Definition: _complex.h:335
value_type real() const
Definition: _complex.h:334

◆ operator<<() [2/6]

Definition at line 29 of file complex_io.cpp.

31{ return __os << '(' << (double)__z.real() << ',' << (double)__z.imag() << ')'; }
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
value_type real() const
Definition: _complex.h:195
value_type imag() const
Definition: _complex.h:196

◆ operator<<() [3/6]

_STLP_OPERATOR_SPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< ( basic_ostream< char, char_traits< char > > &  __os,
const complex< long double > &  __z 
)

Definition at line 40 of file complex_io.cpp.

42{ return __os << '(' << __z.real() << ',' << __z.imag() << ')'; }
value_type real() const
Definition: _complex.h:472
value_type imag() const
Definition: _complex.h:473

◆ operator<<() [4/6]

◆ operator<<() [5/6]

◆ operator<<() [6/6]

◆ operator>>() [1/6]

_STLP_OPERATOR_SPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> ( basic_istream< char, char_traits< char > > &  __is,
complex< double > &  __z 
)

Definition at line 74 of file complex_io.cpp.

74 {
75 double __re = 0;
76 double __im = 0;
77
78 char __c;
79
80 __is >> __c;
81 if (__c == '(') {
82 __is >> __re >> __c;
83 if (__c == ',')
84 __is >> __im >> __c;
85 if (__c != ')')
86 __is.setstate(ios_base::failbit);
87 }
88 else {
89 __is.putback(__c);
90 __is >> __re;
91 }
92
93 if (__is)
94 __z = complex<double>(__re, __im);
95 return __is;
96}
void setstate(iostate __state)
Definition: _ios.h:95
_Self & putback(char_type __c)
Definition: _istream.c:422
#define __c
Definition: schilyio.h:209

◆ operator>>() [2/6]

_STLP_OPERATOR_SPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> ( basic_istream< char, char_traits< char > > &  __is,
complex< float > &  __z 
)

Definition at line 48 of file complex_io.cpp.

48 {
49 float __re = 0;
50 float __im = 0;
51
52 char __c;
53
54 __is >> __c;
55 if (__c == '(') {
56 __is >> __re >> __c;
57 if (__c == ',')
58 __is >> __im >> __c;
59 if (__c != ')')
60 __is.setstate(ios_base::failbit);
61 }
62 else {
63 __is.putback(__c);
64 __is >> __re;
65 }
66
67 if (__is)
68 __z = complex<float>(__re, __im);
69 return __is;
70}

◆ operator>>() [3/6]

_STLP_OPERATOR_SPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> ( basic_istream< char, char_traits< char > > &  __is,
complex< long double > &  __z 
)

Definition at line 101 of file complex_io.cpp.

101 {
102 long double __re = 0;
103 long double __im = 0;
104
105 char __c;
106
107 __is >> __c;
108 if (__c == '(') {
109 __is >> __re >> __c;
110 if (__c == ',')
111 __is >> __im >> __c;
112 if (__c != ')')
113 __is.setstate(ios_base::failbit);
114 }
115 else {
116 __is.putback(__c);
117 __is >> __re;
118 }
119
120 if (__is)
121 __z = complex<long double>(__re, __im);
122 return __is;
123}

◆ operator>>() [4/6]

◆ operator>>() [5/6]

◆ operator>>() [6/6]