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

C++ GetWord函数代码示例

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

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



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

示例1: GetWord

bool ieJpegDecoder::GetSOS()
//
// Process SOS (Start of Scan)
//
{
	int length = GetWord() - 3;
	int n = *pbStream++;				//  Number of components
	if ((length != (n * 2 + 3)) || (n < 1) || (n > IE_JPEG_MAX_COMPS)) 
		return false;
    nCompsInScan = n;

    // Collect color component id's and Huffman table indexes
	for (int i = 0; i < n; i++) {

		int cCompId = *pbStream++;
		int cTables = *pbStream++;
		length -= 2;

		PjdCompInfo pComp = nullptr;
		for (int ci = 0; ci < nComps; ci++) {
			if (cCompId == aComps[ci].iId) {
				pComp = &aComps[ci];
				break;
			}
        }
		if (!pComp) return false;

		apCompInfos[i] = pComp;

		pComp->iDCTable = cTables >> 4;
		pComp->iACTable = cTables & 0xF;
	}

    // Collect the additional scan parameters Ss, Se, Ah/Al.
  	Progressive.Ss = *pbStream++;				// Start of spectral selection, 0 for baseline
	Progressive.Se = *pbStream++;				// End of spectral selection, DCTSIZE2-1 for baseline
	BYTE c = *pbStream++;						// 0 for baseline
	Progressive.Ah = (c >> 4) & 0xF;			// Successive approximation high bit
	Progressive.Al = (c     ) & 0xF;    		// Successive approximation low bit
    length -= 3;
    iScanNumber++;

	pbStream += length;

	return true;
}
开发者ID:FMJ-Software,项目名称:ieCpp,代码行数:46,代码来源:ief_jpeg_Marker.cpp


示例2: while

unsigned long 
NALUnit::GetUE()
{
    // Exp-Golomb entropy coding: leading zeros, then a one, then
    // the data bits. The number of leading zeros is the number of
    // data bits, counting up from that number of 1s as the base.
    // That is, if you see
    //      0001010
    // You have three leading zeros, so there are three data bits (010)
    // counting up from a base of 111: thus 111 + 010 = 1001 = 9
    int cZeros = 0;
    while (GetBit() == 0)
    {
        cZeros++;
    }
    return GetWord(cZeros) + ((1 << cZeros)-1);
}
开发者ID:VtsBlack,项目名称:gdcl-mpeg-4-mux,代码行数:17,代码来源:NALUnit.cpp


示例3: theCTCP

void ClientAgent::CTCPAction(BString theTarget, BString theMsg)
{
	BString theCTCP(GetWord(theMsg.String(), 1).ToUpper()),
		theRest(RestOfString(theMsg.String(), 2)), tempString("[CTCP->");

	tempString += theTarget;
	tempString += "] ";
	tempString += theCTCP;

	if (theRest != "-9z99") {
		tempString += " ";
		tempString += theRest;
		tempString += '\n';
	} else
		tempString += '\n';

	Display(tempString.String(), C_CTCP_REQ, C_BACKGROUND, F_SERVER);
}
开发者ID:HaikuArchives,项目名称:Vision,代码行数:18,代码来源:ClientAgent.cpp


示例4: GetNumeric

