Nu AMF_Tester via stdin ipv files

This commit is contained in:
Thulinma 2011-03-13 20:46:07 +01:00
parent 0a8a81e0e6
commit e1035aad46
2 changed files with 5 additions and 6 deletions

Binary file not shown.

View file

@ -5,15 +5,14 @@
#include <string> #include <string>
#include "amf.cpp" #include "amf.cpp"
int main( int argc, char * argv[] ) { int main() {
if( argc != 2 ) { return 1; }
std::string temp; std::string temp;
std::ifstream ifs( argv[1] ); while( std::cin.good() ) {
while( ifs.good() ) { temp += std::cin.get();
temp += ifs.get();
} }
static AMFType amfdata("empty", (unsigned char)0xFF); static AMFType amfdata("empty", (unsigned char)AMF0_DDV_CONTAINER);
amfdata = parseAMF( (const unsigned char*)temp.c_str(), temp.length()-1 ); amfdata = parseAMF( (const unsigned char*)temp.c_str(), temp.length()-1 );
amfdata.Print( ); amfdata.Print( );
return 0; return 0;
} }