本文整理匯總了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;
}
示例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");
}
示例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();
}
}
示例4: fgetc
int CStdInStream::GetChar()
{
int c = fgetc(_stream); // getc() doesn't work in BeOS?
if (c == EOF && !Eof())
throw kReadErrorMessage;
return c;
}
示例5: GetLws
TStr THttpLx::GetRespReasonPhrase(){
GetLws();
TChA RPStr;
while (!Eof()&&ChDef.IsText(Ch)&&(Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)){
RPStr+=Ch; GetCh();}
return RPStr;
}
示例6: Next
void ImageSectionsReader::Next(void)
{
if(Eof()) return;
m_SectionsLeft--;
m_Section = (PIMAGE_SECTION_HEADER) PtrFromRva( m_Section, sizeof(IMAGE_SECTION_HEADER) );
}
示例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;
}
示例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;
}
示例9: while
TStr THttpLx::GetUrlStr(){
TChA UrlChA;
while ((!Eof())&&(!ChDef.IsSp(Ch))){
UrlChA+=Ch; GetCh();}
if (UrlChA.Empty()){
throw THttpEx(heUrlEmpty);}
return UrlChA;
}
示例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;
}
示例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;
}
示例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;
}
示例13: GetClear
char InSituStringStream::GetClear()
{
// get the character and then clear value
if (Eof())
return 0;
char value = *src_;
*src_++ = 0;
return value;
}
示例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();
}
示例15: Get
char ReadFileStream::Get()
{
char c = *current_;
if (!Eof())
{
current_++;
count_++;
Read();
}
return c;
}