这篇教程C++ Eof函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Eof函数的典型用法代码示例。如果您正苦于以下问题:C++ Eof函数的具体用法?C++ Eof怎么用?C++ Eof使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Eof函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: getcint CStdInStream::GetChar(){ int c = getc(_stream); if(c == EOF && !Eof()) throw kReadErrorMessage; return c;}
开发者ID:BGCX261,项目名称:zipeg-svn-to-git,代码行数:7,
示例2: strrchrvoid 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,
示例3: FD_ZERObool 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,
示例4: fgetcint 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,
示例5: GetLwsTStr 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,
示例6: Nextvoid ImageSectionsReader::Next(void){ if(Eof()) return; m_SectionsLeft--; m_Section = (PIMAGE_SECTION_HEADER) PtrFromRva( m_Section, sizeof(IMAGE_SECTION_HEADER) );}
开发者ID:ripieces,项目名称:advancedfx,代码行数:7,
示例7: whilewxArrayString 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,
示例8: ResetDatabool 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,
示例9: whileTStr 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,
示例10: whileint 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,
示例11: sizeofint 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,
示例12: while// Plain text, up until an angled bracketbool 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,
示例13: GetClearchar InSituStringStream::GetClear(){ // get the character and then clear value if (Eof()) return 0; char value = *src_; *src_++ = 0; return value;}
开发者ID:AlbrechtL,项目名称:anyrpc,代码行数:9,
示例14: whilebool 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,
示例15: Getchar ReadFileStream::Get(){ char c = *current_; if (!Eof()) { current_++; count_++; Read(); } return c;}
开发者ID:AlbrechtL,项目名称:anyrpc,代码行数:11,
示例16: Matchesbool wxSimpleHtmlParser::ParseComment(){ // Eat the comment tag start Matches(wxT("<!--"), TRUE); while (!Eof() && !Matches(wxT("-->"), TRUE)) { m_pos ++; } return TRUE;}
开发者ID:axonim,项目名称:ecos-ax-som-bf609,代码行数:12,
示例17: usleepinline int64_t Barrier::wait_for (int64_t pos) const{ if (last_min_ > pos) { return last_min_; } int64_t min_pos = kMaxInt64Value; for (auto itr = limit_seq_.begin (); itr != limit_seq_.end (); ++itr) { int64_t itr_pos = 0; itr_pos = (*itr)->pos().aquire(); // spin for a bit for (int i = 0; itr_pos < pos && i < 1000; ++i) { itr_pos = (*itr)->pos().aquire(); if ((*itr)->pos().alert()) break; } // yield for a while, queue slowing down for (int y = 0; itr_pos < pos && y < 1000; ++y) { usleep(0); itr_pos = (*itr)->pos().aquire(); if ((*itr)->pos().alert()) break; } // queue stalled, don't peg the CPU but don't wait too long either... while (itr_pos < pos) { usleep (10 * 1000); // 10ms itr_pos = (*itr)->pos ().aquire (); if ((*itr)->pos ().alert ()) break; } if ((*itr)->pos ().alert ()) { (*itr)->check_alert (); if (itr_pos > pos) { // process everything up to itr_pos return itr_pos - 1; } else { throw Eof(); } } if (itr_pos < min_pos) { min_pos = itr_pos; } } assert (min_pos != kMaxInt64Value); return last_min_ = min_pos;}
开发者ID:ApusApp,项目名称:Swift,代码行数:52,
示例18: Readvoid SNetStorageObjectImpl::Read(string* data){ char buffer[READ_CHUNK_SIZE]; data->resize(0); size_t bytes_read; do { Read(buffer, sizeof(buffer), &bytes_read); data->append(buffer, bytes_read); } while (!Eof()); Close();}
开发者ID:DmitrySigaev,项目名称:ncbi,代码行数:14,
示例19: size_t LcfReader::Read0(void *ptr, size_t size, size_t nmemb) { if (size == 0) { //avoid division by 0 return 0; } //Read nmemb elements of size and return the number of read elements stream.read(reinterpret_cast<char*>(ptr), size*nmemb); size_t result = stream.gcount() / size;#ifdef NDEBUG if (result != nmemb && !Eof()) { perror("Reading error: "); }#endif return result;}
开发者ID:Zegeri,项目名称:liblcf,代码行数:14,
示例20: FindEol// Sets BfN to the end of line or end of buffer. Reads more data, if needed.// Returns 1, when an end of line was found, BfN is end of line.// Returns 0, when an end of line was not found and more data is required,// BfN is end of buffer.// Returns -1, when an end of file was found, BfN is not defined.int TZipIn::FindEol(int& BfN) { char Ch; if (BfC >= BfL) { // check for eof, read more data if (Eof()) { return -1; } FillBf(); } while (BfC < BfL) { Ch = Bf[BfC++]; if (Ch=='/n') { BfN = BfC-1; return 1; } if (Ch=='/r' && Bf[BfC+1]=='/n') { BfC++; BfN = BfC-2; return 1; } } BfN = BfC; return 0;}
开发者ID:Bradeskojest,项目名称:qminer,代码行数:20,
示例21: MULE_VALIDATE_PARAMSvoid CFileDataIO::Read(void *buffer, size_t count) const{ MULE_VALIDATE_PARAMS(buffer, wxT("Attempting to write to NULL buffer.")); // Check that we read everything we wanted. if (doRead(buffer, count) == (signed)count) { return; } // To reduce potential system calls, we only do EOF checks when reads fail. if (Eof()) { throw CEOFException(wxT("Attempt to read past end of file.")); } else { throw CIOFailureException(wxT("Read error, failed to read from file.")); }}
开发者ID:0vermind,项目名称:hmule,代码行数:16,
示例22: whilesize_t ReadFileStream::Read(char* ptr, size_t length){ size_t bytesRead = 0; while ((length > 0) && !Eof()) { // copy up to the available data in the buffer size_t availBytes = std::min(static_cast<size_t>(bufferLast_ - current_), length); memcpy(ptr, current_, availBytes); length -= availBytes; ptr += availBytes; current_ += availBytes; bytesRead += availBytes; // get more data Read(); } count_ += bytesRead; return bytesRead;}
开发者ID:AlbrechtL,项目名称:anyrpc,代码行数:18,
注:本文中的Eof函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Eq函数代码示例 C++ EnvSetCurrentModule函数代码示例 |