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


C++ GET_STRING函数代码示例

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


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

示例1: zgossip_msg_decode

zgossip_msg_t *
zgossip_msg_decode (zmsg_t **msg_p)
{
    assert (msg_p);
    zmsg_t *msg = *msg_p;
    if (msg == NULL)
        return NULL;
        
    zgossip_msg_t *self = zgossip_msg_new (0);
    //  Read and parse command in frame
    zframe_t *frame = zmsg_pop (msg);
    if (!frame) 
        goto empty;             //  Malformed or empty

    //  Get and check protocol signature
    self->needle = zframe_data (frame);
    self->ceiling = self->needle + zframe_size (frame);
    uint16_t signature;
    GET_NUMBER2 (signature);
    if (signature != (0xAAA0 | 0))
        goto empty;             //  Invalid signature

    //  Get message id and parse per message type
    GET_NUMBER1 (self->id);

    switch (self->id) {
        case ZGOSSIP_MSG_HELLO:
            break;

        case ZGOSSIP_MSG_ANNOUNCE:
            GET_STRING (self->endpoint);
            GET_STRING (self->service);
            break;

        case ZGOSSIP_MSG_PING:
            break;

        case ZGOSSIP_MSG_PONG:
            break;

        case ZGOSSIP_MSG_INVALID:
            break;

        default:
            goto malformed;
    }
    //  Successful return
    zframe_destroy (&frame);
    zmsg_destroy (msg_p);
    return self;

    //  Error returns
    malformed:
        printf ("E: malformed message '%d'\n", self->id);
    empty:
        zframe_destroy (&frame);
        zmsg_destroy (msg_p);
        zgossip_msg_destroy (&self);
        return (NULL);
}
开发者ID:Lucky7Studio,项目名称:czmq,代码行数:60,代码来源:zgossip_msg.c

示例2: GET_STRING

void CGameMenu::FixLevelLabel(BOOL fRusLng)
{
	if (!fRusLng)
		GET_STRING()->SetPos(m_iLevelId, 380, 168, 8);
	else
		GET_STRING()->SetPos(m_iLevelId, 350, 168, 8);
}
开发者ID:rustamserg,项目名称:PLAINX,代码行数:7,代码来源:gmenu.cpp

示例3: func_string_to_list

CELL func_string_to_list(CELL frame)
{
	CELL string = FV0;
	if (!STRINGP(string)) {
		return make_exception("expects string");
	}
	CELL result = V_NULL;
	CELL pre_tail = V_EMPTY;

	gc_root_3("func_string_to_list", string, result, pre_tail);

	const size_t len = GET_STRING(string)->len;
	int i;
	for(i = 0; i < len; ++i) {
		const CELL next = make_cons(make_char(GET_STRING(string)->data[i]), V_NULL);
		if (i == 0) {
			result = next;
		}
		else {
			CDR(pre_tail) = next;
		}
		pre_tail = next;
	}
	gc_unroot();
	return result;
}
开发者ID:adrmcintyre,项目名称:wisp,代码行数:26,代码来源:string.c

示例4: func_substring

CELL func_substring(CELL frame)
{
	CELL string = FV0;
	CELL start = FV1;
	CELL end = FV2;
	if (!STRINGP(string)) {
		return make_exception("expects a string");
	}
	if (!INTP(start)) {
		return make_exception("expects a non-negative start index");
	}
	if (!INTP(end)) {
		return make_exception("expects a non-negative end index");
	}

	size_t len = GET_STRING(string)->len;
	size_t starti = GET_INT(start);
	size_t endi = GET_INT(end);
	if (starti < 0 || starti > len) {
		return make_exception("start index %d out of range [0,%d]", starti, len);
	}
	if (endi < starti || endi > len) {
		return make_exception("end index %d out of range [%d,%d]", endi, starti, len);
	}

	gc_root_1("func_substring", string);
	CELL result = make_string_raw(endi - starti);
	gc_unroot();
	memcpy(GET_STRING(result)->data, GET_STRING(string)->data + starti, endi - starti);
	return result;
}
开发者ID:adrmcintyre,项目名称:wisp,代码行数:31,代码来源:string.c

示例5: qopqdp_lattice_writer

// 1: lattice
// 2: filename
// 3: metadata
static int
qopqdp_lattice_writer(lua_State *L)
{
    BEGIN_ARGS;
    GET_LATTICE(lat);
    GET_STRING(fn);
    GET_STRING(md);
    END_ARGS;
    qopqdp_writer_create(L, fn, md, lat);
    return 1;
}
开发者ID:jcosborn,项目名称:qhmc,代码行数:14,代码来源:lattice.c

示例6: ComMaterial

/*-----------------------------------------------------------------------------------------*
| <<< コマンド : Material >>>
|	入力	bUV = false : uv のチェックを行わない(法線マップを作成する際に使用)
*-----------------------------------------------------------------------------------------*/
static	void	ComMaterial(BOOL bUV)
{
	float	a;

	iMetaCount	   += PARAM_GET(&a,	&MetaText[iMetaCount]);
	meta->iMatCount	= (int)a;				// マテリアル総数
	iMetaCount	   += 1;					// "{" 分移動
											// テクスチャーデータの書き込み位置を設定
	meta->pTex		= &meta->atex[meta->iMatID];
	//--- 各パラメータ抽出 ------------------------------------------
	while(MetaText[iMetaCount] != '}')
	{										// 改行を見つけたら、次へすすむ
		char	str[512];

		if(MetaText[iMetaCount]	== '\r'	&& MetaText[iMetaCount + 1]	== '\n')
		{
			meta->iMatID++;					// マテリアル読み込み終了なので、次へ進める
											// テクスチャーデータの書き込み位置を設定
			meta->pTex  = &meta->atex[meta->iMatID];

			iMetaCount += 2;
			//--- マテリアル名を得る --------------------------------
			int		i  = GET_STRING(str, &MetaText[iMetaCount]);

			if(meta_obj_name_func != NULL)	// オブジェ名を外部へ渡す
			{
				void(*func)(int iNum, char *str);
				func = (void(*)(int iNum, char *str))meta_obj_name_func;
				(*func)(meta->iMatID, str);
			}
			iMetaCount += i;
			//-------------------------------------------------------
		}

		//--- コマンドチェック --------------------------------------
		BOOL	bRet = CommandCheck(bUV);

		//--- 半角・全角チェック ------------------------------------
		if(!bRet)
		{
			//char	str[512];				// ダブルクォーテーション中に コマンドが入っているのを防ぐため、こうする。
			int		i   = GET_STRING(str, &MetaText[iMetaCount]);
			iMetaCount += i;
			if(i ==	0)
			{
				if(ISKANJI(MetaText[iMetaCount])){ iMetaCount += 2;}	// 全角
				else							 { iMetaCount += 1;}	// 半角
			}
		}
	}
	iMetaCount++;
	meta->pTex = NULL;						// テクスチャーデータの書き込み位置をクリアー
}
开发者ID:Github-J,项目名称:WinGames,代码行数:57,代码来源:_mqo.cpp

示例7: func_string_copy

CELL func_string_copy(CELL frame)
{
	CELL string = FV0;
	if (!STRINGP(string)) {
		return make_exception("expects a string");
	}
	gc_root_1("func_string_copy", string);
	CELL result = make_string_raw(GET_STRING(string)->len);
	gc_unroot();

	STRING *str = GET_STRING(string);
	memcpy(GET_STRING(result)->data, str->data, str->len);
	return result;
}
开发者ID:adrmcintyre,项目名称:wisp,代码行数:14,代码来源:string.c

示例8: DCAST

void QueryWindow::onPrivmsgMessage(Event *pEvent)
{
    Message msg = DCAST(MessageEvent, pEvent)->getMessage();
    if(m_pSession->isMyNick(msg.m_params[0]))
    {
        QString fromNick = parseMsgPrefix(msg.m_prefix, MsgPrefixName);
        if(isTargetNick(fromNick))
        {
            QString textToPrint;
            bool shouldHighlight = false;
            OutputMessageType msgType = MESSAGE_CUSTOM;

            CtcpRequestType requestType = getCtcpRequestType(msg);
            if(requestType != RequestTypeInvalid)
            {
                // ACTION is /me, so handle according to that.
                if(requestType == RequestTypeAction)
                {
                    QString action = msg.m_params[1];

                    // Action is in the format of "\1ACTION <action>\1", so
                    // the first 8 and last 1 characters will be excluded.
                    msgType = MESSAGE_IRC_ACTION;
                    QString msgText = action.mid(8, action.size()-9);
                    shouldHighlight = containsNick(msgText);
                    textToPrint = GET_STRING("message.action")
                                  .arg(fromNick)
                                  .arg(msgText);
                }
            }
            else
            {
                msgType = MESSAGE_IRC_SAY;
                shouldHighlight = containsNick(msg.m_params[1]);
                textToPrint = GET_STRING("message.say")
                              .arg(fromNick)
                              .arg(msg.m_params[1]);
            }

            if(!hasFocus())
            {
                QApplication::alert(this);
            }

            printOutput(textToPrint, msgType, shouldHighlight ? COLOR_HIGHLIGHT : COLOR_NONE);
        }
    }
}
开发者ID:blockchain-research-foundation,项目名称:pebblecoin,代码行数:48,代码来源:QueryWindow.cpp

示例9: Java_org_codeworker_jni_ParseTree_addItem

/*
* Class:     org_codeworker_jni_ParseTree
* Method:    insertItem
* Signature: (Ljava/lang/String;Lorg/codeworker/ParseTree;)Lorg/codeworker/ParseTree;
*/
JNIEXPORT jobject JNICALL Java_org_codeworker_jni_ParseTree_addItem(JNIEnv *pEnv, jobject jObject, jstring jKey) {
	GET_PARSETREE_HANDLE(Object);
	GET_STRING(Key);
	jobject  result = createWrapper(pEnv, pObjectClass, pObjectInstance->addElement(tcKey));
	RELEASE_STRING(Key);
	return result;
}
开发者ID:canercandan,项目名称:codeworker,代码行数:12,代码来源:JNIParseTree.cpp

示例10: Java_org_codeworker_jni_ParseTree_insertNode

/*
* Class:     org_codeworker_jni_ParseTree
* Method:    insertNode
* Signature: (Ljava/lang/String;)Lorg/codeworker/ParseTree;
*/
JNIEXPORT jobject JNICALL Java_org_codeworker_jni_ParseTree_insertNode(JNIEnv *pEnv, jobject jObject, jstring jAttribute) {
	GET_PARSETREE_HANDLE(Object);
	GET_STRING(Attribute);
	jobject  result = createWrapper(pEnv, pObjectClass, pObjectInstance->insertNode(tcAttribute));
	RELEASE_STRING(Attribute);
	return result;
}
开发者ID:canercandan,项目名称:codeworker,代码行数:12,代码来源:JNIParseTree.cpp

示例11: make_string

CELL make_string(char *s)
{
	size_t k = strlen(s);
	CELL cell = make_string_raw(k);
	memcpy(GET_STRING(cell)->data, s, k);
	return cell;
}
开发者ID:adrmcintyre,项目名称:wisp,代码行数:7,代码来源:heap.c

示例12: ucnv_io_getAlias

