diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-06-27 10:31:04 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-06-27 10:31:04 +0000 |
commit | ef95e6e22027b19d9f620588fc4f37508436d280 (patch) | |
tree | c713a1fd3ec2603fd230c5ae4221032ec3e326a6 /TAO/tao/CDR.inl | |
parent | b8bce995b418b0072fe82316ea1aba1ed3d8d84a (diff) | |
download | ATCD-ef95e6e22027b19d9f620588fc4f37508436d280.tar.gz |
ChangeLogTag: Mon Jun 27 10:28:15 UTC 2011 Martin Corino <mcorino@remedy.nl>
Diffstat (limited to 'TAO/tao/CDR.inl')
-rw-r--r-- | TAO/tao/CDR.inl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/TAO/tao/CDR.inl b/TAO/tao/CDR.inl index 13ec26dc110..1d22b697b14 100644 --- a/TAO/tao/CDR.inl +++ b/TAO/tao/CDR.inl @@ -329,6 +329,23 @@ TAO_InputCDR::reset_vt_indirect_maps () } } +ACE_INLINE +TAO_InputCDR::to_std_string::to_std_string (std::string &s, + ACE_CDR::ULong b) + : val_ (s), + bound_ (b) +{ +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE +TAO_InputCDR::to_std_wstring::to_std_wstring (std::wstring &s, + ACE_CDR::ULong b) + : val_ (s), + bound_ (b) +{ +} +#endif /* ACE_LACKS_STD_WSTRING */ // **************************************************************** @@ -461,6 +478,14 @@ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, return os << x.c_str (); } +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, + const std::wstring &x) +{ + return os << x.c_str (); +} +#endif /* ACE_LACKS_STD_WSTRING */ + // **************************************************************** ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, @@ -565,4 +590,40 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, return marshal_flag; } +ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, + TAO_InputCDR::to_std_string x) +{ + CORBA::Boolean const marshal_flag = + is >> x.val_; + if (marshal_flag && x.bound_ != 0 && x.val_.size () > x.bound_) + { + throw ::CORBA::BAD_PARAM (); + } + return marshal_flag; +} + +#if !defined(ACE_LACKS_STD_WSTRING) +ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, + std::wstring &x) +{ + CORBA::WChar *buf = 0; + CORBA::Boolean const marshal_flag = is >> buf; + x.assign (buf); + ACE::strdelete (buf); + return marshal_flag; +} + +ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, + TAO_InputCDR::to_std_wstring x) +{ + CORBA::Boolean const marshal_flag = + is >> x.val_; + if (marshal_flag && x.bound_ != 0 && x.val_.size () > x.bound_) + { + throw ::CORBA::BAD_PARAM (); + } + return marshal_flag; +} +#endif /* ACE_LACKS_STD_WSTRING */ + TAO_END_VERSIONED_NAMESPACE_DECL |