pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/worldobjs conveyor_belt.cxx,1.2,1.3 c


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjs conveyor_belt.cxx,1.2,1.3 conveyor_belt.hxx,1.2,1.3 ice_block.cxx,1.2,1.3 ice_block.hxx,1.2,1.3 info_box.cxx,1.1,1.2 info_box.hxx,1.3,1.4 switch_door.cxx,1.2,1.3 switch_door.hxx,1.3,1.4 teleporter.cxx,1.1,1.2 teleporter.hxx,1.3,1.4
Date: 25 Jun 2002 12:20:36 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv24105/worldobjs

Modified Files:
        conveyor_belt.cxx conveyor_belt.hxx ice_block.cxx 
        ice_block.hxx info_box.cxx info_box.hxx switch_door.cxx 
        switch_door.hxx teleporter.cxx teleporter.hxx 
Log Message:
- replaced all ofstream* by ostream&
- some more prefab stuff

Index: conveyor_belt.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/conveyor_belt.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- conveyor_belt.cxx   19 Jun 2002 15:19:26 -0000      1.2
+++ conveyor_belt.cxx   25 Jun 2002 12:20:34 -0000      1.3
@@ -35,13 +35,13 @@
 /** Writte the content of this object formated as xml to the given
     stream */
 void 
-ConveyorBeltData::write_xml(std::ofstream* xml)
+ConveyorBeltData::write_xml(std::ostream& xml)
 {
-  (*xml) << "  <worldobj type=\"conveyorbelt\">";
+  xml << "  <worldobj type=\"conveyorbelt\">";
   XMLhelper::write_vector_xml (xml, pos);
-  (*xml) << "    <width>" << width << "</width>\n"
-        << "    <speed>" << speed << "</speed>\n"
-        << "  </worldobj>\n" << std::endl;
+  xml << "    <width>" << width << "</width>\n"
+      << "    <speed>" << speed << "</speed>\n"
+      << "  </worldobj>\n" << std::endl;
 }
 
 ConveyorBeltData::ConveyorBeltData (xmlDocPtr doc, xmlNodePtr cur)

Index: conveyor_belt.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/conveyor_belt.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- conveyor_belt.hxx   24 Jun 2002 22:52:59 -0000      1.2
+++ conveyor_belt.hxx   25 Jun 2002 12:20:34 -0000      1.3
@@ -36,7 +36,7 @@
 
   /** Write the content of this object formatted as xml to the given
       stream */
-  void write_xml(std::ofstream* xml);
+  void write_xml(std::ostream& xml);
   ///
 
   /** Create an WorldObj from the given data object */
@@ -95,7 +95,7 @@
 
   CL_Vector get_upper_left_corner() { return pos; }
 
-  void write_xml (std::ofstream* xml) { ConveyorBeltData::write_xml (xml); }
+  void write_xml (std::ostream& xml) { ConveyorBeltData::write_xml (xml); }
   std::string status_line();
 
   void make_larger ();

Index: ice_block.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/ice_block.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ice_block.cxx       19 Jun 2002 15:19:26 -0000      1.2
+++ ice_block.cxx       25 Jun 2002 12:20:34 -0000      1.3
@@ -34,12 +34,12 @@
 }
 
 void
-IceBlockData::write_xml(std::ofstream* xml)
+IceBlockData::write_xml(std::ostream& xml)
 {
-  (*xml) << "  <worldobj type=\"iceblock\">";
+  xml << "  <worldobj type=\"iceblock\">";
   XMLhelper::write_vector_xml (xml, pos);
-  (*xml) << "    <width>" << width << "</width>\n"
-        << "  </worldobj>\n" << std::endl;
+  xml << "    <width>" << width << "</width>\n"
+      << "  </worldobj>\n" << std::endl;
 }
 
 ///

Index: ice_block.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/ice_block.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ice_block.hxx       24 Jun 2002 22:53:00 -0000      1.2
+++ ice_block.hxx       25 Jun 2002 12:20:34 -0000      1.3
@@ -45,7 +45,7 @@
 
   /** Write the content of this object formatted as xml to the given
       stream */
