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

C++ GetNextChar函数代码示例

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

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



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

示例1: GetNextChar

//------------------------------------------------------------------------------
// Parse a NEXUS-style comment
bool Tokeniser::ParseComment ()
{
	bool echo = false;
	comment = "";

	curChar = GetNextChar ();
	echo = (curChar == '!');
	if (echo)
		curChar =  GetNextChar ();

	while ((curChar != '\0') && (curChar != ']'))
	{
		comment += curChar;
		curChar = GetNextChar();
	}

	if (echo)
#if defined __BORLANDC__ && (__BORLANDC__ < 0x0550)
		cout << comment;
#else
		std::cout << comment;
#endif

	return true;
}
开发者ID:bomeara,项目名称:omearatenure,代码行数:27,代码来源:tokeniser.cpp


示例2: GetNextChar

void CToken::GetTTString()
{
	int nsLen;

	m_eNextTokenType = ttString;
	m_sNextTokenType = "String";

	nsLen = m_sNextToken.GetLength();
	m_sNextToken.Insert(nsLen, m_cNextChar);

	GetNextChar();
	char cPrevChar='x';
	bool bHasRemnString;
	do
	{
		bHasRemnString = false;

		while(m_cNextChar != '\"')
		{
			nsLen = m_sNextToken.GetLength();
			m_sNextToken.Insert(nsLen, m_cNextChar);
			cPrevChar = m_cNextChar;
			GetNextChar();
		}

		nsLen = m_sNextToken.GetLength();
		m_sNextToken.Insert(nsLen, m_cNextChar);

		if(cPrevChar == '\\')
			bHasRemnString = true;

		GetNextChar();
	}while(bHasRemnString == true);
}
开发者ID:asakpke,项目名称:MakeTokenGUI-Compiler-Construction,代码行数:34,代码来源:Token.cpp


示例3: T

struct Node_t * T(void)
{
  struct Node_t * ret_node;

  if (last == '(')
  {
    last = GetNextChar();
    ret_node = E();
    last = GetNextChar(); /* preskocit ')' */
    return ret_node;
  }
  free_node->oper = last;
  last = GetNextChar(); /* preskocit terminator */
  return free_node++;
}
开发者ID:jermenkoo,项目名称:spoj.pl_solutions,代码行数:15,代码来源:CMEXPR.c


示例4: MHERROR

// Parse a string argument.  ASN1 strings can include nulls as valid characters.
void MHParseBinary::ParseString(int endStr, MHOctetString &str)
{
    // TODO: Don't deal with indefinite length at the moment.
    if (endStr == INDEFINITE_LENGTH)
    {
        MHERROR("Indefinite length strings are not implemented");
    }

    int nLength = endStr - m_p;
    unsigned char *stringValue = (unsigned char *)malloc(nLength + 1);
    if (stringValue == NULL)
    {
        MHERROR("Out of memory");
    }

    unsigned char *p = stringValue;

    while (m_p < endStr)
    {
        *p++ = GetNextChar();
    }

    str.Copy(MHOctetString((const char *)stringValue, nLength));
    free(stringValue);
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:26,代码来源:ParseBinary.cpp


示例5: token

/*----------------------------------------------------------------------------------------------------------------------
|	Reads rest of parenthetical token (starting '(' already input) up to and including the matching ')' character.  All
|	nested parenthetical phrases will be included.
*/
void NxsToken::GetParentheticalToken()
	{
	// Set level to 1 initially.  Every ')' encountered reduces
	// level by one, so that we know we can stop when level becomes 0.
	//
	int level = 1;

	char ch;
	for(;;)
		{
		ch = GetNextChar();
		if (atEOF)
			break;

		if (ch == ')')
			level--;
		else if (ch == '(')
			level++;

		AppendToToken(ch);

		if (level == 0)
			break;
		}
	}
开发者ID:rforge,项目名称:phylobase,代码行数:29,代码来源:nxstoken.cpp


示例6: word

/*----------------------------------------------------------------------------------------------------------------------
|	Gets remainder of a quoted NEXUS word (the first single quote character was read in already by GetNextToken). This
|	function reads characters until the next single quote is encountered. An exception occurs if two single quotes occur
|	one after the other, in which case the function continues to gather characters until an isolated single quote is
|	found. The tandem quotes are stored as a single quote character in the token NxsString.
*/
void NxsToken::GetQuoted()
	{
	char ch;

	for(;;)
		{
		ch = GetNextChar();
		if (atEOF)
			break;

		if (ch == '\'' && saved == '\'')
			{
			// Paired single quotes, save as one single quote
			//
			AppendToToken(ch);
			saved = '\0';
			}
		else if (ch == '\'' && saved == '\0')
			{
			// Save the single quote to see if it is followed by another
			//
			saved = '\'';
			}
		else if (saved == '\'')
			{
			// Previously read character was single quote but this is something else, save current character so that it will
			// be the first character in the next token read
			//
			saved = ch;
			break;
			}
		else
			AppendToToken(ch);
		}
	}
开发者ID:rforge,项目名称:phylobase,代码行数:41,代码来源:nxstoken.cpp


示例7: Q3SocketDevice

void MainObject::ProcessCommands()
{
  char c;
  Q3SocketDevice *udp_command=new Q3SocketDevice(Q3SocketDevice::Datagram);
  char rml[RD_RML_MAX_LENGTH];
  unsigned ptr=0;
  bool active=false;

  while(!GetNextChar(&c)) {
    if(active) {
      if(c=='!') {
	rml[ptr++]=c;
	rml[ptr]=0;
	udp_command->writeBlock(rml,ptr,*dest_addr,dest_port);
	ptr=0;
	active=false;
      }
      else {
	rml[ptr++]=c;
      }
      if(ptr==RD_RML_MAX_LENGTH) {
	fprintf(stderr,"rmlsend: rml command too long\n");
	CloseStream();
	exit(256);
      }
    }
    else {
      if(isalpha(c)) {
	rml[ptr++]=c;
	active=true;
      }
    }
  }
}
开发者ID:WMFO,项目名称:rivendell,代码行数:34,代码来源:rmlsend.cpp


示例8: IsNextMoveValid

static int IsNextMoveValid(GAME_STATE *ptr, G_GHOST *pGhost)
{
char c;

	c = GetNextChar(ptr, pGhost);
	return Pac_IsOpenArea(c);
}
开发者ID:Alexandre251313,项目名称:pacman,代码行数:7,代码来源:ghosts.c


示例9: malloc

extern char *GetNextString( read_file *ch_info ) {

    char                *buffer;
    int                 x = 0;
    int                 current_max = BUFF_INC;
    int                 ch;

    buffer = malloc( BUFF_INC );

    do {
        if ( x >= current_max ) {
            current_max += BUFF_INC;
            buffer = realloc( buffer, current_max );
            if ( !buffer ) {
                puts("Out of memory");
                close( ch_info->file_handle );
                abort();
            }
        }
        ch = GetNextChar( ch_info );
        if ( ch == -1 ) {
            puts("File read error occured");
            close( ch_info->file_handle );
            free( buffer );
            abort();
        }
        buffer[ x ] = ch;
        x++;
    } while ( ch );
    return( buffer );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:31,代码来源:loadtype.c


示例10: ListSaveFile

// write the file (or pipe) to another file
static void _near ListSaveFile( void )
{
	int i, nFH, nMode;
	long lTemp;
	POPWINDOWPTR wn;
	TCHAR szBuffer[ MAXLISTLINE+1 ];
	
	// disable ^C / ^BREAK handling
	HoldSignals();
	
	wn = wOpen( 2, 1, 4, GetScrCols() - 2, nInverse, LIST_SAVE_TITLE, NULL );
	wn->nAttrib = nNormal;
	wClear();
	wWriteListStr( 0, 1, wn, LIST_QUERY_SAVE );
	egets( szBuffer, MAXFILENAME, EDIT_DATA | EDIT_BIOS_KEY );
	
	if ( szBuffer[0] ) {
		
		// save start position
		lTemp = LFile.lViewPtr;
		
		nMode = _O_BINARY;
		
		if (( nFH = _sopen( szBuffer, ( nMode | _O_WRONLY | _O_CREAT | _O_TRUNC ), _SH_DENYNO, _S_IWRITE | _S_IREAD )) >= 0 ) {
			
			// reset to beginning of file

				ListSetCurrent( 0L );
			
			do {
				
				for ( i = 0; ( i < MAXLISTLINE ); i++ ) {
					
					// don't call GetNextChar unless absolutely necessary
					if ( LFile.lpCurrent == LFile.lpEOF )
						break;

					szBuffer[i] = (TCHAR)GetNextChar();
				}

				szBuffer[i] = _TEXT('\0');
				
			} while (( i > 0 ) && ( wwrite( nFH, szBuffer, i ) > 0 ));
			
			_close( nFH );
			
			// restore start position
			LFile.lViewPtr = lTemp;
			ListSetCurrent( LFile.lViewPtr );
			
		} else
			honk();
	}
	
	wRemove( wn );
	
	// enable ^C / ^BREAK handling
	EnableSignals();
}
开发者ID:CivilPol,项目名称:sdcboot,代码行数:60,代码来源:listc.c


示例11: while

/* ¶ÁÈ¡×Ö·û´® */  
bool JsonString::ReadString()  
{  
	char c = 0;  
	while(current_ != end_)  
	{  
		c= GetNextChar();  
		if( c == '\\')  
		{  
			c = GetNextChar();  
		}  
		else if( c == '"')  
		{  
			break;  
		}  
	}  
	return (c == '"');  
}  
开发者ID:Strongc,项目名称:myLib,代码行数:18,代码来源:JsonString.cpp


示例12: while

int CPDF_Font::GetStringWidth(const FX_CHAR* pString, int size) {
  int offset = 0;
  int width = 0;
  while (offset < size) {
    uint32_t charcode = GetNextChar(pString, size, offset);
    width += GetCharWidthF(charcode);
  }
  return width;
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:9,代码来源:cpdf_font.cpp


示例13: while

void CCSVParser::ParseToOpenQuote (void)

//	ParseToOpenQuote
//
//	Reads characters until we find an open quote.

	{
	while (GetCurChar() != '\"')
		GetNextChar();
	}
开发者ID:kronosaur,项目名称:Hexarc,代码行数:10,代码来源:CCSVParser.cpp


示例14: while

void CToken::Skip2EndOfLine()
{
	while(m_cNextChar != cEndOfLine && m_cNextChar != cEndOfFile) //10 = end of line
	{
		//s.Format("%c",m_cNextChar);
		//MessageBox(s);

		GetNextChar();
	}	
}
开发者ID:asakpke,项目名称:Parser-5-Compiler-Construction,代码行数:10,代码来源:Token.cpp


示例15: while

void CToken::GetTTComments()
{
	int nsLen;

	if(m_cNextChar == '/')
	{
		m_eNextTokenType = ttCPPComments;
		m_sNextTokenType = "CPP's Comments";				

		while(m_cNextChar != 10) // end of line
		{
			nsLen = m_sNextToken.GetLength();
			m_sNextToken.Insert(nsLen, m_cNextChar);
			GetNextChar();
		}				
	}
	else if(m_cNextChar == '*')
	{
		char cPrevChar='x';
		m_eNextTokenType = ttCComments;
		m_sNextTokenType = "C's Comments";				

		//store '*'
		nsLen = m_sNextToken.GetLength();
		m_sNextToken.Insert(nsLen, m_cNextChar);

		GetNextChar();
		while(cPrevChar != '*' && m_cNextChar != '/')
		{
			nsLen = m_sNextToken.GetLength();
			m_sNextToken.Insert(nsLen, m_cNextChar);

			cPrevChar = m_cNextChar;
			GetNextChar();
		}
		// store last '/'
		nsLen = m_sNextToken.GetLength();
		m_sNextToken.Insert(nsLen, m_cNextChar);

		GetNextChar();
	}
}
开发者ID:asakpke,项目名称:MakeTokenGUI-Compiler-Construction,代码行数:42,代码来源:Token.cpp


示例16: GetNextLong

extern unsigned long GetNextLong( read_file *ch_info ) {

    char                buffer[4];
    unsigned long       *sptr;
    int                 ch;

    ch = GetNextChar( ch_info );
    if ( ch == -1 ) {
        puts("File read error occured");
        close( ch_info->file_handle );
        abort();
    }
    buffer[0] = ch;
    ch = GetNextChar( ch_info );
    if ( ch == -1 ) {
        puts("File read error occured");
        close( ch_info->file_handle );
        abort();
    }
    buffer[1] = ch;
    ch = GetNextChar( ch_info );
    if ( ch == -1 ) {
        puts("File read error occured");
        close( ch_info->file_handle );
        abort();
    }
    buffer[2] = ch;
    ch = GetNextChar( ch_info );
    if ( ch == -1 ) {
        puts("File read error occured");
        close( ch_info->file_handle );
        abort();
    }
    buffer[3] = ch;

    sptr = (unsigned long *)buffer;
    return( *sptr );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:38,代码来源:loadtype.c


示例17: FindNonWhiteSpace

/**
 * Find next non-white space character.
 */
static TCHAR
FindNonWhiteSpace(XML::Parser *pXML)
{
  assert(pXML);

    // Iterate through characters in the string until we find a NULL or a
  // non-white space character
  TCHAR ch;
  while ((ch = GetNextChar(pXML)) != 0) {
    if (!IsWhitespaceOrNull(ch))
      return ch;
  }
  return 0;
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:17,代码来源:Parser.cpp


示例18: Fc

struct Node_t * Fc(struct Node_t * left)
{
  struct Node_t * node;

  if ((last == '*') || (last == '/'))
  {
    node = free_node++;
    node->oper = last;
    last = GetNextChar();
    node->left = left;
    node->right = T();
    return Fc(node);
  }
  return left;
}
开发者ID:jermenkoo,项目名称:spoj.pl_solutions,代码行数:15,代码来源:CMEXPR.c


示例19: PreviewNextChar

void RedBufferInput::SkipWhitespace(void)
{
    RedChar cChar;

    // look ahead to the next character
    cChar = PreviewNextChar();
    while (cChar.IsWhiteSpace())
    {
        // if the next character is a whitespace, read it (and throw it away).
        cChar = GetNextChar();
        
        // preview the next character for the next while evaluation
        cChar = PreviewNextChar();
    }
}
开发者ID:davidgsteadman,项目名称:RedClassFramework,代码行数:15,代码来源:RedBufferInput.cpp


示例20: tryBackSlashNewLine

static int tryBackSlashNewLine( void )
{
    int nc;

    // CurrChar is '\\' and SrcFile->column is up to date
    Blank1Count = 0;
    Blank2Count = 0;
    Tab1Count = 0;
    nc = getTestCharFromFile();
    if( CompFlags.extensions_enabled ) {
        while( nc == ' ' ) {
            ++Blank1Count;
            nc = getTestCharFromFile();
        }
        while( nc == '\t' ) {
            ++Tab1Count;
            nc = getTestCharFromFile();
        }
        while( nc == ' ' ) {
            ++Blank2Count;
            nc = getTestCharFromFile();
        }
    }
    if( nc == '\r' ) {
        nc = getTestCharFromFile();
    }
    if( nc == '\n' ) {
        if( CompFlags.scanning_cpp_comment && NestLevel == SkipLevel ) {
            CWarn1( WARN_SPLICE_IN_CPP_COMMENT, ERR_SPLICE_IN_CPP_COMMENT );
        }
        if( CompFlags.cpp_output ) {            /* 30-may-95 */
            if( CompFlags.in_pragma ) {
                CppPrtChar( '\\' );
                CppPrtChar( '\n' );
            } else if( CompFlags.cpp_line_wanted ) {
                CppPrtChar( '\n' );
            }
        }
        SrcFile->src_line_cnt++;
        SrcFile->src_loc.line++;
        SrcFileLoc = SrcFile->src_loc;
//      SrcFile->column = 0;
        return( GetNextChar() );
    }
    LastChar = nc;
    NextChar = getCharAfterBackSlash;
    return( '\\' );
}
开发者ID:XVilka,项目名称:owp4v1copy,代码行数:48,代码来源:cgetch.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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