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


C++ PutCh函数代码示例

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


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

示例1: GetCh

void THtmlLx::GetEscCh(){
  GetCh();
  EscCh=(Ch=='&');
  if (EscCh){
    EscChA.Clr(); EscChA.AddCh(Ch); GetCh();
    if (Ch=='#'){
      EscChA.AddCh(Ch); GetCh();
      if (('0'<=Ch)&&(Ch<='9')){
        do {EscChA.AddCh(Ch); GetCh();} while (('0'<=Ch)&&(Ch<='9'));
        if (Ch==';'){GetCh();}
        PutStr(ChDef.GetEscStr(EscChA));
      } else {
        PutCh('#'); PutCh('&');
      }
    } else
    if (('a'<=Ch)&&(Ch<='z')||('A'<=Ch)&&(Ch<='Z')){
      do {
        EscChA.AddCh(Ch); GetCh();
      } while (('A'<=Ch)&&(Ch<='Z')||('a'<=Ch)&&(Ch<='z')||('0'<=Ch)&&(Ch<='9'));
      if (Ch==';'){GetCh();}
      PutStr(ChDef.GetEscStr(EscChA));
    } else {
      PutCh('&');
    }
  }
}
开发者ID:pikma,项目名称:Snap,代码行数:26,代码来源:html.cpp

示例2: WriteField

static void WriteField(CARDINAL position, BOOLEAN allowSpace, 
                       CARDINAL *i)
{
  CARDINAL spaces;
  BOOLEAN  quoted = FALSE;
  /*Get to right position*/
  Tab(position);
  while ((!quoted && (!TermCheck(currentLinePointer[*i]) ||
    (allowSpace && (currentLinePointer[*i] == Space)))) ||
    (quoted && (currentLinePointer[*i] != CR))) {
    if (currentLinePointer[*i] == Space) {
      spaces = 0;
      while (currentLinePointer[*i + spaces] == Space) spaces++;

      if ((currentLinePointer[*i + spaces] == CR) || (!quoted && (currentLinePointer[*i + spaces] == CommentSymbol)))
       {
        i += spaces;
        return;
      }; /* if */
      do PutCh(currentLinePointer[(*i)++]);
      while (currentLinePointer[*i] == Space);
    } else {
      PutCh(currentLinePointer[*i]);
      if (currentLinePointer[*i] == Quotes) quoted = !quoted;
      (*i)++;
    }; /* if */
  }; /* while */
  while (currentLinePointer[*i] == Space) (*i)++;
} /* End WriteField */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:29,代码来源:listing.c

示例3: lib_int_RawDoFmtNumber

static void lib_int_RawDoFmtNumber(UINT32 ul, int base, void (*PutCh)(INT32, APTR), APTR PutChData, int pad0flag, int width)
{
	// hold a long in base 2
	char *p, buf[(sizeof(long) * 8) + 1];
	int i;

	p = buf;

	do {
		*p++ = "0123456789abcdef"[ul % base];
	} while (ul /= base);

	if(p-buf < width)
	{
		if(pad0flag == 1)
		{
			for(i=0; i < width - (p-buf); i++)
				PutCh('0', PutChData);
		}
		else
		{
			for(i=0; i < width - (p-buf); i++)
				PutCh(' ', PutChData);
		}

	}

	do {
		PutCh(*--p, PutChData);
	} while (p > buf);
}
开发者ID:cycl0ne,项目名称:poweros_x86,代码行数:31,代码来源:rawdoformat.c

示例4: PutSep

