#pragma once
using namespace System;
using namespace System::IO;

namespace lkfxdok {
	namespace c {

		public delegate int LKFDataProviderFileDelegate(int modelYear, const char *fileName, int buflen, char *buf);

		public interface class ILKFFileDataProvider { // V2021.0: technical demo
			Stream ^GetFile(int modelYear, String ^FileName);
			int     ProvidesFile(int modelYear, String ^ FileName);
		};

		public ref class LKFDataProvider
		{
			LKFDataProviderFileDelegate ^fileDelegate;
			IntPtr unmanagedModelDelegate;
			IntPtr unmanagedFileDelegate;
			ILKFFileDataProvider ^provider;
		
		
		public:
			LKFDataProvider(ILKFFileDataProvider ^providerClass);
			void Assign();
			void Deassign();
		private:
			int provider_file_callback(int modelYear, const char *fileName, int buflen, char *errorBuf);
		};
	}
}

