本文整理汇总了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('&');
}
}
}
示例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 */
示例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);
}
示例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;
}
示例5: ListRegValue
void ListRegValue(CARDINAL reg)
{
if (((1 << ListPC) & listStatus) && printState) {
PutChs(" ");
PutHexCh(reg);
PutCh(Space);
}; /* if */
} /* End ListRegValue */
示例6: ListWordValue
void ListWordValue(CARDINAL w)
{
if (printState && ((1 << ListPC) & listStatus)) {
if (linePosition >= TextStart) PutLine();
Tab(CodeStart);
PutHexCardinal(w);
PutCh(Space);
}; /* if */
} /* End ListWordValue */
示例7: PutStrPgm
void PutStrPgm(PGM_P str)
{
char ch;
do {
ch=pgm_read_byte(str++);
if(ch)
PutCh(ch);
}while(ch);
}
示例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;
}
示例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 */
示例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 */
示例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;
}
示例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 */
示例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;
}
}
示例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;
}
示例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 */