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


C++ Stream::EOS方法代码示例

本文整理汇总了C++中Stream::EOS方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::EOS方法的具体用法?C++ Stream::EOS怎么用?C++ Stream::EOS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stream的用法示例。


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

示例1: File_ReadStringBack

const char* File_ReadStringBack(sc_File *fil) {
  Stream *in = get_valid_file_stream_from_handle(fil->handle, "File.ReadStringBack");
  if (in->EOS()) {
    return CreateNewScriptString("");
  }

  int lle = in->ReadInt32();
  if ((lle >= 20000) || (lle < 1))
    quit("!File.ReadStringBack: file was not written by WriteString");

  char *retVal = (char*)malloc(lle);
  in->Read(retVal, lle);

  return CreateNewScriptString(retVal, false);
}
开发者ID:Aquilon96,项目名称:ags,代码行数:15,代码来源:file.cpp

示例2: File_ReadRawLine

void File_ReadRawLine(sc_File *fil, char* buffer) {
  Stream *in = get_valid_file_stream_from_handle(fil->handle, "File.ReadRawLine");
  check_strlen(buffer);
  int i = 0;
  while (i < MAXSTRLEN - 1) {
    buffer[i] = in->ReadInt8();
    if (buffer[i] == 13) {
      // CR -- skip LF and abort
      in->ReadInt8();
      break;
    }
    if (buffer[i] == 10)  // LF only -- abort
      break;
    if (in->EOS())  // EOF -- abort
      break;
    i++;
  }
  buffer[i] = 0;
}
开发者ID:Aquilon96,项目名称:ags,代码行数:19,代码来源:file.cpp

示例3: wloadsprites

  int wloadsprites(color * pall, char *filnam, Bitmap ** sarray, int strt, int eend)
  {
    int vers;
    char buff[20];
    int numspri = 0, vv, hh, wdd, htt;

    Stream *in = Common::AssetManager::OpenAsset(filnam);
    if (in == NULL)
      return -1;

    vers = in->ReadInt16();
    in->ReadArray(&buff[0], 13, 1);
    for (vv = 0; vv < 256; vv++)        // there's a filler byte
      in->ReadArray(&pall[vv], 3, 1);

    if (vers > 4)
      return -1;

    if (vers == 4)
      numspri = in->ReadInt16();
    else {
      numspri = in->ReadInt16();
      if ((numspri < 2) || (numspri > 200))
        numspri = 200;
    }

    for (vv = strt; vv <= eend; vv++)
      sarray[vv] = NULL;

    for (vv = 0; vv <= numspri; vv++) {
      int coldep = in->ReadInt16();

      if (coldep == 0) {
        sarray[vv] = NULL;
        if (in->EOS())
          break;

        continue;
      }

      if (in->EOS())
        break;

      if (vv > eend)
        break;

      wdd = in->ReadInt16();
      htt = in->ReadInt16();
      if (vv < strt) {
          in->Seek(Common::kSeekCurrent, wdd * htt);
        continue;
      }
      sarray[vv] = BitmapHelper::CreateBitmap(wdd, htt, coldep * 8);

      if (sarray[vv] == NULL) {
        delete in;
        return -1;
      }

      for (hh = 0; hh < htt; hh++)
        in->ReadArray(&sarray[vv]->GetScanLineForWriting(hh)[0], wdd * coldep, 1);
    }
    delete in;
    return 0;
  }
开发者ID:JackSamurai,项目名称:ags,代码行数:65,代码来源:wgt2allg.cpp


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