#pragma once
#ifndef _VBFPARSES_H_
#define _VBFPARSES_H_

#include <string>
#include <vector>
#include "VBFHeader.h"
#include "VBFBlock.h"

using namespace std;

class VBFParserSmall
{
	public:
		VBFParserSmall();
		~VBFParserSmall();

		bool ParseVBFFile(const std::string& strFileName, const std::string& strRSAPrivateKeyFileName, const std::string& strKeyInfo);
		VBFHeader& getHeader();
		vector<VBFBlock>& GetVBFBlocks();
		unsigned int GetVBFDataSize();
		vector<unsigned char> GetVBFData();

	protected:
		bool OpenVBFFile(std::string fname);
		//unsigned int CalcCRC16(unsigned int size, unsigned char* data);
		//void generate_crc32_table(void);
		//unsigned long calc_crc32(unsigned long size, unsigned char* data);
		bool ParseBlocks();

	public:
		std::string m_strVBFileName;
		VBFHeader m_oHeader;

		vector<unsigned char> m_vecFileBuffer;
		vector<VBFBlock> m_vecVBFBlocks;
		std::string m_strRSAPrivateKeyFileName;
		std::string m_strKeyInfo;
		unsigned short m_usMASK = 0;
};



#endif
