當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。