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


C++ Eof函数代码示例

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


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

示例1: getc

int CStdInStream::GetChar()
{
  int c = getc(_stream);
  if(c == EOF && !Eof())
    throw kReadErrorMessage;
  return c;
}
开发者ID:BGCX261,项目名称:zipeg-svn-to-git,代码行数:7,代码来源:StdInStream.cpp

示例2: strrchr

void LcfReader::SkipDebug(const struct LcfReader::Chunk& chunk_info, const char* srcfile) {
	// Dump the Chunk Data in Debug Mode
#ifdef _WIN32
	const char* srcfilename = strrchr(srcfile, '\\');
#else
	const char* srcfilename = strrchr(srcfile, '/');
#endif
	if (srcfilename == NULL) {
		srcfilename = srcfile;
	} else {
		srcfilename++;
	}
	fprintf(stderr, "Skipped Chunk %02X (%d byte) in lcf at %X (%s)\n",
			chunk_info.ID, chunk_info.length,  Tell(),
			srcfilename);
	for (uint32_t i = 0; i < chunk_info.length; ++i) {
		uint8_t byte;
		LcfReader::Read(byte);
		fprintf(stderr, "%02X ", byte);
		if ((i+1) % 16 == 0) {
			fprintf(stderr, "\n");
		}
		if (Eof()) {
			break;
		}
	}
	fprintf(stderr, "\n");
}
开发者ID:Zegeri,项目名称:liblcf,代码行数:28,代码来源:reader_lcf.cpp

示例3: FD_ZERO

bool wxPipeInputStream::CanRead() const
{
    if ( m_lasterror == wxSTREAM_EOF )
        return false;

    // check if there is any input available
    struct timeval tv;
    tv.tv_sec = 0;
    tv.tv_usec = 0;

    const int fd = m_file->fd();

    fd_set readfds;
    FD_ZERO(&readfds);
    FD_SET(fd, &readfds);
    switch ( select(fd + 1, &readfds, NULL, NULL, &tv) )
    {
        case -1:
            wxLogSysError(_("Impossible to get child process input"));
            // fall through

        case 0:
            return false;

        default:
            wxFAIL_MSG(_T("unexpected select() return value"));
            // still fall through

        case 1:
            // input available -- or maybe not, as select() returns 1 when a
            // read() will complete without delay, but it could still not read
            // anything
            return !Eof();
    }
}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:35,代码来源:utilsunx.cpp

示例4: fgetc

int CStdInStream::GetChar()
{
  int c = fgetc(_stream); // getc() doesn't work in BeOS?
  if (c == EOF && !Eof())
    throw kReadErrorMessage;
  return c;
}
开发者ID:ming-hai,项目名称:soui,代码行数:7,代码来源:StdInStream.cpp

示例5: GetLws

TStr THttpLx::GetRespReasonPhrase(){
  GetLws();
  TChA RPStr;
  while (!Eof()&&ChDef.IsText(Ch)&&(Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)){
    RPStr+=Ch; GetCh();}
  return RPStr;
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:7,代码来源:http.cpp

示例6: Next

void ImageSectionsReader::Next(void)
{
	if(Eof()) return;

	m_SectionsLeft--;
	m_Section = (PIMAGE_SECTION_HEADER) PtrFromRva( m_Section, sizeof(IMAGE_SECTION_HEADER) );
}
开发者ID:ripieces,项目名称:advancedfx,代码行数:7,代码来源:binutils.cpp

示例7: while

wxArrayString CTextFile::ReadLines(EReadTextFile flags, const wxMBConv& conv)
{
	wxArrayString lines;

	while (!Eof()) {
		wxString line = GetNextLine(conv);

		if (flags & txtStripWhitespace) {
			line = line.Strip(wxString::both);
		}

		if (flags & txtIgnoreEmptyLines) {
			if (line.IsEmpty()) {
				continue;
			}
		}
		
		if (flags & txtIgnoreComments) {
			if (flags & txtStripWhitespace) {
				if (line.StartsWith(wxT("#"))) {
					continue;
				}
			} else if (line.Strip(wxString::leading).StartsWith(wxT("#"))) {
				continue;
			}
		}

		lines.Add(line);
	}

	return lines;
}
开发者ID:dreamerc,项目名称:amule,代码行数:32,代码来源:TextFile.cpp

示例8: ResetData

bool CFCMReadFile::ParsingTextFile(CString szDelimiter)
{
	if(!IsOpen())
	{
		return false;
	}

	CString szLine;

	ResetData();
	// m_nCols = GetNumberColums(szDelimiter);
	m_nCols = GetNumberColumsMulti(szDelimiter);

	while(!Eof())
	{
		if(ReadLine(szLine))
		{
			if (!szLine.IsEmpty()) {
				++m_nRows;
				//ParsingLine(szLine, szDelimiter);
				ParsingLineMulti(szLine, szDelimiter);
			}
		}
	};

	return true;
}
开发者ID:gzumpan,项目名称:fuzzy-cmeans,代码行数:27,代码来源:ReadWriteFile.cpp

示例9: while

TStr THttpLx::GetUrlStr(){
  TChA UrlChA;
  while ((!Eof())&&(!ChDef.IsSp(Ch))){
    UrlChA+=Ch; GetCh();}
  if (UrlChA.Empty()){
    throw THttpEx(heUrlEmpty);}
  return UrlChA;
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:8,代码来源:http.cpp

示例10: while

int FileStream::ReadLine(void * data, int maxsize)
{
    char * buf = (char *)data;
    int size = 0;

    if (!Eof())
    {
        char c = 0;

        while (size < maxsize && c != '\n' && !Eof())
        {
			mFile.Read(&c, sizeof(char), 1);
            buf[size++] = c;
        }
    }

    return size;
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:18,代码来源:MWDataStream.cpp

示例11: sizeof

int FileStream::SkipLine()
{
    int size = 0;

    if (!Eof())
    {
        char c;

        mFile.Read(&c, sizeof(char), 1);

        while (c != '\n' && !Eof())
        {
            ++size;
        }
    }

    return size;
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:18,代码来源:MWDataStream.cpp

示例12: while

// Plain text, up until an angled bracket
bool wxSimpleHtmlParser::ParseText(wxString& text)
{
    while (!Eof() && GetChar(m_pos) != wxT('<'))
    {
        text += GetChar(m_pos);
        m_pos ++;
    }
    return TRUE;
}
开发者ID:axonim,项目名称:ecos-ax-som-bf609,代码行数:10,代码来源:htmlparser.cpp

示例13: GetClear

char InSituStringStream::GetClear()
{
    // get the character and then clear value
    if (Eof())
        return 0;
    char value = *src_;
    *src_++ = 0;
    return value;
}
开发者ID:AlbrechtL,项目名称:anyrpc,代码行数:9,代码来源:stream.cpp

示例14: while

bool TSIn::GetNextLn(TChA& LnChA){
  LnChA.Clr();
  while (!Eof()){
    const char Ch=GetCh();
    if (Ch=='\n'){return true;}
    if (Ch=='\r' && PeekCh()=='\n'){GetCh(); return true;}
    LnChA.AddCh(Ch);
  }
  return !LnChA.Empty();
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:10,代码来源:fl.cpp

示例15: Get

char ReadFileStream::Get()
{
    char c = *current_;
    if (!Eof())
    {
        current_++;
        count_++;
        Read();
    }
    return c;
}
开发者ID:AlbrechtL,项目名称:anyrpc,代码行数:11,代码来源:stream.cpp


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