-  void write_xml(std::ofstream* xml);
+  void write_xml(std::ostream& xml);
   
   /** Create an WorldObj from the given data object */
   WorldObj* create_WorldObj ();
@@ -82,7 +82,7 @@
   /** Create the object with resonable defaults */
   static std::list<boost::shared_ptr<EditorObj> > create (const CL_Vector& 
pos);
 
-  void write_xml(std::ofstream* xml) { IceBlockData::write_xml (xml); }
+  void write_xml(std::ostream& xml) { IceBlockData::write_xml (xml); }
   boost::shared_ptr<EditorObj> duplicate();
   std::string status_line();
 };

Index: info_box.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/info_box.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- info_box.cxx        12 Jun 2002 19:03:10 -0000      1.1
+++ info_box.cxx        25 Jun 2002 12:20:34 -0000      1.2
@@ -76,13 +76,12 @@
 }
 
 void 
-InfoBoxData::write_xml(std::ofstream* xml)
+InfoBoxData::write_xml(std::ostream& xml)
 {
-  (*xml) << "  <worldobj type=\"infobox\">\n";
+  xml << "  <worldobj type=\"infobox\">\n";
   XMLhelper::write_vector_xml (xml, pos);
-  
-  (*xml) << "   <info-text>" << info_text << "</info-text>\n" 
-        << "  </worldobj>\n" << std::endl;
+  xml << "   <info-text>" << info_text << "</info-text>\n" 
+      << "  </worldobj>\n" << std::endl;
 }
 
 InfoBox::InfoBox (const InfoBoxData& data)

Index: info_box.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/info_box.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- info_box.hxx        24 Jun 2002 22:53:00 -0000      1.3
+++ info_box.hxx        25 Jun 2002 12:20:34 -0000      1.4
@@ -40,7 +40,7 @@
   CL_Vector pos;
   CL_Vector text_pos;
 
-  void write_xml(std::ofstream* xml);  
+  void write_xml(std::ostream& xml);  
   WorldObj* create_WorldObj();
   EditorObjLst create_EditorObj();
 };
@@ -69,7 +69,7 @@
 
   static std::list<boost::shared_ptr<EditorObj> > create (const CL_Vector& 
pos);
 
-  void write_xml(std::ofstream* xml) { InfoBoxData::write_xml (xml); }
+  void write_xml(std::ostream& xml) { InfoBoxData::write_xml (xml); }
   boost::shared_ptr<EditorObj> duplicate();
   std::string status_line ();
 };

Index: switch_door.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/switch_door.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- switch_door.cxx     22 Jun 2002 22:06:18 -0000      1.2
+++ switch_door.cxx     25 Jun 2002 12:20:34 -0000      1.3
@@ -95,17 +95,17 @@
 }
 
 void 
-SwitchDoorData::write_xml(std::ofstream* xml)
+SwitchDoorData::write_xml(std::ostream& xml)
 {
-  (*xml) << "  <worldobj type=\"switchdoor\">\n";
-  (*xml) << "    <switch>\n";
+  xml << "  <worldobj type=\"switchdoor\">\n";
+  xml << "    <switch>\n";
   XMLhelper::write_vector_xml (xml, switch_pos);
-  (*xml) << "    </switch>\n"
-        << "    <door>\n"
-        << "    <height>\n" << door_height << "</height>\n";
+  xml << "    </switch>\n"
+      << "    <door>\n"
+      << "    <height>\n" << door_height << "</height>\n";
   XMLhelper::write_vector_xml (xml, door_pos);
-  (*xml) << "    </door>\n"
-        << "  </worldobj>\n" << std::endl;
+  xml << "    </door>\n"
+      << "  </worldobj>\n" << std::endl;
 }
 
 /** Create an WorldObj from the given data object */
@@ -261,7 +261,7 @@
 }
 
 void
-EditorSwitchDoorObj::save_xml (std::ofstream* xml)
+EditorSwitchDoorObj::save_xml (std::ostream& xml)
 {
   write_xml (xml);
 }