int TSOut::PutSep(const int& NextStrLen){
  int Cs=0;
  if (MxLnLen==-1){
    Cs+=PutCh(' ');
  } else {
    if (LnLen>0){
      if (LnLen+1+NextStrLen>MxLnLen){Cs+=PutLn();} else {Cs+=PutCh(' ');}
    }
  }
  return Cs;
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:11,代码来源:fl.cpp

示例5: ListRegValue

void ListRegValue(CARDINAL reg)
{
  if (((1 << ListPC) & listStatus) && printState) {
    PutChs("       ");
    PutHexCh(reg);
    PutCh(Space);
  }; /* if */
} /* End ListRegValue */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:8,代码来源:listing.c

示例6: ListWordValue

void ListWordValue(CARDINAL w)
{
  if (printState && ((1 << ListPC) & listStatus)) {
    if (linePosition >= TextStart) PutLine();
    Tab(CodeStart);
    PutHexCardinal(w);
    PutCh(Space);
  }; /* if */
} /* End ListWordValue */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:9,代码来源:listing.c

示例7: PutStrPgm

void PutStrPgm(PGM_P str)
{
	char ch;
	do {
		ch=pgm_read_byte(str++);
		if(ch)
			PutCh(ch);
	}while(ch);
}
开发者ID:andrewhannay,项目名称:FIGnition,代码行数:9,代码来源:LLDebug.c

示例8: GetB

void GetB(char buf[BUF_MAX])
{	
	int i = 0;

	while (i < BUF_MAX)
	{
		buf[i] = GetCh();
		PutCh(buf[i]);
		i++;
		if (buf[i-1] == CR)
		{
			buf[i] = '\0';
			break;
		}
	}	
	PutCh(CR);
	PutCh(LF);
	return;
}
开发者ID:seungwoonlee,项目名称:dream,代码行数:19,代码来源:Calculator.cpp

示例9: EscapeWriteCh

/* GSTrans character output */
static void EscapeWriteCh(char ch)
{
 if ((ch >= Space) && (ch < Del))
  PutCh(ch) ;
 else
  if (ch == Del)
   PutChs("|?") ;
  else
   if (ch > Del)
    {
     PutChs("|!") ;
     EscapeWriteCh(ch - 0x80) ;
    }
   else
    {
     PutCh('|') ;
     PutCh(ch + 0x40) ;
    }
} /* End EscapeWriteCh */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:20,代码来源:listing.c

示例10: ListByteValue

void ListByteValue(char b)
{
  if (printState && ((1 << ListPC) & listStatus)) {
    if (linePosition >= TextStart) PutLine();
    Tab(CodeStart);
    PutHexCh(b / 0x10);
    PutHexCh(b % 0x10);
    PutCh(Space);
  }; /* if */
} /* End ListByteValue */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:10,代码来源:listing.c

示例11: PutBf

int TMOut::PutBf(const void* LBf, const int& LBfL){
  int LBfS=0;
  if (BfL+LBfL>MxBfL){
    for (int LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=PutCh(((char*)LBf)[LBfC]);}
  } else {
    for (int LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=(Bf[BfL++]=((char*)LBf)[LBfC]);}
  }
  return LBfS;
}
开发者ID:Accio,项目名称:snap,代码行数:11,代码来源:flx.cpp

示例12: PutLine

void PutLine(void)
{
  CARDINAL i;
  if (linePosition != 0) {
    PutCh(CR);
    newLine[linePosition] = 0;
    i = 0;
    while (newLine[i] != 0) WriteCh(newLine[i++]);
    linePosition = 0;
  }; /* if */
} /* End PutLine */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:11,代码来源:listing.c

示例13: GetCh

bool THttpLx::IsLws(){
  if ((Ch==' ')||(Ch==TCh::TabCh)){
    return true;
  } else
  if (Ch==TCh::CrCh){
    GetCh();
    if (Ch==TCh::LfCh){
      GetCh(); bool Ok=(Ch==' ')||(Ch==TCh::TabCh);
      PutCh(TCh::LfCh); PutCh(TCh::CrCh); return Ok;
    } else {
      PutCh(TCh::CrCh); return false;
    }
  } else
  if (Ch==TCh::LfCh){
    GetCh(); bool Ok=(Ch==' ')||(Ch==TCh::TabCh);
    PutCh(TCh::LfCh); return Ok;
  } else {
    return false;
  }
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:20,代码来源:http.cpp

示例14: PutBf

int TMOut::PutBf(const void* LBf, const TSize& LBfL){
  int LBfS=0;
  if (TSize(BfL+LBfL)>TSize(MxBfL)){
    for (TSize LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=PutCh(((char*)LBf)[LBfC]);}
  } else {
    for (TSize LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=(Bf[BfL++]=((char*)LBf)[LBfC]);}
  }
  return LBfS;
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:11,代码来源:fl.cpp

示例15: WriteComment

static void WriteComment(CARDINAL *i)
{
  CARDINAL tempPosition,
           length;
  if (currentLinePointer[*i] != CommentSymbol)
   {

    /*This is the silly line format case*/
    while (currentLinePointer[*i] != CR) PutCh(currentLinePointer[(*i)++]);
    PutLine();
  } else {
    if (linePosition <= TextStart) tempPosition = TextStart;
    else {
      tempPosition = CommentStart;
      PutCh(Space);
    }; /* if */
    Tab(tempPosition);
    if (linePosition > CommentStart) {
      length = 0;
      while (currentLinePointer[*i + length] != CR) length++;
      if ((linePosition + length > maxCols) &&
        (tempPosition + length <= maxCols)) {
        PutLine();
        Tab(CommentStart);
      }; /* if */
    }; /* if */
    do {
      while (linePosition < maxCols) {
        if (currentLinePointer[*i] == CR) break;
        PutCh(currentLinePointer[(*i)++]);
      }; /* while */
      if (linePosition < maxCols) break;
        /* The previous break was meant to leave the loop */
      PutLine();
      Tab(tempPosition);
    } while (1);
  }; /* if */
} /* End WriteComment */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:38,代码来源:listing.c


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