本文整理汇总了C++中TChA::AddBf方法的典型用法代码示例。如果您正苦于以下问题:C++ TChA::AddBf方法的具体用法?C++ TChA::AddBf怎么用?C++ TChA::AddBf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TChA
的用法示例。
在下文中一共展示了TChA::AddBf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNextLnBf
bool TFIn::GetNextLnBf(TChA& LnChA) {
int Status;
int BfN; // new pointer to the end of line
int BfP; // previous pointer to the line start
bool CrEnd; // last character in previous buffer was CR
LnChA.Clr();
CrEnd = false;
do {
if (BfC >= BfL) {
// reset the current pointer, FindEol() will read a new buffer
BfP = 0;
} else {
BfP = BfC;
}
Status = FindEol(BfN,CrEnd);
if (Status >= 0) {
if (BfN-BfP > 0) {
LnChA.AddBf(&Bf[BfP],BfN-BfP);
}
if (Status == 1) {
// got a complete line
return true;
}
}
// get more data, if the line is incomplete
} while (Status == 0);
// eof or the last line has no newline
return !LnChA.Empty();
}
示例2: GetNextLnBf
// Gets the next line to LnChA.
// Returns true, if LnChA contains a valid line.
// Returns false, if LnChA is empty, such as end of file was encountered.
bool TZipIn::GetNextLnBf(TChA& LnChA) {
int Status;
int BfN; // new pointer to the end of line
int BfP; // previous pointer to the line start
LnChA.Clr();
do {
if (BfC >= BfL) { BfP = 0; } // reset the current pointer, FindEol() will read a new buffer
else { BfP = BfC; }
Status = FindEol(BfN);
if (Status >= 0) {
LnChA.AddBf(&Bf[BfP],BfN-BfP);
if (Status == 1) { return true; } // got a complete line
}
// get more data, if the line is incomplete
} while (Status == 0);
// eof or the last line has no newline
return !LnChA.Empty();
}