4 #include "io/FileOutputStream.h"
5 #include "io/FileInputStream.h"
6 #include "abf/interface.h"
7 #include "module_awful-abftest.h"
12 using namespace abftestapp
;
13 using namespace awful
;
14 using namespace awful::io
;
16 ABFTestApp::ABFTestApp( int argc
, char** argv
) throw( std::runtime_error
)
18 if( !PHYSFS_init( argv
[0] ) )
19 throw runtime_error( "PhysFS init failed" );
21 PHYSFS_setWriteDir( "." );
22 PHYSFS_addToSearchPath( ".", 0 );
24 awful::abf::Setup
< awful::abftest::awful_tag
>();
27 ABFTestApp::~ABFTestApp()
32 void ABFTestApp::run()
35 Pointer
< SeekableOutputStream
> pStream
= new FileOutputStream( "blah.abf" );
36 // abf::Writer writer( new FileOutputStream( "blah.abf" ) );
38 Pointer
< awful::abftest::Tubgirl
> pTG
= new awful::abftest::Tubgirl();
39 pTG
->setblah( 0xdeadbeef );
40 pTG
->m_LolCat
.Length() = 1337;
42 Pointer
< awful::abftest::Goatse
> pG
= new awful::abftest::Goatse( 789456 );
43 pTG
->setpGoatse1( pG
);
45 //pG = new awful::abftest::Goatse( 1234564 );
46 pTG
->setpGoatse2( pG
);
48 // abf::Writer::Save( pStream, pTG );
50 GenericPointer pMeh
= static_cast< awful::abftest::Tubgirl
* >( pTG
);
51 abf::Writer::Save( pStream
, pMeh
);
55 Pointer
< SeekableInputStream
> pStream
= new FileInputStream( "blah.abf" );
57 //GenericPointer pLulz = abf::Reader::Load( pStream );
58 Pointer
< awful::abftest::Tubgirl
> pTG
=
59 abf::Reader::Load
< awful::abftest::Tubgirl
>( pStream
);
63 std::cout
<< hex
<< pTG
->getblah() << std::endl
;
64 std::cout
<< dec
<< pTG
->m_LolCat
.Length() << std::endl
;
65 std::cout
<< "goatse1: " << pTG
->getpGoatse1() << std::endl
;
66 std::cout
<< "goatse2: " << pTG
->getpGoatse2() << std::endl
;