本文整理汇总了C++中AddString函数的典型用法代码示例。如果您正苦于以下问题:C++ AddString函数的具体用法?C++ AddString怎么用?C++ AddString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
void JSONValue::AddVariantValue(const Variant& value)
{
switch (value.GetType())
{
case VAR_RESOURCEREF:
AddResourceRef(value.GetResourceRef());
break;
case VAR_RESOURCEREFLIST:
AddResourceRefList(value.GetResourceRefList());
break;
case VAR_VARIANTVECTOR:
case VAR_VARIANTMAP:
LOGERROR("Unsupported value type");
break;
default:
AddString(value.ToString());
}
}
开发者ID:AGreatFish,项目名称:Urho3D,代码行数:21,代码来源:JSONValue.cpp
示例2: SetRedraw
void CSmartFieldListBox::Rebuild(void)
{
int nMacros = m_pMacros->Macros();
SetRedraw(FALSE);
ResetContent();
/* Set the height of the items. */
MEASUREITEMSTRUCT mi;
MeasureItem(&mi);
SetItemHeight(0, mi.itemHeight);
/* Add all the items. */
for (int nMacro = 0; nMacro < nMacros; nMacro++)
{
CMacro* pMacro = m_pMacros->Macro(nMacro);
ASSERT(pMacro != NULL);
if (pMacro != NULL && ShowMacro(pMacro))
{
CSmartFieldListBoxItem* pItem = new CSmartFieldListBoxItem(pMacro, nMacro, m_pMacroServer);
ASSERT(pItem != NULL);
if (pItem != NULL)
{
AddString((LPCSTR)pItem);
}
}
}
SetRedraw(TRUE);
// No state is saved yet.
m_fSavedState = FALSE;
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:40,代码来源:MACRODLG.CPP
示例3: AddString
TiXmlNode * CargoHolder::WriteTransport(TiXmlNode * node) const
{
const Planet * p = dynamic_cast<const Planet *>(this);
if (p != NULL) {
AddString(node, "Planet", p->GetName().c_str());
return node;
}
const Fleet * f = dynamic_cast<const Fleet *>(this);
if (f != NULL) {
AddLong(node, "Fleet", GetID());
AddLong(node, "Owner", GetOwner()->GetID());
return node;
}
// const Packet * pac = dynamic_cast<const Packet *>(this);
// if (pac != NULL) {
// return node;
// }
return node;
}
开发者ID:vkholodkov,项目名称:freestars,代码行数:22,代码来源:CargoHolder.cpp
示例4: Java_com_rockgarden_sign_jni_JniSignHolder_getCustomInfoMD5
// JNIEnv *env, jobject thiz 默认传入
// 被调用的方法要放在前面,否则报错:conflicting types for "方法名"
JNIEXPORT jstring JNICALL Java_com_rockgarden_sign_jni_JniSignHolder_getCustomInfoMD5(
JNIEnv *env, jobject thiz, jobject ctx, jstring jInfo) {
jstring pkg_name = Java_com_rockgarden_sign_jni_Jni_GetPackageName(env, thiz, ctx);
char *c1 = Jstring2CStr(env, pkg_name);
char *c2 = "com.eastcom.mobile112";
int result = strcmp(c1, c2);
if (result == 0) {
char *str = "AD161C0F-D5B5-86F2-6DCF-7D9ADCBC1AC7";
jstring js = (*env)->NewStringUTF(env, str);
//(*env)->ReleaseStringUTFChars(env, js, str);
jstring newjs = AddString(env, jInfo, js);
return Java_com_rockgarden_sign_jni_JniSignHolder_getInfoMD5(env, thiz, newjs);
}
else {
char *c = "";
jstring js = (*env)->NewStringUTF(env, c);
//(*env)->ReleaseStringUTFChars(env, js, c);
return js;
}
}
开发者ID:rockgarden,项目名称:MyCard,代码行数:24,代码来源:sign.c
示例5: GetParent
int CInPlaceCombo::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CComboBox::OnCreate(lpCreateStruct) == -1)
{
return -1;
}
// Set the proper font
CFont* pFont = GetParent()->GetFont();
SetFont(pFont);
SetFocus();
ResetContent();
for (POSITION Pos_ = m_DropDownList.GetHeadPosition(); Pos_ != NULL;)
{
//AfxMessageBox((LPCTSTR) (m_DropDownList.GetNext(Pos_)));
AddString((LPCTSTR) (m_DropDownList.GetNext(Pos_)));
}
return 0;
}
开发者ID:wyrover,项目名称:myhistoryprojects,代码行数:22,代码来源:InPlaceCombo.cpp
示例6: ASSERT
int COXImageListBox::AddImageList(CImageList* pImageList)
{
if(m_imageList.GetImageCount()==0)
return -1;
ASSERT(pImageList!=NULL);
if(pImageList==NULL)
return -1;
if(pImageList->GetImageCount()==0)
return -1;
IMAGEINFO imageInfo;
VERIFY(pImageList->GetImageInfo(0,&imageInfo));
CRect rect(imageInfo.rcImage);
VERIFY(m_imageList.GetImageInfo(0,&imageInfo));
if(rect.Width()!=imageInfo.rcImage.right-imageInfo.rcImage.left ||
rect.Height()!=imageInfo.rcImage.bottom-imageInfo.rcImage.top)
{
return -1;
}
int nLastImage=GetCount();
int nIndex=0;
for(nIndex=0; nIndex<pImageList->GetImageCount(); nIndex++)
{
HICON hIcon=pImageList->ExtractIcon(nIndex);
ASSERT(hIcon!=NULL);
VERIFY(m_imageList.Add(hIcon)!=-1);
VERIFY(::DestroyIcon(hIcon));
}
for(nIndex=nLastImage; nIndex<m_imageList.GetImageCount(); nIndex++)
{
VERIFY(AddString((LPCTSTR)(INT_PTR)nIndex)>=0);
}
return nLastImage;
}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:39,代码来源:OXImageListBox.cpp
示例7: wsprintf
void TDrawListView::FormatData(const Tecg* ecg, int unsigned index)
{
// Large number for now :-)
char buf1[80];
char buf2[80];
char buf3[80];
char buf4[80];
char buf5[80];
// TColor color(line->QueryColor());
wsprintf(buf1, "No. Of Points in ECG = (%d)",
ecg->length());
wsprintf(buf2, "(x,y) Scales = (%d,%d)",
ecg->get_x_scale(), ecg->get_y_scale());
wsprintf(buf3, "R Hight threshold = (%d)",
ecg->get_r_thresh());
wsprintf(buf4, "R Change threshold = (%d)",
ecg->get_r_change());
wsprintf(buf5, "Y (min,max) = (%d,%d)",
ecg->get_y_min(), ecg->get_y_max());
wsprintf(buf5, "Y mean = (%d)",
ecg->get_y_mean());
// DeleteString(index);
ClearList();
AddString(ecg->ECG_Data_String1.c_str());
AddString(ecg->ECG_Data_String2.c_str());
AddString(ecg->ECG_Data_String3.c_str());
AddString(buf1);
AddString(buf2);
AddString(buf3);
AddString(buf4);
AddString(buf5);
SetSelIndex(index);
}
开发者ID:vagnerr,项目名称:ECGHolterMonitor,代码行数:36,代码来源:ecgdv.cpp
示例8: SUCCEEDED
/*++
Routine Name:
CUICtrlFeatNUpOrderCombo::OnInit
Routine Description:
This is responsible for initialising the control and is called when
the WM_INITDIALOG message is recieved. This method populates the combo
box with the appropriate option strings.
Arguments:
hDlg - handle to the parent window
Return Value:
HRESULT
S_OK - On success
E_* - On error
--*/
HRESULT
CUICtrlFeatNUpOrderCombo::OnInit(
__in CONST HWND hDlg
)
{
HRESULT hr = S_OK;
//
// Populate the combo box
//
if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTORTTOB)) &&
SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOBLTOR)) &&
SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOLTTOB)) &&
SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOBRTOL)) &&
SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTORBTOT)) &&
SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOTLTOR)) &&
SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOLBTOT)))
{
hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOTRTOL);
}
ERR_ON_HR(hr);
return hr;
}
开发者ID:kcrazy,项目名称:winekit,代码行数:47,代码来源:ftrctrls.cpp
示例9: ComposePkg
/**
*组装push消息接收到的响应包
*/
int ComposePkg(tASecMsgHead &stHead, tASecPushMsgRsp &stRsp, uint8_t *pPkg, int& iPkgBufSize)
{
//数据预处理.做个保护措施
stHead.usMsgType = MSG_TYPE_PUSH_MSG_RSP;
CK_STR(stRsp.aszErrMsg);
char szPkgBuf[1024];
char *pCur = szPkgBuf;
bzero(szPkgBuf, sizeof(szPkgBuf));
*pCur = 0x02;
pCur++;
tASecMsgHead* pHead = (tASecMsgHead*)pCur;
pCur+=sizeof(tASecMsgHead);
memcpy(pHead, &stHead, sizeof(stHead));
AddDWord(&pCur, NULL, stRsp.ulRet);
AddString(&pCur, NULL, stRsp.aszErrMsg, strlen(stRsp.aszErrMsg));
*pCur = 0x03;
pCur++;
int iPkgLen = pCur-szPkgBuf;
if (iPkgLen > iPkgBufSize)
{
return -2;
}
pHead->usLength = iPkgLen;
Hton(pHead);
memcpy(pPkg, szPkgBuf, iPkgLen);
iPkgBufSize=iPkgLen;
return 0;
}
开发者ID:businiaowyf,项目名称:mycode,代码行数:41,代码来源:asec_conn_proto.cpp
示例10: AddOutputMember
void UIBarButtonItem::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
AddOutputMember(writer, "UIEnabled", new XIBObjectBool(true));
if ( _systemItem != -1 ) {
AddInt(writer, "UISystemItem", _systemItem);
AddBool(writer, "UIIsSystemItem", true);
}
if ( _title ) AddString(writer, "UITitle", _title);
if ( !_customView ) {
if ( _style ) AddInt(writer, "UIStyle", _style);
if ( _width != -1.0f ) {
AddOutputMember(writer, "UIWidth", new XIBObjectFloat(_width));
}
}
if ( _customView ) {
AddOutputMember(writer, "UICustomView", _customView);
}
if ( _connections )
{
for ( int i = 0; i < _connections->count(); i ++ ) {
XIBObject *curObj = _connections->objectAtIndex(i);
if ( strcmp(curObj->_className, "segue") == 0 ) {
UIStoryboardSegue *segue = (UIStoryboardSegue *) curObj;
UIRuntimeEventConnection *newEvent = new UIRuntimeEventConnection();
newEvent->_label = "perform:";
newEvent->_source = this;
newEvent->_destination = segue;
writer->_connections->AddMember(NULL, newEvent);
writer->AddOutputObject(newEvent);
//AddOutputMember(writer, "UIOutlet", refObj);
}
}
}
ObjectConverterSwapper::ConvertStaticMappings(writer, obj);
}
开发者ID:netroby,项目名称:WinObjC,代码行数:38,代码来源:UIBarButtonItem.cpp
示例11: GUIListBoxAddTextList
bool GUIListBoxAddTextList( a_list *list, int items, const void *data_handle, GUIPICKGETTEXT *getstring )
{
int item;
lb_data old_data;
lb_data new_data;
gui_ctl_idx choice;
choice = -1;
old_data = (lb_data)list->data_handle;
new_data = ResizeList( list, items, &choice );
if( new_data == NULL ) {
return( false );
}
for( item = 0; item < items; ++item ) {
if( !AddString( new_data, getstring( data_handle, item ), choice + item ) ) {
return( false );
}
}
GUIMemFree( (void *)old_data );
list->data_handle = (const void *)new_data;
uiupdatelistbox( list );
return( true );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:23,代码来源:guilistb.c
示例12: while
//
/// Add item into checklist box.
//
/// Adds string of item to the list box, returning its position in the list
/// (0 is the first position). Returns a negative value if an error occurs.
/// The list items are automatically sorted unless the style LBS_SORT
/// is not used for list box creation.
//
int
TCheckList::AddItem(TCheckListItem* item)
{
if(item){
if (GetStyle() & LBS_SORT){
int i=0;
while(i < (int)Items.Size()){
if(*Items[i] > *item)
break;
i++;
}
if(i >= (int)Items.Size())
i = -1;
return InsertItem(item, i);
}
else{
if(GetHandle() && AddString((LPTSTR)item) < 0)
return -1;
return Items.Add(item);
}
}
return -1;
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:31,代码来源:checklst.cpp
示例13: AddFlags
void AuxGroupMember::BuildExtendedPacket(unsigned char *buffer, long &index)
{
AddFlags(ExtendedFlags, sizeof(ExtendedFlags), buffer, index);
if (ExtendedFlags[0] & 0x10) //ExtendedFlags[1] & 0x01
{
AddString(buffer, Data->Name, index);
}
if (ExtendedFlags[0] & 0x20) //ExtendedFlags[1] & 0x02
{
AddData(buffer, Data->GameID, index);
}
if (ExtendedFlags[0] & 0x40) //ExtendedFlags[1] & 0x04
{
AddData(buffer, Data->Formation, index);
}
if (ExtendedFlags[0] & 0x80) //ExtendedFlags[1] & 0x08
{
AddData(buffer, Data->Position, index);
}
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:24,代码来源:AuxGroupMember.cpp
示例14: SetPluginMenu
void cPlugDetailOsdMenu::SetDetail()
{
SetPluginMenu(meDetail, libvdrskinservice::mtText);
Clear();
ClearValues();
SetText("Text to be displayed if skin doesn't know anything about this plugin");
AddInt("menuitem", element);
AddString("tabtext", "String value to be displayed if skin doesn't know anything about this plugin");
//Loop Token Example
for (int row = 0; row < 25; row++) {
libvdrskinservice::cKeyValueList<cString> *loopValues = new libvdrskinservice::cKeyValueList<cString>();
for (int col = 0; col < 10; col++) {
cString key = cString::sprintf("loop1[col%d]", col);
cString *value = new cString(cString::sprintf("row%d-col%d", row, col));
loopValues->AddKeyValue(*key, value);
}
AddLoopValues("loop1", loopValues);
}
Display();
}
开发者ID:flensrocker,项目名称:libvdrskinservice,代码行数:24,代码来源:osdmenu.c
示例15: SetNoticeProfile
bool _XNoticeProcess::SetNoticeProfile( int nMsgType, LPTSTR pMsg, int nMinStartTime, int nMinInterval, int nPrintCount, BOOL bLargeFont )
{
vector<sMsgInfo*>::iterator iter = m_vtInfo.begin();
for(; iter != m_vtInfo.end(); ++iter )
{
// ID 가 등록되어있으면 리턴
if( (*iter)->nMsgID == nMsgType )
return false;
}
// 메세지 정보 생성
sMsgInfo* pMsgInfo = new sMsgInfo;
// 아이디와 시작시간, 반복시간을 저장한다
// nPrintCount 가 -1 이 아닌 양수가 지정되어있으면 그 숫자 만큼만 출력, 0 이면 절대 출력 되지 않음
pMsgInfo->SetInfo( nMsgType, nMinStartTime, nMinInterval, nPrintCount, bLargeFont );
m_vtInfo.push_back( pMsgInfo );
if( !AddString( nMsgType, pMsg ))
return false;
return true;
}
开发者ID:F5000,项目名称:spree,代码行数:24,代码来源:XNoticeProcess.cpp
示例16: COrderListBoxItem
void COrderListBox::AddItems(CProductItems* pItems, int nIndent)
{
int nCount = pItems->ItemCount();
for (int nIndex = 0; nIndex < nCount; nIndex++)
{
CProductItem* pItem = pItems->Item(nIndex);
if (pItem != NULL)
{
COrderListBoxItem* pListBoxItem = new COrderListBoxItem(pItem, nIndent);
if (pListBoxItem != NULL)
{
pListBoxItem->Mark(pItem->TestFlag(PRODUCT_ITEM_Marked));
pListBoxItem->Select(pItem->TestFlag(PRODUCT_ITEM_Selected));
AddString((LPCSTR)pListBoxItem);
AddItems(pItem->Items(), nIndent+1);
}
}
}
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:24,代码来源:ORDERLB.CPP
示例17: ResetContent
BOOL CKTypeComboBox::Initialize( )
{
ResetContent();
int ktype, nIndex, nSel = CB_ERR;
ktype = CKData::ktypeMin5;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMin15;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMin30;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMin60;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeDay;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
nSel = nIndex;
ktype = CKData::ktypeWeek;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMonth;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
SetCurSel( nSel );
return TRUE;
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:38,代码来源:SetParamDlg.cpp
示例18: Java_org_nhnnext_ndktest_MainActivity_getAddedStringFromNative
JNIEXPORT jstring Java_org_nhnnext_ndktest_MainActivity_getAddedStringFromNative( JNIEnv* env, jobject obj) {
return (*env)->NewStringUTF(env, AddString());
}
开发者ID:baducki,项目名称:android_NDK,代码行数:4,代码来源:main.c
示例19: atcprintf
//.........这里部分代码省略.........
}
case 'L':
{
CHECK_ARGS(0);
cell_t *value;
pCtx->LocalToPhysAddr(params[arg], &value);
char buffer[255];
if (*value)
{
CPlayer *player = g_Players.GetPlayerByIndex(*value);
if (!player || !player->IsConnected())
{
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
}
const char *auth = player->GetAuthString();
if (!auth || auth[0] == '\0')
{
auth = "STEAM_ID_PENDING";
}
int userid = engine->GetPlayerUserId(player->GetEdict());
UTIL_Format(buffer,
sizeof(buffer),
"%s<%d><%s><>",
player->GetName(),
userid,
auth);
}
else
{
UTIL_Format(buffer,
sizeof(buffer),
"Console<0><Console><Console>");
}
AddString(&buf_p, llen, buffer, width, prec);
arg++;
break;
}
case 'N':
{
CHECK_ARGS(0);
cell_t *value;
pCtx->LocalToPhysAddr(params[arg], &value);
const char *name = "Console";
if (*value)
{
CPlayer *player = g_Players.GetPlayerByIndex(*value);
if (!player || !player->IsConnected())
{
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
}
name = player->GetName();
}
AddString(&buf_p, llen, name, width, prec);
arg++;
break;
}
case 's':
{
CHECK_ARGS(0);
char *str;
int err;
if ((err=pCtx->LocalToString(params[arg], &str)) != SP_ERROR_NONE)
{
pCtx->ThrowNativeErrorEx(err, "Could not deference string");
return 0;
开发者ID:Nephyrin,项目名称:-furry-octo-nemesis,代码行数:67,代码来源:sm_stringutil.cpp
示例20: gnprintf
//.........这里部分代码省略.........
{
if (!llen)
{
goto done;
}
char *c = (char *)args[arg];
*buf_p++ = *c;
llen--;
arg++;
break;
}
case 'b':
{
int *value = (int *)args[arg];
AddBinary(&buf_p, llen, *value, width, flags);
arg++;
break;
}
case 'd':
case 'i':
{
int *value = (int *)args[arg];
AddInt(&buf_p, llen, *value, width, flags);
arg++;
break;
}
case 'u':
{
unsigned int *value = (unsigned int *)args[arg];
AddUInt(&buf_p, llen, *value, width, flags);
arg++;
break;
}
case 'f':
{
float *value = (float *)args[arg];
AddFloat(&buf_p, llen, *value, width, prec, flags);
arg++;
break;
}
case 's':
{
const char *str = (const char *)args[arg];
AddString(&buf_p, llen, str, width, prec);
arg++;
break;
}
case 'X':
{
unsigned int *value = (unsigned int *)args[arg];
flags |= UPPERDIGITS;
AddHex(&buf_p, llen, *value, width, flags);
arg++;
break;
}
case 'x':
{
unsigned int *value = (unsigned int *)args[arg];
AddHex(&buf_p, llen, *value, width, flags);
arg++;
break;
}
case '%':
{
if (!llen)
{
goto done;
}
*buf_p++ = ch;
llen--;
break;
}
case '\0':
{
if (!llen)
{
goto done;
}
*buf_p++ = '%';
llen--;
goto done;
}
default:
{
if (!llen)
{
goto done;
}
*buf_p++ = ch;
llen--;
break;
}
}
}
done:
*buf_p = '\0';
return (maxlen - llen - 1);
}
开发者ID:Nephyrin,项目名称:-furry-octo-nemesis,代码行数:101,代码来源:sm_stringutil.cpp
注:本文中的AddString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论