diff options
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/CORBA_String.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/CORBA_String.h | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/TAO/tao/CORBA_String.cpp b/TAO/tao/CORBA_String.cpp index aaa20da44ec..a0fe07ad895 100644 --- a/TAO/tao/CORBA_String.cpp +++ b/TAO/tao/CORBA_String.cpp @@ -31,9 +31,10 @@ istream & operator>> (istream &is, CORBA::String_var &sv) { is.seekg (0, ios::end); - sv = CORBA::string_alloc (static_cast<CORBA::ULong> (is.tellg ())); + std::streamsize const n = is.tellg (); + sv = CORBA::string_alloc (static_cast<CORBA::ULong> (n)); is.seekg (0, ios::beg); - is >> sv.inout (); + is.read (sv.inout (), n); return is; } @@ -48,12 +49,15 @@ istream & operator>> (istream &is, CORBA::String_out &so) { is.seekg (0, ios::end); - so = CORBA::string_alloc (static_cast<CORBA::ULong> (is.tellg ())); + std::streamsize const n = is.tellg (); + so = CORBA::string_alloc (static_cast<CORBA::ULong> (n)); is.seekg (0, ios::beg); - is >> so.ptr (); + is.read (so.ptr (), n); return is; } +#ifndef ACE_HAS_CPP20 + // Until we implement WString support for platforms with a // 4-byte wchar_t, we just define the following to emit // the CORBA::WChars one by one. @@ -136,6 +140,8 @@ operator>> (istream &is, CORBA::WString_out &wso) return is; } +#endif /* ACE_HAS_CPP20 */ + #endif /* ACE_LACKS_IOSTREAM_TOTALLY */ TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/CORBA_String.h b/TAO/tao/CORBA_String.h index 5e308bc9ad2..2338c9a03a4 100644 --- a/TAO/tao/CORBA_String.h +++ b/TAO/tao/CORBA_String.h @@ -273,6 +273,8 @@ TAO_Export ostream & operator<< (ostream &, CORBA::String_out &); TAO_Export istream & operator>> (istream &, CORBA::String_out &); + +# ifndef ACE_HAS_CPP20 TAO_Export ostream & operator<< (ostream &, const CORBA::WString_var &); TAO_Export istream & @@ -281,6 +283,7 @@ TAO_Export ostream & operator<< (ostream &, CORBA::WString_out &); TAO_Export istream & operator>> (istream &, CORBA::WString_out &); +# endif /* ACE_HAS_CPP20 */ # endif /* ACE_LACKS_IOSTREAM_TOTALLY */ |