[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [paragui-users] Pg_File simple demo
From: |
Roger D. Vargas |
Subject: |
Re: [paragui-users] Pg_File simple demo |
Date: |
Fri, 12 Jul 2002 12:48:59 -0400 (CDT) |
On Fri, 12 Jul 2002, Alexander Pipelka wrote:
> Thanks Roger.
>
> I added this to the "test" dir in the CVS.
And here is the read demo:
#include <pgfilearchive.h>
#include <pgfile.h>
#include <pglog.h>
#include <string>
main()
{
PG_FileArchive *Arc;
PG_File *wf;
int v1,v2;
//Create the FileArchive object
Arc = new PG_FileArchive();
//Set the base app dir as write dir
Arc->SetWriteDir(PG_FileArchive::GetBaseDir());
//Now open a file for writing
wf = Arc->OpenFile("test", PG_OPEN_READ);
//Now read the ints we wrote in the previous program
wf->read(&v1,sizeof(v1));
wf->read(&v2,sizeof(v2));
cout << v1<<endl;
cout <<v2<<endl;
}
--
Roger D. Vargas | El sistema se apagara en 5 segundos.
ICQ: 117641572 | Salvese el que pueda!
Linux User: 180787 |