From: Justin Braach <fxhunter@cs.montana.edu>
Subject: Using C++ ifstream class in Ada95
Date: 1998/02/19
Date: 1998-02-19T00:00:00+00:00 [thread overview]
Message-ID: <34EBFBE1.C9AAF7E7@cs.montana.edu> (raw)
Is there a way to convert a C++ ifstream class object into an Ada
File_Type object?
For Example:
C++ code: --
#include <fstream.h>
extern "C" void ada_proc( ifstream * ); // This is how it's got to be,
(predefined).
int main(int argc, char *argv[])
{
ifstream *infile;
infile = new ifstream();
infile->open(argv[1], ios::nocreate);
if( infile )
{
ada_proc( infile );
...
}
Ada Code: -- In a package
procedure ada_proc( infile : file_type ) is -- File_Type? Or something
else?
begin --
-- do file stuff
end ada_proc;
pragma Export(C, ada_proc, "ada_proc");
Is there an easy/sane way to convert or use that C++ object as
File_Type? Tried using
type file_pointer is access file_type; -- pointer operations
but was unsuccessful. The file has to be opened in the C++ code, as the
only thing that can be sent to the Ada procedure is the pointer to
ifstream.
Any info would be much appreciated.
Justin Braach
--
"OVERKILL?!? Look. This ain't no game of 'Kick the Ouphe'..."
-- Jaya Ballard
fxhunter@cs.montana.edu
http://www.cs.montana.edu/~fxhunter
reply other threads:[~1998-02-19 0:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox