• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GET_STRING函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: DO_Printer_postScriptSettings

static int DO_Printer_postScriptSettings (UiForm *dia, const wchar_t *sendingString_dummy, Interpreter *interpreter_dummy, const wchar_t *invokingButtonTitle, bool modified, void *dummy) {
	(void) sendingString_dummy;
	(void) interpreter_dummy;
	(void) invokingButtonTitle;
	(void) modified;
	(void) dummy;
	#if defined (_WIN32) || defined (macintosh)
		thePrinter. allowDirectPostScript = GET_INTEGER (L"Allow direct PostScript");
	#endif
	thePrinter. spots = GET_ENUM (kGraphicsPostscript_spots, L"Grey resolution");
	#if defined (UNIX)
		thePrinter. paperSize = GET_ENUM (kGraphicsPostscript_paperSize, L"Paper size");
	 	if (thePrinter. paperSize == kGraphicsPostscript_paperSize_A3) {
	 		thePrinter. paperWidth = 842 * thePrinter. resolution / 72;
	 		thePrinter. paperHeight = 1191 * thePrinter. resolution / 72;
		} else if (thePrinter. paperSize == kGraphicsPostscript_paperSize_US_LETTER) {
			thePrinter. paperWidth = 612 * thePrinter. resolution / 72;
			thePrinter. paperHeight = 792 * thePrinter. resolution / 72;
		} else {
			thePrinter. paperWidth = 595 * thePrinter. resolution / 72;
			thePrinter. paperHeight = 842 * thePrinter. resolution / 72;
		}
		thePrinter. orientation = GET_ENUM (kGraphicsPostscript_orientation, L"Orientation");
		thePrinter. magnification = GET_REAL (L"Magnification");
		Site_setPrintCommand (GET_STRING (L"printCommand"));
	#endif
	thePrinter. fontChoiceStrategy = GET_ENUM (kGraphicsPostscript_fontChoiceStrategy, L"Font choice strategy");
	#if defined (macintosh)
		thePrinter. epsFilesHavePreview = GET_INTEGER (L"EPS files include preview");
	#endif
	return 1;
}
开发者ID:alekstorm,项目名称:tala,代码行数:32,代码来源:Printer.cpp


示例17: get_parsed_record

static 
struct ParsedRecord* 
get_parsed_record(struct ParsedRecord* record,
		  const struct KeyList* keys,
		  struct internal_parse_data* params_array, 
		  int params_count){
    assert(keys);
    int i;
    for(i=0; i < params_count; i++ ){
	/*if key matched it return key index, in specified list of expecting keys so it's
	 *guarantied that key always has determinded index even for unspecified their order*/
	int key_index =  keys->find(keys, params_array[i].key, params_array[i].keylen);
	/*if current key is wrong*/
	if ( key_index < 0 ){
#ifdef PARSER_DEBUG_LOG
	    ZRT_LOG(L_ERROR, "invalid key '%s'", 
		    GET_STRING(params_array[i].key, params_array[i].keylen ) );
#endif
	    return NULL; /*error*/
	}
	else{
	    /*save current param*/
	    record->parsed_params_array[key_index].key_index = key_index; /*param index*/
	    record->parsed_params_array[key_index].val = params_array[i].val;
	    record->parsed_params_array[key_index].vallen = params_array[i].vallen;
	}
    }
    return record;
}
开发者ID:VanL,项目名称:zrt,代码行数:29,代码来源:conf_parser.c


示例18: ucnv_io_getConverterName

U_CFUNC const char *
ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode) {
    const char *aliasTmp = alias;
    int32_t i = 0;
    for (i = 0; i < 2; i++) {
        if (i == 1) {
            /*
             * After the first unsuccess converter lookup, check to see if
             * the name begins with 'x-'. If it does, strip it off and try
             * again.  This behaviour is similar to how ICU4J does it.
             */
            if (aliasTmp[0] == 'x' || aliasTmp[1] == '-') {
                aliasTmp = aliasTmp+2;
            } else {
                break;
            }
        }
        if(haveAliasData(pErrorCode) && isAlias(aliasTmp, pErrorCode)) {
            uint32_t convNum = findConverter(aliasTmp, containsOption, pErrorCode);
            if (convNum < gMainTable.converterListSize) {
                return GET_STRING(gMainTable.converterList[convNum]);
            }
            /* else converter not found */
        } else {
            break;
        }
    }

    return NULL;
}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:30,代码来源:ucnv_io.cpp


示例19: ejsaudio_LTX_onLoad

  JSBool
  ejsaudio_LTX_onLoad(JSContext* cx, JSObject* module)
  {
    AudioConfig ac;
    jsval val;

#define GET_STRING(prop) do{						\
      if (!ejs_evalExpression(cx,module,"ejs.config.Audio."#prop,&val))	\
	JS_ClearPendingException(cx);					\
      else{								\
	JSString* s=NULL;char *cstr=NULL;				\
	if ((!(s=JS_ValueToString(cx,val)))				\
	    || (!(cstr=JS_GetStringBytes(s)))) return JS_FALSE;		\
	ac.prop=cstr;							\
      }									\
    }while(0)

    GET_STRING(sdriver);
    GET_STRING(sdevice);
    
#define GET_INT32(prop) do{						\
      int32 i;								\
      if (!ejs_evalExpression(cx,module,"ejs.config.Audio."#prop,&val))	\
	JS_ClearPendingException(cx);					\
      else{								\
	if (!JS_ValueToECMAInt32(cx,val,&i)) return JS_FALSE;		\
	ac.prop=i;							\
      }									\
    }while(0)
    
    GET_INT32(srate);
    GET_INT32(sbits);
    GET_INT32(sbuffers);

    if (!ejs_evalExpression(cx,module,"ejs.config.Audio.stereo",&val))
      JS_ClearPendingException(cx);
    else{
      JSBool jsb;
      if (!JS_ValueToBoolean(cx, val, &jsb)) return JS_FALSE;
      ac.stereo=jsb;
    }

    Audio::init(ac);

    if (!JS_DefineFunctions(cx, module, static_methods)) return JS_FALSE;
    return JS_TRUE;
  }
开发者ID:BackupTheBerlios,项目名称:egachine,代码行数:47,代码来源:ejsaudio.cpp


示例20: GET_STRING

// Handles the printing/sending of the PRIVMSG ACTION message.
void QueryWindow::handleAction(const QString &text)
{
    QString textToPrint = GET_STRING("message.action")
                            .arg(m_pSession->getNick())
                            .arg(text);
    printOutput(textToPrint, MESSAGE_IRC_ACTION_SELF);
    m_pSession->sendAction(getWindowName(), text);
}
开发者ID:blockchain-research-foundation,项目名称:pebblecoin,代码行数:9,代码来源:QueryWindow.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GET_SWZ函数代码示例发布时间:2022-05-30
下一篇:
C++ GET_STR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap