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


C++ base::String类代码示例

本文整理汇总了C++中tizen::base::String的典型用法代码示例。如果您正苦于以下问题:C++ String类的具体用法?C++ String怎么用?C++ String使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: FormatPrice

Tizen::Base::String FormatPrice(const T & type, bool aWithCurrency)
{
    Tizen::Base::String sRetval;
    Tizen::Base::String sPrice;

    if (type.GetCurrencyUnitHasPenny()) {
        sPrice.Format(255, L"%.2f", type.GetItemPrice());
    }
    else {
        sPrice.Format(255, L"%.0f", type.GetItemPrice());
    }

    if (aWithCurrency) {
        if (type.GetCurrencyUnitPrecedes()) {
            sRetval = type.GetCurrencyUnit() + sPrice;
        }
        else {
            sRetval = sPrice + type.GetCurrencyUnit();
        }
    }
    else {
        sRetval = sPrice;
    }

    return sRetval;
}
开发者ID:mnemonicflow,项目名称:tizen-in-app-purchase-testing,代码行数:26,代码来源:BuyItemInformation.cpp

示例2: OnPushServiceRegistered

void Chatting::OnPushServiceRegistered(RequestId reqId,
		const Tizen::Base::String& registrationId, result r,
		const Tizen::Base::String& errorCode,
		const Tizen::Base::String& errorMsg) {
	if (r == E_SUCCESS) {
		// The registrationId may change in some cases.
		// If the registrationId changes, the application should send the registrationId to the application server.
		AppLog("####### Push registration is successful. #######");

		AppLog(
				"####### registrationId = %S #######", registrationId.GetPointer());

		if (registrationId.Equals(regIdList[0])) {

			resultRegId =
					"04a1a6b9f06851233d3392efe419021613dbcec57ba833da007a5fe87ba59d5963eb0f943802ab188b06014c3fc034fcb70e";
		} else {

			resultRegId =
					"04a173e35ebec95baab94ae8d77a84a76903911ea65dcf67cf2570b9649bef4c8e3f0710ae2f5f2b6969c6b8b119de9c78f7";
		}
	} else {
		AppLog(
				"####### Push registration is failed with result[%s]. #######", GetErrorMessage(r));
	}
}
开发者ID:JunminLee,项目名称:Winwin,代码行数:26,代码来源:Chatting.cpp

示例3: GetTizenLocale

string GetTizenLocale()
{
  Tizen::Base::String languageCode;
  Tizen::System::SettingInfo::GetValue(L"http://tizen.org/setting/locale.language", languageCode);
  Tizen::Base::String languageCode_truncated;
  languageCode.SubString(0, 3, languageCode_truncated);
  return CodeFromISO369_2to_1(FromTizenString(languageCode_truncated));
}
开发者ID:DINKIN,项目名称:omim,代码行数:8,代码来源:tizen_utils.cpp

示例4: FormatSMSString

Tizen::Base::String FormatSMSString(Tizen::Base::String message, Tizen::Base::String const & url)
{
  message.Replace("%1$s", url);
  String s2 = "http://ge0.me/";
  String s3;
  url.SubString(6, s3);
  s2.Append(s3);
  message.Replace("%2$s", s2);
  return message;
}
开发者ID:DINKIN,项目名称:omim,代码行数:10,代码来源:BookMarkUtils.cpp

示例5: sprintf

Tizen::Base::Object* CantataNode::Run(void) {
    char *argv2[2];

    Tizen::Base::String appName = Tizen::App::App::GetInstance()->GetAppRootPath() + Tizen::App::App::GetInstance()->GetAppName();
    Tizen::Base::String resPath = Tizen::App::App::GetInstance()->GetAppResourcePath();
    char app_path[512];
    char js_path[512];
    char node_path[512];
    int ret = 0;

    sprintf(app_path, "%ls", (const wchar_t*) appName.GetPointer());
    sprintf(node_path, "%ls%s", resPath.GetPointer(), NODE_EXECUTABLE);
    sprintf(js_path, "%ls%s", resPath.GetPointer(), JS_SCRIPT);

    argv2[0] = strdup(app_path);
    argv2[1] = strdup(js_path);

    isRunningThread = true;
    ret = cantata_main(2, argv2);

    if (app_path != NULL) {
        free(app_path);
    }
    if (app_path != NULL) {
        free(js_path);
    }
#if 0
   /* handle = dlopen(node_path, RTLD_LAZY);
    if (handle == NULL) {
        AppLog("load error %s: %s\n", node_path, dlerror());
        return null;
    }

    AppLog("Calling main func");
    // TODO: how to stop node thread?
    call_nodejs = (void (*)(int, char**))dlsym(handle, "cantata_main");

    if((error = dlerror()) != NULL) {
        AppLog("dlsym error %s: %s\n", node_path, error);
        dlclose(handle);
        return null;
    }
    AppLog("Calling node");
    call_nodejs(2, argv2);
    dlclose(handle);
    */
#endif
    return null;
}
开发者ID:gseok,项目名称:cantata-native,代码行数:49,代码来源:CantataNode.cpp

示例6: loginPlayerFinished

void LoginForm::loginPlayerFinished(Tizen::Base::String statusCode)
{
	AppLogDebug("STAUS : %S",statusCode.GetPointer());

	MessageBox msgBox;
	int modalResult;

	SceneManager* pSceneManager = SceneManager::GetInstance();
	AppAssert(pSceneManager);

	ArrayList* pList = new (std::nothrow)ArrayList;
	AppAssert(pList);
	pList->Construct();

	if(statusCode !=  "0")	// (로그인 성공 시) 로그인, 개인페이지로 이동
	{
		String playerKey = statusCode;
		pList->Add( new Tizen::Base::String(playerKey) );	// playerId
		pSceneManager->GoForward(ForwardSceneTransition(SCENE_PLAYER, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY), pList);
	}
	else		// (로그인 실패 시) 로그인 실패 팝업
	{
		msgBox.Construct(L"Login", L"LOGIN fail", MSGBOX_STYLE_OK);
		msgBox.ShowAndWait(modalResult);
	}
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:26,代码来源:LoginForm.cpp

示例7:

void
CropForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId,
		const Tizen::Base::String& operationId,
		const Tizen::App::AppCtrlResult appControlResult,
		const Tizen::Base::Collection::IMap* pResultList)
{
	if (appId.Equals(L"tizen.filemanager", true) && operationId.Equals(L"http://tizen.org/appcontrol/operation/pick", true))
	{
		AppCtrlResult selectResult = appControlResult;
		if (selectResult == APP_CTRL_RESULT_SUCCEEDED)
		{
			//Get the file name
			result r ;
			String filename;
			String* pFilePath ;
			pFilePath = (String*)(Tizen::Base::String*)pResultList->GetValue(String(L"path"));
			LoadImage(pFilePath);
		}
		else
		{
			result r;
			Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
			Form *pForm = (Form*)pFrame->GetControl(MAIN_FORM_NAME, false);
			if(pForm)
			{
				r = pFrame->SetCurrentForm(*pForm);
				pForm->Draw();
				pForm->Show();
				pFrame->RemoveControl(*this);
			}
		}
	}
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:33,代码来源:CropForm.cpp

示例8:

bool
LocationMapForm::OnLoadingRequested(const Tizen::Base::String& url, WebNavigationType type)
{
	AppLog("%S",url.GetPointer());
	SetUrl(url);
	return false;
}
开发者ID:PassionJHack,项目名称:passion,代码行数:7,代码来源:LocationMapForm.cpp

示例9: OnFastScrollIndexSelected

void UsersPanel::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index) {
	AppLog("OnFastScrollIndexSelected %ls", index.GetPointer());
	String upperLetter;
	index.ToUpper(upperLetter);
	AppLog("Upper letter %ls", index.GetPointer());

	Integer * pos = static_cast<Integer *>(_pLetterNav->GetValue(upperLetter));

	if (pos != null) {
		int item = pos->ToInt();
		AppLog("Found at %d.", item);
		_pTableView->ScrollToItem(item, -1);
		Invalidate(true);
	} else {
		AppLog("Pointer is null...");
	}
}
开发者ID:igorglotov,项目名称:tizen-vk-client,代码行数:17,代码来源:UsersPanel.cpp

示例10: Construct

result UserGroup::Construct(const Tizen::Base::String & groupName, const JsonArray * usersArray) {
	result r = E_SUCCESS;
	AppLog("Adding %d items to array, named %ls", usersArray->GetCount(), groupName.GetPointer());

	_pGroupName = new String(groupName);
	delete _pUserList;
	_pUserList = usersArray->CloneN();
//	_pUserList->AddItems(*usersArray);
	return r;
}
开发者ID:igorglotov,项目名称:tizen-vk-client,代码行数:10,代码来源:UserGroup.cpp

示例11: getWritablePath

string FileUtilsTizen::getWritablePath()
{
    UiApp* pApp = UiApp::GetInstance();
    if (!pApp)
    {
        return null;
    }

    string path("");
    AsciiEncoding ascii;
    Tizen::Base::String dataPath = pApp->GetAppDataPath();
    if (!dataPath.IsEmpty())
    {
        ByteBuffer* buffer = ascii.GetBytesN(dataPath);
        path.append((const char*)buffer->GetPointer());
        delete buffer;
    }

    return path;
}
开发者ID:bassarisse,项目名称:LostInCaves,代码行数:20,代码来源:CCFileUtilsTizen.cpp

示例12: init

bool FileUtilsTizen::init()
{
    UiApp* pApp = UiApp::GetInstance();
    if (!pApp)
    {
        return false;
    }

    Tizen::Base::String resPath = pApp->GetAppResourcePath();
    if (resPath.IsEmpty())
    {
        return false;
    }

    AsciiEncoding ascii;
    ByteBuffer* buffer = ascii.GetBytesN(resPath);
    _defaultResRootPath = (const char *)buffer->GetPointer();
    delete buffer;
    return FileUtils::init();
}
开发者ID:bassarisse,项目名称:LostInCaves,代码行数:20,代码来源:CCFileUtilsTizen.cpp

示例13: AddCategory

int BookMarkManager::AddCategory(Tizen::Base::String const & sName) const
{
  if (!sName.IsEmpty())
  {
    Framework * pFW = GetFramework();
    int i = pFW->AddCategory(FromTizenString(sName));
    pFW->GetBmCategory(i)->SaveToKMLFile();
    return i;
  }
  return -1;
}
开发者ID:DINKIN,项目名称:omim,代码行数:11,代码来源:BookMarkUtils.cpp

示例14: new

void GHPlayerListItemEventListener::OnListViewItemStateChanged
(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
{
	if (status == Tizen::Ui::Controls::LIST_ITEM_STATUS_SELECTED) {
		if(index < list.GetCount())
		{
			Tizen::Base::String playerId = ((GHPlayer*)(list.GetAt(index)))->getId();

			Tizen::Base::Collection::ArrayList* pList = new (std::nothrow)Tizen::Base::Collection::ArrayList;
			AppAssert(pList);
			pList->Construct();
			pList->Add( playerId );	// playerId

			// Scene 이동
			SceneManager* pSceneManager = SceneManager::GetInstance();
			SceneId sceneId = (playerId.Equals(GHSharedAuthData::getSharedInstance().getPlayerId()) ? SCENE_PLAYER : SCENE_PLAYERFRIEND);
			pSceneManager->GoForward(ForwardSceneTransition(sceneId, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pList);
		}
	}
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:20,代码来源:GHPlayerListItemEventListener.cpp

示例15: Construct

result RoundedAvatar::Construct(const Tizen::Graphics::Rectangle & rect, const Tizen::Base::String &avatarPath) {
	result r = E_SUCCESS;

	imageUrl = avatarPath;
	AppLog("construct rounded avatar based on url: %ls", avatarPath.GetPointer());

	Panel::Construct(rect, GROUP_STYLE_NONE);

	if (imageUrl.GetLength() != 0) {
		Bitmap *bitmap = VKUApp::GetInstance()->GetBitmapCache()->TakeBitmap(imageUrl, this);
		if(bitmap != null) {
			pAvatar = bitmap;
		}
	}

	return r;
}
开发者ID:igorglotov,项目名称:tizen-vk-client,代码行数:17,代码来源:RoundedAvatar.cpp


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