/*
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * Author:
 *         Stefan Denk <denk@ira.uka.de>
 *
 * $Id: video_hash.cc,v 1.3 2005/12/27 12:12:33 kutzner Exp $
 *
 */

// libc
#include <assert.h>

// vidtrans
#include "video_hash.h"
#include "helper.h"

video_hash::video_hash(const string &s)
{
	int pos;
	pos = s.find('#');
	if (pos != -1)
	{
		hash = strtouint(s.substr(0, pos), 10);
		len = strtouint(s.substr(pos+1, s.size()), 10);
	}
	else
	{
		printf("Found malformed videohash - exiting (this should NOT happen).\n");
		assert(0);
	}
}

string video_hash::tostring()
{
	string retval;
	retval = uinttostr(hash, 10);
	retval += '#';
	retval += uinttostr(len, 10);
	return retval;
}