static const char*
ucnv_io_getAlias(const char* alias, uint16_t n, UErrorCode* pErrorCode) {
    if (haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
        uint32_t convNum = findConverter(alias, NULL, pErrorCode);
        if (convNum < gMainTable.converterListSize) {
            /* tagListNum - 1 is the ALL tag */
            int32_t listOffset = gMainTable.taggedAliasArray[
                    (gMainTable.tagListSize - 1) * gMainTable.converterListSize + convNum];

            if (listOffset) {
                uint32_t listCount = gMainTable.taggedAliasLists[listOffset];
                /* +1 to skip listCount */
                const uint16_t* currList = gMainTable.taggedAliasLists + listOffset + 1;

                if (n < listCount) {
                    return GET_STRING(currList[n]);
                }
                *pErrorCode = U_INDEX_OUTOFBOUNDS_ERROR;
            }
            /* else this shouldn't happen. internal program error */
        }
        /* else converter not found */
    }
    return NULL;
}
开发者ID:mathtexts,项目名称:uimacpp,代码行数:25,代码来源:ucnv_io.c

示例13: ucnv_io_getAliases

static uint16_t
ucnv_io_getAliases(const char* alias, uint16_t start, const char** aliases, UErrorCode* pErrorCode) {
    if (haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
        uint32_t currAlias;
        uint32_t convNum = findConverter(alias, NULL, pErrorCode);
        if (convNum < gMainTable.converterListSize) {
            /* tagListNum - 1 is the ALL tag */
            int32_t listOffset = gMainTable.taggedAliasArray[
                    (gMainTable.tagListSize - 1) * gMainTable.converterListSize + convNum];

            if (listOffset) {
                uint32_t listCount = gMainTable.taggedAliasLists[listOffset];
                /* +1 to skip listCount */
                const uint16_t* currList = gMainTable.taggedAliasLists + listOffset + 1;

                for (currAlias = start; currAlias < listCount; currAlias++) {
                    aliases[currAlias] = GET_STRING(currList[currAlias]);
                }
            }
            /* else this shouldn't happen. internal program error */
        }
        /* else converter not found */
    }
    return 0;
}
开发者ID:mathtexts,项目名称:uimacpp,代码行数:25,代码来源:ucnv_io.c

示例14: func_string_length

CELL func_string_length(CELL frame)
{
	if (!STRINGP(FV0)) {
		return make_exception("expects string");
	}
	return make_int(GET_STRING(FV0)->len);
}
开发者ID:adrmcintyre,项目名称:wisp,代码行数:7,代码来源:string.c

示例15: GetScene

void CGameMenu::DrawStartMenu()
{
    GetScene()->SetVisible(FALSE);
    GET_SCENE("level")->SetVisible(FALSE);
    GET_SCENE("actor")->SetVisible(FALSE);
	GET_STRING()->SetVisible(FALSE);

    GET_ENGINE()->SetRTIntVar(NA_RT_GAME_STATE, GS_MENU);

    GET_SPRITE("stmback")->SetVisible(TRUE);
    GET_SPRITE("stmback")->SetZPos(6);

    m_pPLBut->DrawButton(50, 380 ,7);
	m_pOptBut->DrawButton(50, 340, 7);
	m_pHelpBut->DrawButton(50, 300, 7);
    m_pQBut->DrawButton(50, 260, 7);

	DrawMiniLevel(GET_ENGINE()->GetRTIntVar(NA_RT_CURR_LEVEL_NUMBER));

	if (strcmp(GET_ENGINE()->GetRTStringVar(NA_RT_BACK_MUSIC), "backlogo") != 0) {
		GET_AUDIO()->StopMusic(GET_ENGINE()->GetRTStringVar(NA_RT_BACK_MUSIC));
		GET_ENGINE()->SetRTStringVar(NA_RT_BACK_MUSIC, "backlogo");

		int iMusVol;
		GET_ENGINE()->GetVars("config")->GetInt(L_GROUP, "config", "musvol", 0, &iMusVol);
		GET_AUDIO()->SetMusicVolume(GET_ENGINE()->GetRTStringVar(NA_RT_BACK_MUSIC), iMusVol);

		GET_AUDIO()->PlayMusic(GET_ENGINE()->GetRTStringVar(NA_RT_BACK_MUSIC));
	}
}
开发者ID:rustamserg,项目名称:PLAINX,代码行数:30,代码来源:gmenu.cpp


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