diff options
author | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-27 18:59:03 +0000 |
---|---|---|
committer | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-27 18:59:03 +0000 |
commit | 10c2818bc889d3fdc46e1fbd060882823532d52a (patch) | |
tree | 954c69820962bf96367bf3c750c644789f00a261 | |
parent | 5dbcfec5f0b31402f09ed0d123d6a2709ab57234 (diff) | |
download | ATCD-10c2818bc889d3fdc46e1fbd060882823532d52a.tar.gz |
Sat Nov 27 12:52:57 2004 Ciju John <john_c@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 10 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp | 50 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp | 15 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp | 2 |
6 files changed, 42 insertions, 40 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 3e7ac5503a0..8e1f20f3bb8 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,13 @@ +Sat Nov 27 12:52:57 2004 Ciju John <john_c@ociweb.com> + + * orbsvcs/orbsvcs/Notify/XML_Loader.h: + * orbsvcs/orbsvcs/Notify/XML_Saver.cpp: + * orbsvcs/orbsvcs/Notify/XML_Saver.h: + * orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp: + * orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp: + Fixed problems with use of iostreams for + ACE_LACKS_IOSTREAM_TOTALLY builds (VxWorks DIAB). + Sat Nov 27 14:34:12 UTC 2004 Martin Corino <mcorino@remedy.nl> * utils/examples/mfc/client.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h b/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h index a56dd98809a..7e35e9cae55 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h +++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h @@ -33,7 +33,6 @@ namespace TAO_Notify { - /// \brief Load Notification Service Topology from an XML file. class XML_Loader : public ACEXML_DefaultHandler , public Topology_Loader { @@ -72,7 +71,7 @@ private: /// The name of the file from which data is read. ACE_CString file_name_; /// A stream representing our current output. - istream * input_; + FILE * input_; typedef ACE_Unbounded_Stack<Topology_Object*> TopoStack; TopoStack object_stack_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp index 7d968ee0290..ff54c6072bc 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp @@ -42,7 +42,7 @@ namespace TAO_Notify this->end_object(0, "notification_service" ACE_ENV_ARG_PARAMETER); ACE_CHECK; - delete this->output_; + ACE_OS::fclose(this->output_); this->output_ = 0; // delete the oldest backup file (if it exists) @@ -80,12 +80,12 @@ namespace TAO_Notify this->backup_count_ = backup_count; if (base_name == "cout") { - this->output_ = & cout; + this->output_ = stdout; this->close_out_ = false; } else if (base_name == "cerr") { - this->output_ = & cerr; + this->output_ = stderr; this->close_out_ = false; } else @@ -93,18 +93,10 @@ namespace TAO_Notify ACE_CString file_name = base_name; file_name += ".new"; - ofstream * fs = 0; - ACE_NEW_RETURN (fs, ofstream , false); - fs-> open (file_name.c_str()); - if (fs->is_open ()) - { - this->output_ = fs; + this->output_ = ACE_OS::fopen (file_name.c_str(), ACE_TEXT("wb")); + if (this->output_) { this->close_out_ = true; - } - else - { - delete fs; - ACE_ASSERT(this->output_ == 0); + } else { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) XML_Saver unable to open %s\n"), base_name.c_str())); @@ -112,9 +104,10 @@ namespace TAO_Notify } if (this->output_ != 0) { - ostream& out = * this->output_; + FILE *out = this->output_; + + ACE_OS::fprintf (out, "<?xml version=\"1.0\"?>\n"); - out << "<?xml version=\"1.0\"?>\n"; ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { @@ -162,28 +155,29 @@ namespace TAO_Notify ACE_ENV_ARG_DECL_NOT_USED) { ACE_ASSERT(this->output_ != 0); - ostream& out = * this->output_; - out << indent_ << "<" << type; + FILE *out = this->output_; + + ACE_OS::fprintf (out, "%s%s%s", indent_.c_str(), "<", type.c_str()); if (id != 0) { // not all ostreams know what to do with a CORBA::Long long lid = id; - out << " " << TOPOLOGY_ID_NAME << "=\"" << lid << "\""; + ACE_OS::fprintf (out, "%s%s%d%s", TOPOLOGY_ID_NAME, "=\"", lid, "\""); } char * buffer = 0; size_t buffer_size = 0; for (size_t idx = 0; idx < attrs.size(); idx++) { - out << " " - << attrs[idx].name.c_str () - << "=\"" - << escape_string(buffer, buffer_size, attrs[idx].value.c_str ()) - << "\""; + ACE_OS::fprintf (out, "%s%s%s%s%s", " ", + attrs[idx].name.c_str (), + "=\"", + escape_string(buffer, buffer_size, attrs[idx].value.c_str ()), + "\""); } delete [] buffer; - out << ">\n"; + ACE_OS::fprintf (out, ">\n"); this->indent_ += " "; return true; } @@ -193,13 +187,13 @@ namespace TAO_Notify { ACE_ASSERT(this->output_ != 0); ACE_UNUSED_ARG (id); - ostream& out = * this->output_; + FILE *out = this->output_; if (this->indent_.length() >= 2) { this->indent_ = this->indent_.substr(2); } - // Note : We avoid flushing after every object by using \n instead of << endl; - out << indent_ << "</" << type << ">\n"; + ACE_OS::fprintf (out, "%s%s%s%s", indent_.c_str(), "</", + type.c_str(), ">\n"); } static const char escaped_amp[] = "&"; diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h index e0ff886ebd7..e51370f8e6d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h +++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h @@ -66,7 +66,7 @@ private: private: /// A stream representing our current output. - ostream * output_; + FILE * output_; bool close_out_; /// the name of the output file diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp index 9ecf357818f..0230932024d 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp @@ -15,14 +15,14 @@ Test_Saver::begin_object(CORBA::Long id, bool changed ACE_ENV_ARG_DECL_NOT_USED) { - cout << "Test_Saver::begin_object type=\"" << type << "\" " - << " id=" << id - << " changed=\"" << changed << "\""; + ACE_OS::fprintf (stdout, "Test_Saver::begin_object type=\"%s\"" + " id=%d changed=\"%d\"", type.c_str(), id, changed); for (size_t idx = 0; idx < attrs.size(); idx++) { - cout << " " << attrs[idx].name << "=\"" << attrs[idx].value << "\""; + ACE_OS::fprintf (stdout, " %s=\"%s\"", attrs[idx].name.c_str(), + attrs[idx].value.c_str()); } - cout << endl; + ACE_OS::fprintf (stdout, "\n"); return true; } @@ -30,8 +30,7 @@ void Test_Saver::end_object (CORBA::Long id, const ACE_CString &type ACE_ENV_ARG_DECL_NOT_USED) { - cout << "Test_Saver::end_object type=\"" << type << "\"" - << " id=" << id - << endl; + ACE_OS::fprintf (stdout, "Test_Saver::end_object type=\"%s\" id=%d\n", + type.c_str(), id); } diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp index a6c6bac9662..515a81730a5 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp @@ -182,7 +182,7 @@ SendEvents (void) ACE_TRY_NEW_ENV { -cout << "Sending events" << endl; + ACE_OS::fprintf (stdout, "Sending events\n"); supplier_1->send_events(events ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } |