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


C++ NextLine函数代码示例

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


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

示例1: DumpMotorwayEnterDescription

static void DumpMotorwayEnterDescription(size_t& lineCount,
                                         const osmscout::RouteDescription::MotorwayEnterDescriptionRef& motorwayEnterDescription,
                                         const osmscout::RouteDescription::CrossingWaysDescriptionRef& crossingWaysDescription)
{
  std::string crossingWaysString;

  if (crossingWaysDescription.Valid()) {
    crossingWaysString=CrossingWaysDescriptionToString(crossingWaysDescription);
  }

  if (!crossingWaysString.empty()) {
    NextLine(lineCount);
    std::cout << "At crossing " << crossingWaysString << std::endl;
  }

  NextLine(lineCount);
  std::cout << "Enter motorway";

  if (motorwayEnterDescription->GetToDescription().Valid() &&
      motorwayEnterDescription->GetToDescription()->HasName()) {
    std::cout << " '" << motorwayEnterDescription->GetToDescription()->GetDescription() << "'";
  }

  std::cout << std::endl;
}
开发者ID:bolidehi,项目名称:libosmscout,代码行数:25,代码来源:Routing.cpp

示例2: BeginParse

void BeginParse(struct out *firstOUT, struct info *in)
{
	const char *gfwStart, *gfwEnd;
	gfwEnd = gfwStart = in->decodeGFWlist;
	char *buf = (char*)malloc(sizeof(in->proxy) + 48 * sizeof(char));
	sprintf(buf, "{+forward-override{%s .}}\n", in->proxy);
	appendtoOUT(firstOUT, buf);
	free(buf);
	gfwEnd = NextLine(gfwStart);//skip the first line :[AutoProxy 0.2.9]
	do
	{
		gfwStart = SkipBlank(gfwEnd);
		gfwEnd = NextLine(gfwStart);
		// apple appple apppple\n apppple......
		// ^                    ^
		// |                    |
		// start               end
		if (*gfwStart == '\0' || *gfwEnd == '\0')
		{//meet the end of in->decodeGFWlist
			break;
		}
		else
		{
			appendtoOUT(firstOUT, parseALine(gfwStart, gfwEnd));
		}
	} while (1);
}
开发者ID:Athenacle,项目名称:TRASH,代码行数:27,代码来源:pac2privoxy.c

示例3: outbyte

void SimpleConsole::OutputChar( int ch )
{
	outbyte(0xE9,ch);	//for bochs
	if(ch=='\t')
	{
		do{
			OutputChar(' ');
		}while( (cursorX-1)%4 );
		return;
	}
	if(ch=='\n')
	{
		NextLine();
	}
	else if( ch == 8 )
	{
		OutputChar( charStyle, cursorY, --cursorX );
	}
	else if ( isprint((unsigned char)ch) )
	{
		OutputChar( charStyle | ch, cursorY, cursorX++ );
	}
	if(cursorX >= width )
	{
		NextLine();
	}
	MoveCursor();
}
开发者ID:Ga-vin,项目名称:sgos,代码行数:28,代码来源:console.cpp

示例4: DumpTurnDescription

static void DumpTurnDescription(size_t& lineCount,
                                const osmscout::RouteDescription::TurnDescriptionRef& turnDescription,
                                const osmscout::RouteDescription::CrossingWaysDescriptionRef& crossingWaysDescription,
                                const osmscout::RouteDescription::DirectionDescriptionRef& directionDescription,
                                const osmscout::RouteDescription::NameDescriptionRef& nameDescription)
{
  std::string crossingWaysString;

  if (crossingWaysDescription.Valid()) {
    crossingWaysString=CrossingWaysDescriptionToString(crossingWaysDescription);
  }

  if (!crossingWaysString.empty()) {
    NextLine(lineCount);
    std::cout << "At crossing " << crossingWaysString << std::endl;
  }

  NextLine(lineCount);
  if (directionDescription.Valid()) {
    std::cout << MoveToTurnCommand(directionDescription->GetCurve());
  }
  else {
    std::cout << "Turn";
  }

  if (nameDescription.Valid() &&
      nameDescription->HasName()) {
    std::cout << " into '" << nameDescription->GetDescription() << "'";
  }

  std::cout << std::endl;
}
开发者ID:bolidehi,项目名称:libosmscout,代码行数:32,代码来源:Routing.cpp

示例5: SkipBeginning

///////////////////////////////////////////////////////////////////////////////
//
// SkipBeginning
//
///////////////////////////////////////////////////////////////////////////////
int TFile::SkipBeginning()
{
    mStateManager->ResetErrorCode();

    typestr line;
    typestr aSpec;
    // Au debut de chaque fichier, il faut sauter deux lignes de commentaires
    if (NextLine(&line, false, &aSpec))
        mStateManager->SetErrorD(9506, ERROR, aSpec.str());
    if(NextLine(&line, false, &aSpec))
        mStateManager->SetErrorD(9506, ERROR, aSpec.str());
    return mStateManager->GetErrorCode();
}
开发者ID:NatLibFi,项目名称:usemarcon,代码行数:18,代码来源:tfile.cpp

示例6: DumpStartDescription

static void DumpStartDescription(size_t& lineCount,
                                 const osmscout::RouteDescription::StartDescriptionRef& startDescription,
                                 const osmscout::RouteDescription::NameDescriptionRef& nameDescription)
{
  NextLine(lineCount);
  std::cout << "Start at '" << startDescription->GetDescription() << "'" << std::endl;

  if (nameDescription.Valid() &&
      nameDescription->HasName()) {
    NextLine(lineCount);
    std::cout << "Drive along '" << nameDescription->GetDescription() << "'" << std::endl;
  }
}
开发者ID:bolidehi,项目名称:libosmscout,代码行数:13,代码来源:Routing.cpp

示例7: WriteString

/*****************************************************************************
 * Write a string to the current document
*****************************************************************************/
void WriteString(char* sz, int len)
{
   int tabn = (int)CURRENT_FILE->tabsout_num;
   int i=0;
   char *p=NULL;
   char ch=0;
   DWORD dwNumWritten=0;

   if ( pd.hDC == NULL )
      return;
   if ( !documentON )
      StartDocument( );
   for (i = 0,p = sz; i < len; p++, i++)
   {
      ch = *p;
      switch ( ch )
      {
         case '\n':                             // Line-feed
            NextLine();
            break;

         case '\f' :                             // Form-feed
            NextPage();
            break;

         case '\r' :                             // Carriage-return
            column = 0;
            break;

         case '\t' :                             // Tab
            column += tabn - (column % tabn);
            if ( bLineWrapping
            && column >= LOWORD(dwCharExtent) )
               NextLine();
            break;
         default :
            if ( isprint(ch) )
            {
               if (defaultprinter)
                  TextOut(pd.hDC, column++, row, &ch, 1);
               else
                  WritePrinter( hPrinter, p, 1, &dwNumWritten );
               // Wrap line
               if ( bLineWrapping
               && column >= LOWORD(dwCharExtent) )
                  NextLine();
            }
            break;
      } // End switch
   }
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:54,代码来源:print.c

示例8: GetLine

bool SDFfile::ReadHeader() {
  if (!IsOpen()) return true;
  // Read title
  title_ = GetLine();
  RemoveTrailingWhitespace( title_ );
  // Read past info and comment
  if (NextLine() == 0) return true;
  if (NextLine() == 0) return true;
  // Read Connection table
  const char* ptr = NextLine();
  if (ptr == 0) return true;
  if (sscanf(ptr, "%i %i", &Natoms_, &Nbonds_) != 2) return true;
  return false;
}
开发者ID:Amber-MD,项目名称:cpptraj,代码行数:14,代码来源:SDFfile.cpp

示例9: SkipWhiteSpace

BOOL CReg::LoadRegFromMem(LPBYTE buf, DWORD size, BOOL bMerge)
{_STTEX();
	DWORD i = 0;

	// Lose old record
	if ( !bMerge ) Destroy();

	// Sanity check
	if ( buf == NULL || size == 0 ) return FALSE;

	// No key currently
	m_pCurKey = NULL;

	i = SkipWhiteSpace( buf, size, i );

	// Read in first line tag
	if ( i < size && buf[ i ] > ' ' && buf[ i ] <= '~' && buf[ i ] != '[' )
	{
		// I really don't know what to do with this tag
		i = NextLine( buf, size, i );

	} // end if

	// Process file
	while ( i < size && buf[ i ] != 0 )
	{
		// Skip white space
		i = SkipWhiteSpace( buf, size, i );

		if ( i < size && buf[ i ] == ';' ) i = NextLine( buf, size, i );

		// Process this line if not a comment
		else if ( i < size && buf[ i ] != 0 )
		{
			DWORD skip = ProcessLine( &buf[ i ], size - i );

			// Did we read a valid line
			if ( skip != 0 ) i += skip;

			// Just skip invalid line
			else i = NextLine( buf, size, i );

		} // end if

	} // end while

	return TRUE;
}
开发者ID:aminsyed,项目名称:rulib,代码行数:48,代码来源:Reg.cpp

示例10: Token

bool Scanner::Next() {
	char currentChar;
	do {
		if(lastString) {
			currentToken = new Token(currentLine, currentPos, END_OF_FILE, DEFAULT, "");
			return false;
		}
		currentChar = GetChar();
	}
	while(IsSpace(currentChar) || IsTabulationSymbol(currentChar) || IsEndOfLine(currentChar));

	if(IsCommentBegin(currentChar)) {
		char secondChar;
		if( IsCommentBegin(secondChar = GetChar()) ) {
			NextLine();
			return Next();
		}
		if(secondChar == '*') {
			while( GetChar() != '*' || !IsCommentBegin(GetChar()) ) {} 
			return Next();
		}
		else
			BackToPreviousChar();
	}
	if(IsLetter(currentChar))				currentToken = GetIdentificator(currentChar); else 
	if(IsNumber(currentChar))				currentToken = GetNumber(currentChar); else 
	if(IsCharSeparator(currentChar))		currentToken = GetSymbol(currentChar); else 
	if(IsStringSeparator(currentChar))		currentToken = GetString(currentChar); else 
	if(IsSeparator(currentChar))			currentToken = GetSeparator(currentChar); else 
	if(IsSpecialSymbol(currentChar))		currentToken = GetOperation(currentChar); else 
	throw ScannerException(currentLine, currentPos, "Indefinite character: \"" + string(1, currentChar) + "\"");

	return true;
}
开发者ID:forsaken1,项目名称:compiler,代码行数:34,代码来源:scanner.cpp

示例11: DumpTargetDescription

static void DumpTargetDescription(size_t& lineCount,
                                  const osmscout::RouteDescription::TargetDescriptionRef& targetDescription)
{
  NextLine(lineCount);

  std::cout << "Target reached '" << targetDescription->GetDescription() << "'" << std::endl;
}
开发者ID:bolidehi,项目名称:libosmscout,代码行数:7,代码来源:Routing.cpp

示例12: OldStyleComment

static void OldStyleComment (void)
/* Remove an old style C comment from line. */
{
    /* Remember the current line number, so we can output better error
     * messages if the comment is not terminated in the current file.
     */
    unsigned StartingLine = GetCurrentLine();

    /* Skip the start of comment chars */
    NextChar ();
    NextChar ();

    /* Skip the comment */
    while (CurC != '*' || NextC != '/') {
        if (CurC == '\0') {
            if (NextLine () == 0) {
                PPError ("End-of-file reached in comment starting at line %u",
                         StartingLine);
                return;
            }
        } else {
            if (CurC == '/' && NextC == '*') {
                PPWarning ("`/*' found inside a comment");
            }
            NextChar ();
        }
    }

    /* Skip the end of comment chars */
    NextChar ();
    NextChar ();
}
开发者ID:PanchoManera,项目名称:cc65,代码行数:32,代码来源:preproc.c

示例13: switch

bool ScrollBar::VertKey(dword key, bool homeend) {
	if(!IsVisible() || !IsEnabled() || GetRect().IsEmpty())
		return false;
	switch(key) {
	case K_PAGEUP:
		PrevPage();
		break;
	case K_PAGEDOWN:
		NextPage();
		break;
	case K_UP:
		PrevLine();
		break;
	case K_DOWN:
		NextLine();
		break;
	case K_HOME:
		if(!homeend) break;
	case K_CTRL_HOME:
	case K_CTRL_PAGEUP:
		Begin();
		break;
	case K_END:
		if(!homeend) break;
	case K_CTRL_END:
	case K_CTRL_PAGEDOWN:
		End();
		break;
	default:
		return false;
	}
	return true;
}
开发者ID:pedia,项目名称:raidget,代码行数:33,代码来源:ScrollBar.cpp

示例14: ReadNames

/*
**************************************************************************************
* ReadNames:
* Read all the position names in the position definiton file and store
* them in the POSITIONS table.  Also, allocate and initialize the HP Line
* share logical vectors for every name read.
**************************************************************************************
*/
void ReadNames()
{
    int p = 0;
    char *ptr;
    char *nameptr;

    infof("Reading position definition names...");

    while (NextLine())
    {
        if (strncmp(IOBuff,"DEFINE POSITION ",16)) continue;
        ptr = IOBuff + 16;
        nameptr = NextToken(&ptr,DYNAMIC_STRING);
        if (nameptr == NULL)
        {
            errorfp("Missing name at line %d",CurrentLine);
            continue;
        }
        if (!CopyValidName(nameptr,Positions[p].name.name))
            errorfp("Invalid name %s at line %d",nameptr,CurrentLine);
        if (LookupName(Positions[p].name.name) != p)
            errorfp("Multiply defined name %s at line %d",
                    Positions[p].name.name,CurrentLine);
        p++;
        free(nameptr);
    }
    if (p != TotalPositions)
    {
        errorfp("Expected %d names, found %d",TotalPositions,p);
        TotalPositions = p;
    }
}
开发者ID:huilang22,项目名称:Projects,代码行数:40,代码来源:bif_parse_positions_func.c

示例15: NextLine

char Scanner::GetChar() {
	if(currentPos < currentString.length())
		return currentString[currentPos++];

	NextLine();
	return '\0';
}
开发者ID:forsaken1,项目名称:compiler,代码行数:7,代码来源:scanner.cpp


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