libi2ncommon: (tomj) switched oftmpstream to string
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 27 Sep 2004 07:32:02 +0000 (07:32 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 27 Sep 2004 07:32:02 +0000 (07:32 +0000)
src/oftmpstream.cpp
src/oftmpstream.hxx

index 719eff7..de5c507 100644 (file)
@@ -39,7 +39,7 @@ oftmpstream::oftmpstream () : ostream(0) {
     is_open = false;
 }
 
-oftmpstream::oftmpstream (const char *name) : ostream(0) {
+oftmpstream::oftmpstream (const std::string &name) : ostream(0) {
     fd = -1;
     rdbuf(&buf);
     is_open = false;
@@ -51,13 +51,13 @@ oftmpstream::~oftmpstream () {
     close();
 }
 
-void oftmpstream::open (const char *name)
+void oftmpstream::open (const string &name)
 {
     if (is_open)
         close();
 
     realname = name;
-    tmpname=string(name)+".XXXXXX";
+    tmpname=name+".XXXXXX";
     
     char* chbuf=new char[tmpname.size()+1];
     tmpname.copy(chbuf,tmpname.size()+1);
index a2c2d59..4954d7a 100644 (file)
@@ -20,9 +20,9 @@ class fdoutbuf : public std::streambuf {
 class oftmpstream : public std::ostream {
 public:
     oftmpstream ();
-    oftmpstream (const char *name);
+    oftmpstream (const std::string &name);
     ~oftmpstream ();
-    void open (const char *name);
+    void open (const std::string &name);
     void close();
 private:
     int fd;