Index: switch_door.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/switch_door.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- switch_door.hxx     24 Jun 2002 22:53:00 -0000      1.3
+++ switch_door.hxx     25 Jun 2002 12:20:34 -0000      1.4
@@ -47,7 +47,7 @@
 
   /** Write the content of this object formatted as xml to the given
       stream */
-  void write_xml(std::ofstream* xml);
+  void write_xml(std::ostream& xml);
   
   /** Create an WorldObj from the given data object */
   WorldObj* create_WorldObj ();
@@ -98,7 +98,7 @@
   
   boost::shared_ptr<EditorObj> duplicate();
 
-  void write_xml (std::ofstream* /*xml*/) {}
+  void write_xml (std::ostream& /*xml*/) {}
   std::string status_line();
 };
 
@@ -126,13 +126,13 @@
 
   void make_larger ();
   void make_smaller ();
-  void write_xml (std::ofstream* xml) { SwitchDoorData::write_xml (xml); }
+  void write_xml (std::ostream& xml) { SwitchDoorData::write_xml (xml); }
   CL_Vector get_upper_left_corner() { return door_pos; }
 
   void set_position_offset(const CL_Vector &);
 
   void draw (EditorView * view);
-  void save_xml (std::ofstream* xml);
+  void save_xml (std::ostream& xml);
   std::string status_line();
 };
 

Index: teleporter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/teleporter.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- teleporter.cxx      12 Jun 2002 19:03:10 -0000      1.1
+++ teleporter.cxx      25 Jun 2002 12:20:34 -0000      1.2
@@ -33,14 +33,14 @@
 }
 
 void 
-TeleporterData::write_xml(std::ofstream* xml)
+TeleporterData::write_xml(std::ostream& xml)
 {
-  (*xml) << "  <worldobj type=\"teleporter\">";
+  xml << "  <worldobj type=\"teleporter\">";
   XMLhelper::write_vector_xml (xml, pos);
-  (*xml) << "    <target>" << std::endl;
+  xml << "    <target>" << std::endl;
   XMLhelper::write_vector_xml (xml, target_pos);
-  (*xml) << "    </target>" << std::endl;
-  (*xml) << "  </worldobj>" << std::endl;
+  xml << "    </target>" << std::endl;
+  xml << "  </worldobj>" << std::endl;
 }
 
 TeleporterData::TeleporterData (xmlDocPtr doc, xmlNodePtr cur)
@@ -211,7 +211,7 @@
 }
 
 void
-EditorTeleporterObj::save_xml (std::ofstream* xml)
+EditorTeleporterObj::save_xml (std::ostream& xml)
 {
   // Before we write down the xml stuff, we need to get the positions
   // of the objects

Index: teleporter.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/teleporter.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- teleporter.hxx      24 Jun 2002 22:53:00 -0000      1.3
+++ teleporter.hxx      25 Jun 2002 12:20:34 -0000      1.4
@@ -45,7 +45,7 @@
   
   /** Write the content of this object formatted as xml to the given
       stream */
-  void write_xml(std::ofstream* xml);
+  void write_xml(std::ostream& xml);
   
   /** Create an WorldObj from the given data object */
   WorldObj* create_WorldObj ();
@@ -86,14 +86,14 @@
   boost::shared_ptr<EditorObj> duplicate();
   static std::list<boost::shared_ptr<EditorObj> > create (const 
TeleporterData& data);
   
-  void write_xml(std::ofstream* xml) { TeleporterData::write_xml(xml); }
+  void write_xml(std::ostream& xml) { TeleporterData::write_xml(xml); }
 
   /** Create this object (and child objects) with reasonable defaults
       for the editor */
   static std::list<boost::shared_ptr<EditorObj> > create (const CL_Vector& 
pos);
 
   void draw (EditorView * view);
-  void save_xml (std::ofstream* xml);
+  void save_xml (std::ostream& xml);
   std::string status_line();
 };
 
@@ -114,7 +114,7 @@
   boost::shared_ptr<EditorObj> duplicate() { return teleporter->duplicate (); }
 
   /// The saving will be done in EditorTeleporterObj::save_xml
-  void write_xml (std::ofstream* /*xml*/) {}
+  void write_xml (std::ostream& /*xml*/) {}
   std::string status_line();
 };
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]