本文整理汇总了C++中mautil::String::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ String::c_str方法的具体用法?C++ String::c_str怎么用?C++ String::c_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mautil::String
的用法示例。
在下文中一共展示了String::c_str方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLabelText
/**
* Set a text for a label.
* @param aLabel Handle to the label.
* @param aText Label text.
*/
void setLabelText(MAWidgetHandle aLabel, MAUtil::String aText)
{
maWidgetSetProperty(aLabel,MAW_LABEL_TEXT, aText.c_str());
}
示例2: setButtonText
/**
* Set a text for a button.
* @param aButton Handle to the button.
* @param aText Button text.
*/
void setButtonText(MAWidgetHandle aButton, MAUtil::String aText)
{
maWidgetSetProperty(aButton, MAW_BUTTON_TEXT, aText.c_str());
}
示例3: setTitle
/**
* Set the title of the screen.
* The title is used by tab screen to display a text on the tab indicator.
* @param title The screen title.
*/
void Screen::setTitle(const MAUtil::String& title)
{
setProperty(MAW_SCREEN_TITLE, title.c_str());
}
示例4: openURL
/**
* Open a web page.
* @param url The URL open.
*/
void WebView::openURL(const MAUtil::String& url)
{
this->setProperty(MAW_WEB_VIEW_URL, url.c_str());
}
示例5: isShown
/**
* Check if a screen is shown.
* @return true if the screen is visible, false otherwise.
*/
bool Screen::isShown()
{
MAUtil::String value = this->getPropertyString(MAW_SCREEN_IS_SHOWN);
return (strcmp(value.c_str(), "true") == 0) ? true : false;
}
示例6: addOptionsMenuItem
/**
* Add a new menu item to the Options Menu associated to this screen.
* Platform: Android and WP7.
* Option Menus are Android specific concept. The Options Menu is launched by
* pressing the Menu key. The options menu is where you should include
* actions and other options that are relevant to the current activity
* context, such as "Search," "Compose email," or "Settings".
* When opened, the first visible portion is the icon menu, which holds
* up to six menu items. If your menu includes more than six items, Android
* places the sixth item and the rest into the overflow menu, which the user
* can open by selecting More. Those items do not display icons. On Windows
* Phone 7 the control used is the application bar.
*
* @param title The title associated for the new item.
*
* Note: On Windows phone 7, by using this function you will obtain an
* application bar menu item (text only)
*
* @return The index on which the menu item was added in the options menu,
* an error code otherwise.
*/
int Screen::addOptionsMenuItem(const MAUtil::String title)
{
return maWidgetScreenAddOptionsMenuItem(
getWidgetHandle(), title.c_str(), "", 0 );
}
示例7: handleLog
/**
* Handle the log message.
*/
void MessageHandler::handleLog(WebViewMessage& message)
{
MAUtil::String s = message.getParam("message");
maWriteLog(s.c_str(), s.length());
}
示例8: _writeSettings
/**
* \brief This function is used for writing the settings to the settings file
*/
void SettingsManager::_writeSettings()
{
_settingsFile = maFileOpen(_settingsFileCompletePath->c_str(), MA_ACCESS_READ_WRITE);
maFileTruncate(_settingsFile, 0);
char buffer[Model::BUFF_SIZE];
MAUtil::String binaryMask;
if(_showAll) binaryMask = "100";
else if(_showMonthly) binaryMask = "010";
else if(_showFromDate) binaryMask = "001";
sprintf(buffer, "%s|%d|%s|%s|%.2f", _coin.c_str(), _date._day, Model::DateStructToString(_date).c_str(), binaryMask.c_str(), _debtValue);
maFileWrite(_settingsFile, buffer, strlen(buffer));
maFileClose(_settingsFile);
}
示例9: productError
/**
* Main screen is notified of a purchase error.
* @param errorMessage.
*/
void MainScreen::productError(MAUtil::String errorMessage)
{
// Another purchase can now be requested.
mBuyButton->setEnabled(true);
maAlert("Purchase error", errorMessage.c_str(), "OK","","");
}