uint32 SOMFRecordPointer::UnpackLIDATABlock(int8 * destination, uint32 MaxSize) {
   // Unpack Data block in LIDATA record recursively and store data at destination
   uint32 RepeatCount = GetNumeric();            // Outer repeat count
   uint32 BlockCount  = GetWord();               // Inner repeat count
   uint32 Size = 0;                              // Size of data expanded so far
   uint32 RSize;                                 // Size of recursively expanded data
   uint32 SaveIndex;                             // Save Index for repetition
   uint32 i, j;                                  // Loop counters
   if (BlockCount == 0) {
      // Contains one repeated block
      Size = GetByte();                          // Size of repeated block
      if (RepeatCount * Size > MaxSize) {
         // Data outside allowed area
         err.submit(2310);                       // Error message
         Index += Size;                          // Point to after block
         return 0;                               // No data stored
      }

      // Loop RepeatCount times
      for (i = 0; i < RepeatCount; i++) {
         // copy data block into destination
         memcpy(destination, buffer + FileOffset + Index, Size);
         destination += Size;
      }
      Index += Size;                             // Point to after block
      return RepeatCount * Size;                 // Size of expanded data
   }
   // Nested repeat blocks
   SaveIndex = Index;
   // Loop RepeatCount times
   for (i = 0; i < RepeatCount; i++) {
      // Go back and repeat unpacking
      Index = SaveIndex;
      // Loop BlockCount times
      for (j = 0; j < BlockCount; j++) {
         // Recursion
         RSize = UnpackLIDATABlock(destination, MaxSize);
         destination += RSize;
         MaxSize -= RSize;
         Size += RSize;
      }
   }
   return Size;
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:44,代码来源:omf.cpp


示例5: CheckIfGuidance

int CheckIfGuidance(char *line,int isLabel)
{
	int i;
	char *word;

	i = isLabel ? isLabel + 2 : 0;
	/* Ignore spaces */
	while(isspace(line[i]))
		i++;

	if (line[i++]=='.')
	{
		word=GetWord(&line[i],' ');
		if(strcmp(word,"extern")==0)
		{
			/* Step over .extern word in line */
			i+=7;
			/* Ignore spaces */
			while(isspace(line[i]))
				i++;

			HandleExtern(&line[i]);
			return 1;
		}
		else if(strcmp(word,"entry")==0)
		{
			i+=6;
			while(isspace(line[i]))
				i++;
			HandleEntry(&line[i],&constInstructionArr[MAX_INSTRUCTION-1]);
			return 1;
		}
		else
		{
			printf("Error! in Line %d  :%s  , illegal command \n", countLine, line);
			SeconnedPhaseSucess=0;
		}
	}
	else
	{
		return 0;
	}
	return 0;
}
开发者ID:DiCookieMonster,项目名称:C-OS-compiler-implementation,代码行数:44,代码来源:instruction_Check.c


示例6: YForkThread

int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc )
{
	DBVARIANT dbv;
	char *msg;
	int  bANSI;

	bANSI = 0;/*GetByte( "DisableUTF8", 0 );*/

	if (!m_bLoggedIn) {/* don't send message if we not connected! */
		YForkThread( &CYahooProto::im_sendackfail, hContact );
		return 1;
	}

	if (bANSI) 
		/* convert to ANSI */
		msg = ( char* )pszSrc;
	else if ( flags & PREF_UNICODE )
		/* convert to utf8 */
		msg = mir_utf8encodeW(( wchar_t* )&pszSrc[ strlen(pszSrc)+1 ] );
	else if ( flags & PREF_UTF )
		msg = mir_strdup(( char* )pszSrc );
	else
		msg = mir_utf8encode(( char* )pszSrc );

	if (lstrlenA(msg) > 800) {
		YForkThread( &CYahooProto::im_sendackfail_longmsg, hContact );
		return 1;
	}

	if (!DBGetContactSettingString( hContact, m_szModuleName, YAHOO_LOGINID, &dbv)) {
		send_msg(dbv.pszVal, GetWord( hContact, "yprotoid", 0), msg, (!bANSI) ? 1 : 0);

		if (!bANSI)
			mir_free(msg);

		YForkThread( &CYahooProto::im_sendacksuccess, hContact );

		DBFreeVariant(&dbv);
		return 1;
	}

	return 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:43,代码来源:im.cpp


示例7: GetByte

uint8 SOMFRecordPointer::GetNext(uint32 align) {
   // Get next record. Returns record type, made even. Returns 0 if finished
   // align = alignment after MODEND records = page size. Applies to lib files only
   FileOffset += End + 1;

   // Check if alignment needed
   if (align > 1 && Type2 == OMF_MODEND) {
      // Align after MODEND record in library
      FileOffset = (FileOffset + align - 1) & - (int32)align;
   }
   if (FileOffset >= FileEnd) return 0;          // End of file
   Index = 0;                                    // Start reading record
   Type = GetByte();                             // Get record type
   Type2 = Type;  if (Type2 < OMF_LIBHEAD) Type2 &= ~1; // Make even
   uint16 RecordSize = GetWord();                // Get record size
   End = Index + RecordSize - 1;                 // Point to checksum byte
   if (FileOffset + RecordSize + 3 > FileEnd) err.submit(2301); // Extends beyond end of file
   return Type2;
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:19,代码来源:omf.cpp


示例8: SCPI_FirstIsInt

//---------------------------------------------------------------------------------------------------------------------------------------------------
bool SCPI_FirstIsInt(uint8 *buffer, int *value, int min, int max)
{
    Word param;
    if (GetWord(buffer, &param, 0))
    {
#ifdef WIN32
        char n[10];
#else
        char n[param.numSymbols + 1];
#endif
        memcpy(n, param.address, param.numSymbols);
        n[param.numSymbols] = '\0';
        if (String2Int(n, value) && *value >= min && *value <= max)
        {
            return true;
        }
    }
    return false;
}
开发者ID:Sasha7b9,项目名称:Osci,代码行数:20,代码来源:SCPI.c


示例9: GetSize

bool Phrase::operator== (const Phrase &other) const
{
  size_t thisSize = GetSize()
                    ,compareSize = other.GetSize();
  if (thisSize != compareSize) {
    return false;
  }

  for (size_t pos = 0 ; pos < thisSize ; pos++) {
    const Word &thisWord	= GetWord(pos)
                            ,&otherWord	= other.GetWord(pos);
    bool ret = thisWord == otherWord;
    if (!ret) {
      return false;
    }
  }

  return true;
}
开发者ID:hschreib,项目名称:mosesdecoder,代码行数:19,代码来源:Phrase.cpp


示例10: GetName

/*
 *
 * Function GetName,
 *  Copies a name from the OBJ file into the ObjInfo Structure.
 *
 */
void GetName( FILE *infile, TCHAR *szName , DWORD *lSize)
{
    WORD i = 0;

    do
    {

#ifdef RLRES16

        szName[ i ] = GetByte( infile, lSize);

#else

        szName[ i ] = GetWord( infile, lSize);

#endif
    
    } while ( szName[ i++ ] != TEXT('\0') );
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:25,代码来源:resread.c


示例11: GetMatchLens

// this function looks for portions of the text that can be skipped because it
// begins with a word to ignore or one of its synonyms.
// note that more than one item could match, all should be tried
vector<size_t> CWord_substitution :: GetMatchLens(const string& text, const string& pattern, char prev_char) const
{
    vector<size_t> match_lens;
    size_t len;

    if (!IsSetWord()) {
        // doesn't make sense
    } else if (!NStr::StartsWith(pattern, GetWord(), GetCase_sensitive() ? NStr::eCase : NStr::eNocase)) {
        // no match
    } else if (IsSetSynonyms()) {
        ITERATE(CWord_substitution::TSynonyms, syn, GetSynonyms()) {
            len = (*syn).length();
            if (NStr::StartsWith(text, *syn, GetCase_sensitive() ? NStr::eCase : NStr::eNocase)
                && (!IsSetWhole_word()
                        || (IsWordBoundary(prev_char) && IsWordBoundary(text.c_str()[len])))) {
                // text matches synonym
                match_lens.push_back(len);            
            }
        }
    } else {
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:23,代码来源:Word_substitution.cpp


示例12: switch

//"因子"语法分析
bool KH::GrammarPL0::FactorParsing()
{
	bool result = true;

	switch( GetWord(false).GetSign())
	{
		case KH::_IDENTIFIER://因子可以是一个常量或变量
			Sa.ExistVariable(GetLine(),GetWord(false).GetValue());

			//Gen  ident
			GenPush(GetWord(false).GetValue());
			 skip(1);
			break;

		case KH::_INT:	//因子可以是一个数
		case KH::_FLOAT:
			//Gen  ident
			GenPush(GetWord(false).GetValue());
			 skip(1);
			break;

		case KH::_LPAREN :	//如果看到左括号'('
			//Gen (
			GenPush(" ( ");
			 skip(1);

			if(!ExpressionParsing())
			{
				Error( result," Factor Error , There should be a Expression .");
			}

			if( GetWord(false).GetSign() == KH::_RPAREN)//"表达式"后面应是右括号')'
			{
				//Gen )
				GenPush(" ) ");
				 skip(1);
			}
			else{
				Error( result," Factor Error , There should be a Right Paren : " + GetWord(false).GetValue());
			}

			break;

		default:	
			Error( result," Factor Error , There should be a Factor .");
			break;
	}//End of switch
	return result;
}
开发者ID:gloria50311,项目名称:ThePL0Compiler,代码行数:50,代码来源:GrammarAnalysis.cpp


示例13: SkipPrep

void SkipPrep(void)		/* Skip any preposition which is next word */
{
	char *a=WordPtr;
	WLIST *b=GetWord();
	if(b==(WLIST *)-1)
	{
		WordPtr=a;
		return;
	}
	if(b==NULL)
	{
		WordPtr=a;
		return;
	}
	if(b->wd_Type!=WD_PREP)
	{
		WordPtr=a;
		return;
	}
}
开发者ID:facet42,项目名称:AberMUD,代码行数:20,代码来源:Parser.c


示例14: ReadDict

/* EXPORT->ReadDict: read and store a dictionary definition */
ReturnStatus ReadDict(char *dictFn, Vocab *voc)
{
   LabId labels[MAXPHONES+4];
   Source src;
   Word word;
   float prob;
   int nphones;
   ReturnStatus ret;

   if(InitSource(dictFn,&src,DictFilter)<SUCCESS){
      HRError(8010,"ReadDict: Can't open file %s", dictFn);
      return(FAIL);
   }
   if (trace&T_TOP)
      printf("\nLoading Dictionary from %s\n",dictFn);
   if((ret=ReadDictWord(&src,labels,&prob, &nphones))<SUCCESS){
      CloseSource(&src);
      HRError(8013,"ReadDict: Dict format error in first entry");
      return(FAIL);
   }
   while(nphones>=0){
      word = GetWord(voc,labels[0],TRUE);
      if (labels[1]==NULL) labels[1]=labels[0];
      if (labels[1]->name[0]==0) labels[1]=NULL;
      if (voc->nullWord->wordName == word->wordName)
         HRError(-8013,"ReadDict: !NULL entry contains pronunciation");
      NewPron(voc,word,nphones,labels+2,labels[1],prob);
      if((ret=ReadDictWord(&src,labels,&prob, &nphones))<SUCCESS){
         HRError(8013,"ReadDict: Dict format error");
         return(FAIL);
      }
   }
   CloseSource(&src);

   if (trace&T_DIC)
      ShowDict(voc);
   if (trace&T_TOP)
      printf("Dictionary loaded from %s with %d words and %d prons\n\n",
             dictFn,voc->nwords,voc->nprons);
   return(SUCCESS);
}
开发者ID:botonchou,项目名称:AlgoFinal,代码行数:42,代码来源:HDict.c


示例15: GetWord

// This method writes text to the screen in "paragraph" mode, staying within
// the bounds of the window and scrolling the window upward if necessary
void CursWin::WriteText(char* txt, bool ref) {
    char nextWord[100], *temp = txt;
    char blankWord[2] = "";
    if (((strlen(txt)-1) + curColPos) > maxColPos) {
        temp = GetWord(temp,nextWord);
        if (strlen(nextWord) + curColPos > maxColPos) {
            char* t2 = &(nextWord[0]);
            Writes(blankWord,false);
            while ((*t2 == ' ') || (*t2 == '\n') || (*t2 == '\t')) {
                t2++;
            }
            Write(t2,false);
        }
        else Write(nextWord,false);
        WriteText(temp, false);
    }
    else {
        Write(txt, false);
    }
    if (ref) refresh();
}
开发者ID:ThereIsNoEscape,项目名称:uidaho,代码行数:23,代码来源:CursWin.cpp


示例16: GetOrd

int GetOrd(void)
{
	char *WRem=WordPtr;
	WLIST *a=GetWord();
	if(a==NULL)
	{
		WordPtr=WRem;
		return(1);
	}
	if(a==(WLIST *)-1)
	{
		WordPtr=WRem;
		return(1);
	}
	if(a->wd_Type!=WD_ORDIN)
	{
		WordPtr=WRem;
		return(1);
	}
	return(a->wd_Code);
}
开发者ID:facet42,项目名称:AberMUD,代码行数:21,代码来源:Parser.c


示例17: GetWord

const char* CRichEditSpellCheck::GetNextWord() const
{
	CHARRANGE cr;

	cr.cpMin = m_re.SendMessage(EM_FINDWORDBREAK, WB_RIGHT, m_crCurrentWord.cpMax);
	cr.cpMax = m_re.SendMessage(EM_FINDWORDBREAK, WB_RIGHTBREAK, cr.cpMin + 1);

	GetWord(cr, m_sCurrentWord);
	int nLength = m_sCurrentWord.GetLength();

	if (nLength)
	{
		m_crCurrentWord = cr;

		// if there's any trailing whitespace then trim it off
		m_sCurrentWord.TrimRight(DELIMS);

		// and update char range
		m_crCurrentWord.cpMax -= nLength - m_sCurrentWord.GetLength();
		nLength = m_sCurrentWord.GetLength();

		// if there's any leading whitespace then trim it off
		m_sCurrentWord.TrimLeft(DELIMS);

		// and update char range
		m_crCurrentWord.cpMin += nLength - m_sCurrentWord.GetLength();
		nLength = m_sCurrentWord.GetLength();

		// if there was some text but it was all whitespace, return
		// a non-empty string so that searching is not terminated
		// and move the selection to the end of the whitespace
		if (m_sCurrentWord.IsEmpty())
		{
			m_crCurrentWord.cpMin = m_crCurrentWord.cpMax = cr.cpMax;
			m_sCurrentWord = " ";
		}
	}

	return m_sCurrentWord;
}
开发者ID:noindom99,项目名称:repositorium,代码行数:40,代码来源:RichEditSpellCheck.cpp


示例18: LOG_NRM

void
GetLogPage::SetNUMD(uint16_t numDW)
{
    uint64_t errLogPgEntries;
    uint64_t numDWAvail;

    LOG_NRM("Setting NUMD 0x%04X", numDW);
    ConstSharedIdentifyPtr idCmdCtrlr = gInformative->GetIdentifyCmdCtrlr();
    errLogPgEntries = idCmdCtrlr->GetValue(IDCTRLRCAP_ELPE);
    numDWAvail = ((errLogPgEntries * ERRINFO_DATA_SIZE) / sizeof(uint32_t));
    if (numDWAvail > numDW) {
        // per the spec this action is undef'd, so don't allow it
        LOG_ERR("Request %d DWORDS > %lld available yields undef'd results",
            numDW, (unsigned long long)numDWAvail);
        throw  exception();
    }

    uint16_t curVal = GetWord(10, 1);
    curVal &= ~NUMD_BITMASK;
    curVal |= (numDW & NUMD_BITMASK);
    SetWord(curVal, 10, 1);
}
开发者ID:Kurusamy,项目名称:tnvme,代码行数:22,代码来源:getLogPage.cpp


示例19: StringWord

/* Add the next word on to the end of the buffer
*/
static void StringWord(char *Buffer,int BufSize,WORD *ThisWord)
{
	int nProbs,iProb,total;
	WORD *NextWord;
	ASCN *Assoc;

	/* Randomly select an index for the next word.
	*/
	nProbs = CountProbs(ThisWord);
	if(nProbs<1)
	{
		Niall_Warning("Corrupted brain (Unlinked word).");
		return;
	}

	/* Taken from the rand(3) manual page...
	*/
	iProb = (int)( (float)nProbs*(float)rand() / ((float)RAND_MAX+1.0) );

	/* Find the next word.
	*/
	for(total=0,Assoc=ThisWord->Associations;Assoc;Assoc=Assoc->Next)
	{
		total+=Assoc->Probability;
		if(total>iProb)
		{
			NextWord = GetWord(Assoc->Word);
			if(NextWord != END_SENTENCE)
			{
				if(strlen(Buffer)) safeStrcat(Buffer,BufSize," ");
				safeStrcat(Buffer,BufSize,NextWord->Data);
				StringWord(Buffer,BufSize,NextWord);
				return;
			}
			else return;
		}
	}
	Niall_Warning("Corrupted brain (Loop Overflow).");
}
开发者ID:Farthen,项目名称:OTFBot,代码行数:41,代码来源:niall.c


示例20: GetWord

bool DTextParser::GetBool( int iCount, bool *pOut1, bool *pOut2, bool *pOut3 )
{
	if( iCount<1 )		return false;
	if( iCount>3 )		iCount=3;

	GetWord( m_TemporaryBuffer, iCount );

	int array[3];
	switch( iCount )
	{
		case 1:
			sscanf( m_TemporaryBuffer, "%d", &array[0] );
			break;
		case 2:
			sscanf( m_TemporaryBuffer, "%d %d", &array[0], &array[1] );
			break;
		case 3:
			sscanf( m_TemporaryBuffer, "%d %d %d", &array[0], &array[1], &array[2] );
			break;
	}

	if( pOut1 )
	{
		if(array[0])	*pOut1 = true;
		else			*pOut1 = false;
	}
	if( pOut2 )
	{
		if(array[1])	*pOut2 = true;
		else			*pOut2 = false;
	}
	if( pOut3 ) 
	{
		if(array[2])	*pOut3 = true;
		else			*pOut3 = false;
	}

	return true;
}
开发者ID:RaoMiao,项目名称:freestyle,代码行数:39,代码来源:DTextParser.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetWordHash函数代码示例发布时间:2022-05-30
下一篇:
C++ GetWindowsVersion函数代码示例发布时间: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