#include "tao/CORBA_String.h"
#include "tao/String_Manager_T.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_wchar.h"
#include "ace/OS_Memory.h"
#include "ace/streams.h"
#include "tao/CORBA_String.inl"
Include dependency graph for CORBA_String.cpp:
Go to the source code of this file.
Functions | |
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ostream & | operator<< (ostream &os, const CORBA::String_var &sv) |
istream & | operator>> (istream &is, CORBA::String_var &sv) |
ostream & | operator<< (ostream &os, CORBA::String_out &so) |
istream & | operator>> (istream &is, CORBA::String_out &so) |
ostream & | operator<< (ostream &os, const CORBA::WString_var &wsv) |
istream & | operator>> (istream &is, CORBA::WString_var &wsv) |
ostream & | operator<< (ostream &os, CORBA::WString_out &wso) |
istream & | operator>> (istream &is, CORBA::WString_out &wso) |
ostream& operator<< | ( | ostream & | os, | |
CORBA::WString_out & | wso | |||
) |
Definition at line 105 of file CORBA_String.cpp.
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 }
ostream& operator<< | ( | ostream & | os, | |
const CORBA::WString_var & | wsv | |||
) |
Definition at line 66 of file CORBA_String.cpp.
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 }
ostream& operator<< | ( | ostream & | os, | |
CORBA::String_out & | so | |||
) |
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ostream& operator<< | ( | ostream & | os, | |
const CORBA::String_var & | sv | |||
) |
istream& operator>> | ( | istream & | is, | |
CORBA::WString_out & | wso | |||
) |
Definition at line 119 of file CORBA_String.cpp.
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 }
istream& operator>> | ( | istream & | is, | |
CORBA::WString_var & | wsv | |||
) |
Definition at line 80 of file CORBA_String.cpp.
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 }
istream& operator>> | ( | istream & | is, | |
CORBA::String_out & | so | |||
) |
Definition at line 52 of file CORBA_String.cpp.
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 }
istream& operator>> | ( | istream & | is, | |
CORBA::String_var & | sv | |||
) |
Definition at line 35 of file CORBA_String.cpp.
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 }