CORBA_String.h File Reference

#include "tao/TAO_Export.h"
#include "tao/Basic_Types.h"
#include "tao/String_Traits_Base_T.h"
#include "ace/iosfwd.h"
#include <algorithm>
#include "tao/CORBA_String.inl"

Include dependency graph for CORBA_String.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  TAO
namespace  CORBA

Functions

TAO_Export ostream & operator<< (ostream &, const CORBA::String_var &)
TAO_Export istream & operator>> (istream &, CORBA::String_var &)
TAO_Export ostream & operator<< (ostream &, CORBA::String_out &)
TAO_Export istream & operator>> (istream &, CORBA::String_out &)
TAO_Export ostream & operator<< (ostream &, const CORBA::WString_var &)
TAO_Export istream & operator>> (istream &, CORBA::WString_var &)
TAO_Export ostream & operator<< (ostream &, CORBA::WString_out &)
TAO_Export istream & operator>> (istream &, CORBA::WString_out &)


Detailed Description

CORBA_String.h,v 1.17 2006/04/19 08:34:34 jwillemsen Exp

Header file for the CORBA string types.

Author:
DOC Group at Wash U, UCI, and Vanderbilt U.

Definition in file CORBA_String.h.


Function Documentation

TAO_Export ostream& operator<< ostream &  ,
CORBA::WString_out
 

Definition at line 105 of file CORBA_String.cpp.

References TAO::String_out< charT >::ptr(), ACE_OS::strlen(), and CORBA::WString_out.

00106 {
00107   CORBA::WChar *tmp = wso.ptr ();
00108   const size_t len = ACE_OS::strlen (tmp);
00109 
00110   for (size_t i = 0; i < len; ++i)
00111     {
00112       os << tmp[i];
00113     }
00114 
00115   return os;
00116 }

TAO_Export ostream& operator<< ostream &  ,
const CORBA::WString_var
 

Definition at line 66 of file CORBA_String.cpp.

References TAO::String_var< charT >::in(), ACE_OS::strlen(), and CORBA::WString_var.

00067 {
00068   CORBA::ULong const len =
00069     static_cast <CORBA::ULong> (ACE_OS::strlen (wsv.in ()));
00070 
00071   for (CORBA::ULong i = 0; i < len; ++i)
00072     {
00073       os << wsv[i];
00074     }
00075 
00076   return os;
00077 }

TAO_Export ostream& operator<< ostream &  ,
CORBA::String_out
 

Definition at line 45 of file CORBA_String.cpp.

References TAO::String_out< charT >::ptr(), and CORBA::String_out.

00046 {
00047   os << so.ptr ();
00048   return os;
00049 }

TAO_Export ostream& operator<< ostream &  ,
const CORBA::String_var
 

Definition at line 28 of file CORBA_String.cpp.

References TAO::String_var< charT >::in(), and CORBA::String_var.

00029 {
00030   os << sv.in ();
00031   return os;
00032 }

TAO_Export istream& operator>> istream &  ,
CORBA::WString_out
 

Definition at line 119 of file CORBA_String.cpp.

References TAO::String_out< charT >::ptr(), CORBA::wstring_alloc(), and CORBA::WString_out.

00120 {
00121   is.seekg (0, ios::end);
00122   // @@ is.tellg()/sizeof(CORBA::WChar) instead?
00123   const CORBA::ULong len = is.tellg ();
00124   wso = CORBA::wstring_alloc (len);
00125   is.seekg (0, ios::beg);
00126 
00127   for (CORBA::ULong i = 0; i < len; ++i)
00128     {
00129       CORBA::WChar wc = 0;
00130 
00131       // Unformatted input is used to work around overloaded
00132       // extraction operator (>>) ambiguities on some platforms.
00133       is.read (reinterpret_cast<char *> (&wc), sizeof (wc));
00134 
00135       wso.ptr ()[i] = wc;
00136     }
00137 
00138   wso.ptr ()[len] = 0;  // NULL terminate
00139 
00140   return is;
00141 }

TAO_Export istream& operator>> istream &  ,
CORBA::WString_var
 

Definition at line 80 of file CORBA_String.cpp.

References CORBA::wstring_alloc(), and CORBA::WString_var.

00081 {
00082   is.seekg (0, ios::end);
00083   // @@ is.tellg()/sizeof(CORBA::WChar) instead?
00084   CORBA::ULong const len = is.tellg ();
00085   wsv = CORBA::wstring_alloc (len);
00086   is.seekg (0, ios::beg);
00087 
00088   for (CORBA::ULong i = 0; i < len; ++i)
00089     {
00090       CORBA::WChar wc = 0;
00091 
00092       // Unformatted input is used to work around overloaded
00093       // extraction operator (>>) ambiguities on some platforms.
00094       is.read (reinterpret_cast<char *> (&wc), sizeof (wc));
00095 
00096       wsv[i] = wc;
00097     }
00098 
00099   wsv[len] = 0;  // NULL terminate
00100 
00101   return is;
00102 }

TAO_Export istream& operator>> istream &  ,
CORBA::String_out
 

Definition at line 52 of file CORBA_String.cpp.

References TAO::String_out< charT >::ptr(), CORBA::string_alloc(), and CORBA::String_out.

00053 {
00054   is.seekg (0, ios::end);
00055   so = CORBA::string_alloc (is.tellg ());
00056   is.seekg (0, ios::beg);
00057   is >> so.ptr ();
00058   return is;
00059 }

TAO_Export istream& operator>> istream &  ,
CORBA::String_var
 

Definition at line 35 of file CORBA_String.cpp.

References TAO::String_var< charT >::inout(), CORBA::string_alloc(), and CORBA::String_var.

00036 {
00037   is.seekg (0, ios::end);
00038   sv = CORBA::string_alloc (is.tellg ());
00039   is.seekg (0, ios::beg);
00040   is >> sv.inout ();
00041   return is;
00042 }


Generated on Thu Nov 9 11:57:27 2006 for TAO by doxygen 1.3.6