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


C++ StringCopy函数代码示例

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


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

示例1: ScrCmd_bufferfirstpoke

bool8 ScrCmd_bufferfirstpoke(struct ScriptContext *ctx)
{
    u8 stringVarIndex = ScriptReadByte(ctx);
    u8 *dest = gUnknown_083762F0[stringVarIndex];
    u8 partyIndex = GetLeadMonIndex();
    u32 species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES, NULL);
    StringCopy(dest, gSpeciesNames[species]);
    return FALSE;
}
开发者ID:pret,项目名称:pokeruby,代码行数:9,代码来源:scrcmd.c

示例2: HoroscopeExtractFromUDF

DefinitionModel* HoroscopeExtractFromUDF(const UniversalDataFormat& udf, char_t*& date)
{
    DefinitionModel* model = new_nt DefinitionModel();
    if (NULL == model)
        return NULL;
    
    ulong_t size = udf.getItemsCount();       
    for (ulong_t i=0; i < size; i++)
    {
        const char* type = udf.getItemData(i, 0);
        if (StrEquals(horoscopeTitle, type))
        {
            TXT(udf.getItemText(i, 1));
            model->last()->setStyle(StyleGetStaticStyle(styleNameBold));
            model->last()->setJustification(DefinitionElement::justifyCenter);
        }
        else if (StrEquals(horoscopeText, type))
        {
            LBR();
            TXT(udf.getItemText(i, 1));
        }
        else if (StrEquals(horoscopeSection, type))
        {
            LBR();
            LBR();
            TXT(udf.getItemText(i, 1));
            model->last()->setStyle(StyleGetStaticStyle(styleNameBold));
        }
        else if (StrEquals(horoscopeSmallSection, type))
        {
            LBR();
            TXT(udf.getItemText(i, 1));
            model->last()->setStyle(StyleGetStaticStyle(styleNameBold));
        }
        else if (StrEquals(horoscopeDate, type))
        {
            char_t* d = StringCopy(udf.getItemText(i, 1));
            free(date);
            date = d;
            if (NULL == date)
                goto Error;
        }
        else if (StrEquals(horoscopeUrlLink, type))
        {
            LBR();
            TXT(udf.getItemText(i, 1));
            model->last()->setActionCallback(HoroscopesLinkCallback, (void*)udf.getItemData(i, 2));
            model->last()->setHyperlink("", hyperlinkCallback);
        }            
        else
            goto Error;
    }   
    return model;    
Error:
    delete model;
    return NULL;     
}
开发者ID:kjk,项目名称:moriarty-sm,代码行数:57,代码来源:HoroscopesModule.cpp

示例3: CREATE

RptField *RptFieldCreate(char *s, int just)
{
    RptField	*rf;
    rf = CREATE(RptField);
    rf->s = StringCopy(s, "RptFieldCreate");
    rf->just = just;
    rf->next = NULL;
    return(rf);
}
开发者ID:eriktmueller,项目名称:thoughttreasure,代码行数:9,代码来源:utilrpt.c

示例4: ScrCmd_vbuffer

bool8 ScrCmd_vbuffer(struct ScriptContext *ctx)
{
    u8 stringVarIndex = ScriptReadByte(ctx);
    u32 addr = ScriptReadWord(ctx);
    u8 *src = (u8 *)(addr - gUnknown_0202E8B0);
    u8 *dest = gUnknown_083762F0[stringVarIndex];
    StringCopy(dest, src);
    return FALSE;
}
开发者ID:pret,项目名称:pokeruby,代码行数:9,代码来源:scrcmd.c

示例5: ResetRtcScreen_PrintTime

void ResetRtcScreen_PrintTime(u8 x, u8 y, u16 days, u8 hours, u8 minutes, u8 seconds)
{
    u8 *dest = gStringVar4;
    days %= 10000;
    hours %= 24;
    minutes %= 60;
    seconds %= 60;
    AlignInt2InMenuWindow(gStringVar1, days, 24, 1);
    dest = StringCopy(dest, gStringVar1);
    dest = StringCopy(dest, gOtherText_Day);
    AlignInt2InMenuWindow(gStringVar1, hours, 18, 1);
    dest = StringCopy(dest, gStringVar1);
    dest = StringCopy(dest, gUnknown_08376500);
    dest = ConvertIntToDecimalStringN(dest, minutes, STR_CONV_MODE_LEADING_ZEROS, 2);
    dest = StringCopy(dest, gUnknown_08376500);
    ConvertIntToDecimalStringN(dest, seconds, STR_CONV_MODE_LEADING_ZEROS, 2);
    Menu_PrintText(gStringVar4, x, y);
}
开发者ID:huderlem,项目名称:pokeruby,代码行数:18,代码来源:reset_rtc_screen.c

示例6: sprintf

