🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Maya Thu, 20 Feb 2003 21:29
Returning a 'FileHandle'
#966
Author: 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?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads