当前位置: 首页>>代码示例>>C++>>正文


C++ Platform::getLocalPath方法代码示例

本文整理汇总了C++中Platform::getLocalPath方法的典型用法代码示例。如果您正苦于以下问题:C++ Platform::getLocalPath方法的具体用法?C++ Platform::getLocalPath怎么用?C++ Platform::getLocalPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Platform的用法示例。


在下文中一共展示了Platform::getLocalPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createFiles

	void createFiles()
	{
		// Create local HTML files we want to refer to by urls.
		// We read data from resources and write to files.
		// TODO: This can be removed once automatic resource
		// unpacking of file systems is supported.

		mPlatform->writeTextToFile(
			mPlatform->getLocalPath() + "PageOne.html",
			mPlatform->createTextFromHandle(PageOne_html));

		mPlatform->writeTextToFile(
			mPlatform->getLocalPath() + "PageTwo.html",
			mPlatform->createTextFromHandle(PageTwo_html));
	}
开发者ID:AliSayed,项目名称:MoSync,代码行数:15,代码来源:WebViewTestApp.cpp

示例2: createWebView

	MAWidgetHandle createWebView()
	{
		// Create web view.
		MAWidgetHandle webView = maWidgetCreate(MAW_WEB_VIEW);
		widgetShouldBeValid(webView, "Could not create web view");

		// Set size of the web view to fill the parent.
		maWidgetSetProperty(webView, "width", "-1");
		maWidgetSetProperty(webView, "height", "-1");

		// Method 1: Directly html property of WebView.

//		MAUtil::String html =
//			mPlatform->createTextFromHandle(ColorPage_html);
//		maWidgetSetProperty(webView, "html", html.c_str());

		// Method 2: Write html file to local file system.

		// Write HTML resource files to the local file system
		// so they can be accessed by the web view.
		// TODO: This can be removed once automatic resource
		// unpacking of file systems is supported.

		mPlatform->writeTextToFile(
			mPlatform->getLocalPath() + "ColorPage.html",
			mPlatform->createTextFromHandle(ColorPage_html));

		// As a test, create a second page (linked to from ColorPage.html).
		mPlatform->writeTextToFile(
			mPlatform->getLocalPath() + "AnotherPage.html",
			"<html><body><p><a href=\"ColorPage.html\">Hello World</a></p></body></html>");

		// Set the URL the web view displays.
		// We support both absolute file url and
		// as url that assumes a url base is set.
		maWidgetSetProperty(webView, "url", "ColorPage.html");

		// Register to receive messages from the WebView.
		WebViewMessage::getMessagesFor(webView);

		return webView;
	}
开发者ID:Felard,项目名称:MoSync,代码行数:42,代码来源:WebViewMultiViews.cpp


注:本文中的Platform::getLocalPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。