#include ".h"
#include "Item.h"
#include "List.h"
namespace {
////////////////////////////////////
bool ::parse( Reader *r, int end, Context *ctx ) {
if( ctx->debugTrace ) fprintf( stderr, "PARSE @%i-%i :%i\n", r->getPosition(), r->getBits(), end );
file_offset = r->getPosition();
if( r->getPosition() != file_offset + len ) {
fprintf( stderr, "WARNING: end of tag is @%i, should be @%i\n", r->getPosition(), file_offset+len );
r->seekTo( file_offset + len );
}
return r->getError() == SWFR_OK;
}
}
if( !
& ) {
} else {
= ;
}
if( ctx->debugTrace ) fprintf( stderr, "PARSE IF - " );
if( ) {
if( ctx->debugTrace ) fprintf( stderr, "TRUE\n" );
} else {
if( ctx->debugTrace ) fprintf( stderr, "FALSE\n" );
= ;
}
= ;
if( ctx->debugTrace ) fprintf( stderr, "PARSE : \n", );
ctx-> = ;
if( && +r->getPosition() < end ) {
if( ctx->debugTrace ) fprintf(stderr, "- has next offset, setting end to current+%i\n", );
end = r->getPosition() +
+ ();
}
r->getByte()
r->getWord()
r->getNBitFixed(,,true)
r->getNBitFixed2(,,true)
r->getInt()
r->getFloat()
r->getDouble()
r->getDouble2()
r->getHalf()
r->getNBitInt(1)
r->getNBitInt(
+
,true)
r->getU30()
r->getS24()
r->getEncodedU32()
r->getPString()
r->getPStringU30()
r->getString()
r->getString()
= r->getByte();
if( == 0xff && ctx->tagVersion >= 2 ) {
= r->getWord();
}
if( ctx->debugTrace ) fprintf( stderr, "PARSE : \n", );
ctx-> = ;
if( && +r->getPosition() < end ) {
if( ctx->debugTrace ) fprintf(stderr, "- has next offset, setting end to current+%i\n", );
end = r->getPosition() +
+ ();
}
.parse(r,end,ctx);
( + )
( <
? 0
: - )
{
if( ctx->debugTrace ) fprintf( stderr, "PARSE list<> : %i items, @%i-%i :%i\n", , r->getPosition(), r->getBits(), end );
*item;
for( int i=0; i<; i++ ) {
item = ::get(r,end,ctx);
.append( item );
}
}
{
if( ctx->debugTrace ) fprintf( stderr, "PARSE list<> @%i-%i :%i\n", r->getPosition(), r->getBits(), end );
int myend = end;
myend = r->getPosition() +
+ ();
if( r->getPosition() < myend ) {
*item;
item = ::get(r,end,ctx);
while( item && r->getPosition() <= myend ) {
.append( item );
if( r->getPosition() < myend || (r->getPosition()==myend && r->getBits() ))
item = ::get(r,myend,ctx);
else item = NULL;
if(item && ) {
.append( item );
item = NULL;
}
}
}
}
{
int sz = ;
= new unsigned char[ sz ];
r->getData( , sz );
}
r->byteAlign();
ctx-> = ;