Esempio n. 1
0
void CzUIWebView::setHtml(const char* html)
{
	if (html == NULL)
		return;

	CzString h = html;
	h.URLDecode();

	printf("****************************************\n");
	printf("%sn", h.c_str());
	printf("****************************************\n");

	if (!TempFilename.isEmpty())
	{
		CzFile::DeleteFile(TempFilename.c_str());
	}
	TempFilename = "ram://web_view_";
	TempFilename += Name;
//	TempFilename += CzString((int)(PLATFORM_SYS->getTimeUTC() & 0xffffffff));	// Ensure filename is unique
	TempFilename += ".html";
	CzFile file;
	if (file.Open(TempFilename.c_str(), "wb"))
	{
		file.Write((void*)h.c_str(), h.getLength());
		file.Close();
	}
	PLATFORM_UI->NavigateWebView(WebView, TempFilename.c_str());
}