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


C++ TChA::AddBf方法代码示例

本文整理汇总了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();
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:32,代码来源:fl.cpp

示例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();
}
开发者ID:Bradeskojest,项目名称:qminer,代码行数:21,代码来源:zipfl.cpp


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