🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #966

Returning a 'FileHandle'

#966
From: Maya
Date: Thu, 20 Feb 2003 21:29
28 lines
2518 bytes
Linux Intel, g++-3.2.
~~~~~~~~~~~~~~~~~~~~~

I have written a class that handles the opening and closing of files. I
have gone as far as creating the file, but I don't know how to get the
class to return a file handle of the newly created file. Here is an
example 

class Files{
   private:
      std::fstream f;
      std::ios::filebuf* pbuf;
      std::string s;
   pulic
      Files(){}
      Files(std::string& par){s = par;}
      Open(){
               f.open(s,std::fstream::openmode somemode); if(f.bad){
               bla,bla,bla...;}
               pbuf = f.rdbuf;
      }
      returvalue? getFileHandle(){ return ?}
};

I would like the value returned by getFileHandle() to be as much compliant
as posible to the the ANSI/ISO draft.

Can anybody help?
Technical Details
Message-ID: <pan.2003.02.20.16.28.59.457840.1896@canada.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.vif.com!news.vif.com.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e79a0bc234d7309f,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 114592,e79a0bc234d7309f,start
X-Google-Attributes: gid114592,public
X-Google-Thread: fa69e,e79a0bc234d7309f,start
X-Google-Attributes: gidfa69e,public
X-Google-ArrivalTime: 2003-02-20 18:30:22 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.vif.com!news.vif.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 20 Feb 2003 20:30:09 -0600
From: Maya <escalante@canada.com>
Subject: Returning a 'FileHandle'
Date: Thu, 20 Feb 2003 16:29:00 -0500
Newsgroups: gnu.gcc.help,alt.comp.lang.learn.c-c++,borland.public.cpp.borlandcpp
Followup-To: gnu.gcc.help
Organization: NOME
Message-ID: <pan.2003.02.20.16.28.59.457840.1896@canada.com>
User-Agent: Pan/0.11.2 (Unix)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Comment-To: ALL
Cache-Post-Path: www.vif.com!unknown@ip216-239-79-82.vif.net
X-Cache: nntpcache 2.4.0b4 (see http://www.nntpcache.org/)
Lines: 28
NNTP-Posting-Host: 216.239.64.141
X-Trace: sv3-B5jm40lm3pOKJ45h3ocLxyYM8KFPKd9GZWp5zihoKG4KE7n9Chmb4C3VBOHE5PJKiX3CLdXQBR6N+UB!w3wamhqw29/3bafcXLRA3U4dLqIV4lH2rREplOiozcZEmsVbEhWkDaTucNNXJI+aya91PB457snS!rgClrJtDLN8=
X-Complaints-To: abuse@vif.com
X-DMCA-Complaints-To: abuse@vif.com
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.1