From: Thomas Jarosch Date: Mon, 27 Sep 2004 07:32:02 +0000 (+0000) Subject: libi2ncommon: (tomj) switched oftmpstream to string X-Git-Tag: v2.6~224 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=8ac198c46997f177a023c5642fce353331074e81;p=libi2ncommon libi2ncommon: (tomj) switched oftmpstream to string --- diff --git a/src/oftmpstream.cpp b/src/oftmpstream.cpp index 719eff7..de5c507 100644 --- a/src/oftmpstream.cpp +++ b/src/oftmpstream.cpp @@ -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); diff --git a/src/oftmpstream.hxx b/src/oftmpstream.hxx index a2c2d59..4954d7a 100644 --- a/src/oftmpstream.hxx +++ b/src/oftmpstream.hxx @@ -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;