summaryrefslogtreecommitdiff
path: root/ace/IOStream_T.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-06-02 01:33:11 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-06-02 01:33:11 +0000
commitcfce4ffb4ce9348de660d57b7d24a1c0399042a0 (patch)
treeffb9c1a959e9a6dc05d0f748eec2cc22de1a1a95 /ace/IOStream_T.cpp
parentb7cf66bbb06ea944b33864f6daf731d7e3ca3952 (diff)
downloadATCD-cfce4ffb4ce9348de660d57b7d24a1c0399042a0.tar.gz
James CE Johnson's changes to remove old comments and make shift operators on QuotedString a template
Diffstat (limited to 'ace/IOStream_T.cpp')
-rw-r--r--ace/IOStream_T.cpp42
1 files changed, 16 insertions, 26 deletions
diff --git a/ace/IOStream_T.cpp b/ace/IOStream_T.cpp
index 003ced1dbb5..813dc5a7e7f 100644
--- a/ace/IOStream_T.cpp
+++ b/ace/IOStream_T.cpp
@@ -132,56 +132,46 @@ ACE_IOStream_T<STREAM>::operator<< (ACE_IOStream_String & v)
// A more clever put operator for strings that knows how to
// deal with quoted strings containing back-quoted quotes.
//
-template <class STREAM> ACE_IOStream_T<STREAM> &
-ACE_IOStream_T<STREAM>::operator>> (QuotedString & str)
+template <class STREAM> STREAM &
+operator>> (STREAM & stream, QuotedString & str)
{
- if (ipfx0 ())
- {
char c;
- if (! (*this >> c)) // eat space up to the first char
- // this->set (ios::eofbit|ios::failbit);
- return *this;
+ if (! (stream >> c)) // eat space up to the first char
+ // stream.set (ios::eofbit|ios::failbit);
+ return stream;
str = ""; // Initialize the string
// if we don't have a quote, append until we see space
if (c != '"')
- for (str = c ; this->get (c) && !isspace (c) ; str += c)
+ for (str = c ; stream.get (c) && !isspace (c) ; str += c)
continue;
else
- for (; this->get (c) && c != '"' ; str += c)
+ for (; stream.get (c) && c != '"' ; str += c)
if (c == '\\')
{
- this->get (c);
+ stream.get (c);
if (c != '"')
str += '\\';
}
- }
-
- isfx ();
- return *this;
+ return stream;
}
-template <class STREAM> ACE_IOStream_T<STREAM> &
-ACE_IOStream_T<STREAM>::operator<< (QuotedString & str)
+template <class STREAM> STREAM &
+operator<< ( STREAM & stream, QuotedString & str)
{
- if (opfx ())
- {
- this->put ('"');
+ stream.put ('"');
for (u_int i = 0 ; i < str.length () ; ++i)
{
if (str[i] == '"')
- this->put ('\\');
- this->put (str[i]);
+ stream.put ('\\');
+ stream.put (str[i]);
}
- this->put ('"');
- }
+ stream.put ('"');
- osfx ();
-
- return *this;
+ return stream;
}
#endif /* ACE_HAS_STRING_CLASS */