bool StructuredSVM::SaveTrainingSet(int start_from) {
  if(!trainfile && modelfile) {
    char tmp[1000];
    sprintf(tmp, "%s.train", modelfile);
    trainfile = StringCopy(tmp);
  }
  if(trainfile) return SaveDataset(trainset, trainfile, start_from);

  return false;
}
开发者ID:Yinxiaoli,项目名称:code,代码行数:10,代码来源:structured_svm.cpp

示例7: FloatToString

char * FloatToString(Float value)
{
	std::ostringstream oss;
	if ((oss << value) == false)
	{
		return "";
	}

	return StringCopy(oss.str().c_str());
}
开发者ID:Dingf,项目名称:Paper-TD,代码行数:10,代码来源:utility.cpp

示例8: CCOMString

CCOMString CCOMString::Left(int nCount) 
{
	if (nCount < 0)
		nCount = 0;
	if (nCount >= GetLength())
		return CCOMString(*this);

	CCOMString newStr;
	StringCopy(newStr, nCount, 0, 0);
	return newStr;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:11,代码来源:crt_cstring.cpp

示例9: CCOMStringW

CCOMStringW CCOMStringW::Right(int nCount) 
{
	if (nCount < 0)
		nCount = 0;
	if (nCount >= GetLength())
		return CCOMStringW(*this);

	CCOMStringW newStr;
	StringCopy(newStr, nCount, GetLength() - nCount, 0);
	return newStr;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:11,代码来源:crt_cstringw.cpp

示例10: StringInit

CMyNumString::CMyNumString(const char *psz)
{
    StringInit();

    if (!CheckNum(psz))
    {
        return;
    }

    StringCopy(psz);
}
开发者ID:xuwenbo,项目名称:KR_CPP,代码行数:11,代码来源:CMyString.cpp

示例11: ProjectInit

rc_t ProjectInit ( Project* self, uint32_t p_id, const String* name, const String* download_ticket, const String* encryption_key )
{
    rc_t rc = 0;
    memset(self, 0, sizeof(Project)); 
    self->id = p_id;
    rc = StringCopy((const String**)&self->name, name);
    if (rc == 0)
    {
        rc = StringCopy((const String**)&self->download_ticket, download_ticket);
        if (rc == 0)
        {
            rc = StringCopy((const String**)&self->encryption_key, encryption_key);
            if (rc != 0)
                StringWhack(self->download_ticket);
        }
        else
            StringWhack(self->name);
    }
    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:20,代码来源:keyring-data.c

示例12: StringCopy

void StructuredSVM::LoadTrainset(const char *fname) {
  if(trainfile) free(trainfile);
  trainfile = StringCopy(fname);

  trainset = LoadDataset(fname);
  if(!trainset) {
    fprintf(stderr, "Failed to load trainset %s\n", fname);
    assert(trainset != NULL);
    exit(0);
  }
}
开发者ID:Yinxiaoli,项目名称:code,代码行数:11,代码来源:structured_svm.cpp

示例13: func_22

struct<6> func_22()
{
	char[24] cVar0;
	
	StringCopy(&cVar0, "NULL", 24);
	if (Global_15712 == 4)
	{
		return Global_15331;
	}
	return cVar0;
}
开发者ID:Xaymar,项目名称:Grand-Theft-Auto-5,代码行数:11,代码来源:maude_postbailbond.c

示例14: test_StringCopy

void test_StringCopy()
{
    char *src = "normal string";
    char dest[128];

    I32 result = StringCopy(dest, 128, src, 0);
    ERROR(result == 13);
    ERROR(StringCompare(dest, src) == 0);

    result = StringCopy(dest, 128, src, 6);
    ERROR(result == 6);
    ERROR(StringCompare(dest, "normal") == 0);

    result = StringCopy(dest, 3, src, 128);
    ERROR(result == 2);
    ERROR(StringCompare(dest, "no") == 0);

    result = StringCopy(dest, 128, "", 128);
    ERROR(result == 0);
    ERROR(StringCompare(dest, "") == 0);
}
开发者ID:superCleo,项目名称:QuakeZero,代码行数:21,代码来源:tests.cpp

示例15: cDecodePgn129809

void cDecodePgn129809(const tNmea2KMsg *msg, void* pData)
{
    tcPgn129809Data *pDecodeData = (tcPgn129809Data*)pData;

    pDecodeData->MessageId = msg->data[0] & 0x3F;
    pDecodeData->RepeatIndicator = (msg->data[0] >> 6) & 0x03;
    ULongIn(pDecodeData->UserId, msg->data + 1 );

    StringCopy(pDecodeData->Name, (char*)(msg->data + 5), PGN129809_NAME_LENGTH_BYTES + 1); // + 0-termination

    pDecodeData->AisTranceiverInformation = msg->data[25] & 0x1F;
}
开发者ID:dulton,项目名称:53_hero,代码行数:12,代码来源:Pgn129809.c


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