#include <iostream>

#include <adtf_file/standard_adtf_file_reader.h>

int main( int argc, char* argv [ ] )
{
	if ( argc < 2 || argv [ 1 ] == NULL )
	{
		std::cout << "usage: " << argv [ 0 ] << " DAT-File" << std::endl;
		return -1;
	}

	std::string filename { argv [ 1 ] };

	try
	{
		adtf_file::Reader reader( filename,
			adtf_file::StandardTypeDeserializers( ),
			adtf_file::StandardSampleDeserializers( ) );

		std::cout << "Stream count: " << reader.getStreams( ).size( ) << std::endl;
	}
	catch ( const std::exception& ex )
	{
		std::cout << ex.what( ) << std::endl;
		return -2;
	}
	return 0;
}