diff options
Diffstat (limited to 'TAO/tao/CORBA_String.cpp')
-rw-r--r-- | TAO/tao/CORBA_String.cpp | 14 |
1 files changed, 10 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 |