• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IsEOF函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: while

void CXML_Parser::SkipLiterals(const CFX_ByteStringC& str) {
  m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
  if (IsEOF()) {
    return;
  }
  int32_t i = 0, iLen = str.GetLength();
  do {
    while (m_dwIndex < m_dwBufferSize) {
      if (str.GetAt(i) != m_pBuffer[m_dwIndex++]) {
        i = 0;
      } else {
        i++;
        if (i == iLen) {
          break;
        }
      }
    }
    m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
    if (i == iLen) {
      return;
    }
    if (m_dwIndex < m_dwBufferSize || IsEOF()) {
      break;
    }
  } while (ReadNextBlock());
  while (!m_pDataAcc->IsEOF()) {
    ReadNextBlock();
    m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwBufferSize;
  }
  m_dwIndex = m_dwBufferSize;
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:31,代码来源:fx_xml_parser.cpp


示例2: while

bool Tokenizer::SkipToEOL(bool nestBraces, bool skippingComment)
{
    // skip everything until we find EOL
    while (1)
    {
        while (NotEOF() && CurrentChar() != '\n')
        {
            if (CurrentChar() == '/' && NextChar() == '*')
            {
                SkipComment(false); // don't skip whitespace after the comment
                if (skippingComment && CurrentChar() == '\n')
                {
                    continue; // early exit from the loop
                }
            }
            if (nestBraces && CurrentChar() == _T('{'))
                ++m_NestLevel;
            else if (nestBraces && CurrentChar() == _T('}'))
                --m_NestLevel;
            MoveToNextChar();
        }
        wxChar last = PreviousChar();
        // if DOS line endings, we 've hit \r and we skip to \n...
        if (last == '\r')
            last = m_Buffer.GetChar(m_TokenIndex - 2);
        if (IsEOF() || last != '\\')
            break;
        else
            MoveToNextChar();
    }
    if (IsEOF())
        return false;
    return true;
}
开发者ID:bezigon,项目名称:liteide.oldcpp,代码行数:34,代码来源:tokenizer.cpp


示例3: while

bool TextCutter::SkipWhiteSpace()
{
    if (IsEOF())
        return false;
    while (!IsEOF() && isspace(CurrentChar()))
        MoveToNextChar();
    return true;
}
开发者ID:GRIMMJr,项目名称:fortranproject,代码行数:8,代码来源:textcutter.cpp


示例4: MoveNext

void CollateRecordset::MoveNext()
{
    if (!IsEOF())
    {
	++m_index;
	if (m_index == m_items.size() && !IsEOF())
	    GetSome();
    }
}
开发者ID:pdh11,项目名称:chorale,代码行数:9,代码来源:recordset.cpp


示例5: MoveNext

BOOL CSourceODBC::stdFillTable1(CString field1, CString& strValue1, CString field2, long& lngValue2)
{
    if ( IsEOF() ) return FALSE;

    strValue1 = m_database.GetColomn(CString(field1))->GetValueAsString();
    lngValue2 = m_database.GetColomn(CString(field2))->GetValueAsLong();
    MoveNext();
    if ( IsEOF() ) return FALSE;
    return TRUE;
}
开发者ID:HumMan,项目名称:ToolDBManager,代码行数:10,代码来源:SourceODBC.cpp


示例6: while

void CSessions::clearRecords()
{
	if (!IsBOF() || !IsEOF())
	{
		while (!IsEOF())
		{
			Delete();
			MoveNext();
		}
	}

}
开发者ID:acterics,项目名称:LaboratoryWorks-2C2S,代码行数:12,代码来源:CSessions.cpp


示例7: while

void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag)
{
    m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
    if (IsEOF()) {
        return;
    }
    bEndTag = FALSE;
    FX_BYTE ch;
    FX_INT32 iState = bStartTag ? 1 : 0;
    do {
        while (m_dwIndex < m_dwBufferSize) {
            ch = m_pBuffer[m_dwIndex];
            switch (iState) {
                case 0:
                    m_dwIndex ++;
                    if (ch != '<') {
                        break;
                    }
                    iState = 1;
                    break;
                case 1:
                    if (ch == '?') {
                        m_dwIndex ++;
                        SkipLiterals(FX_BSTRC("?>"));
                        iState = 0;
                        break;
                    } else if (ch == '!') {
                        m_dwIndex ++;
                        SkipLiterals(FX_BSTRC("-->"));
                        iState = 0;
                        break;
                    }
                    if (ch == '/') {
                        m_dwIndex ++;
                        GetName(space, name);
                        bEndTag = TRUE;
                    } else {
                        GetName(space, name);
                        bEndTag = FALSE;
                    }
                    return;
            }
        }
        m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
        if (m_dwIndex < m_dwBufferSize || IsEOF()) {
            break;
        }
    } while (ReadNextBlock());
}
开发者ID:HelloZhu,项目名称:PDFium.js,代码行数:49,代码来源:fx_xml_parser.cpp


示例8: PQgetvalue

   double
   PGRecordset::GetDoubleValue(const AnsiString &FieldName) const
   //---------------------------------------------------------------------------()
   // DESCRIPTION:
   // Returns the value of a string in the current row in the recordset.
   //---------------------------------------------------------------------------()
   {
      if (IsEOF())
      {
         ReportEOFError_(FieldName);
         return 0;
      }

      try
      {
         int iColIdx = GetColumnIndex_(FieldName);
         char *pValue = PQgetvalue(result_, cur_row_num_, iColIdx);
         double dbVal = pValue ? atof(pValue) : 0;

         return dbVal;
      }
      catch (...)
      {
         ErrorManager::Instance()->ReportError(ErrorManager::Medium, 5091, "PGRecordset::GetDoubleValue", "An unknown error occurred while reading value from recordset: " + FieldName);
         throw;
      }
   }
开发者ID:David-Polehonski,项目名称:hmailserver,代码行数:27,代码来源:PGRecordset.cpp


示例9: SelectThisItem

void SearchRecordset::SelectThisItem()
{
    if (IsEOF())
	return;

    mediadb::didl::MetadataList::const_iterator ci = m_items.begin();

    for (unsigned int i=0; i<m_index; ++i)
	++ci;

    std::string objectid;
    for (mediadb::didl::Metadata::const_iterator i = ci->begin();
	 i != ci->end();
	 ++i)
	if (i->tag == "id")
	{
	    objectid = i->content;
	    break;
	}

    m_freers = db::FreeRecordset::Create();
    mediadb::didl::ToRecord(*ci, m_freers);
    m_id = m_parent->IdForObjectId(objectid);
    m_got_what = GOT_BASIC;
}
开发者ID:pdh11,项目名称:chorale,代码行数:25,代码来源:recordset.cpp


示例10: _ASSERTE

BOOL CSqlite3Recordset::GetField(short iIndex, LPTSTR pData, UINT cchMax)
{
   _ASSERTE(IsOpen());
   _ASSERTE(iIndex>=0 && iIndex<m_nCols);
   if( IsEOF() ) return FALSE;
   if( iIndex < 0 || iIndex >= m_nCols ) return FALSE;
   if( m_lType == DB_OPEN_TYPE_FORWARD_ONLY ) {
#if !defined(UNICODE)
      USES_CONVERSION;
      _tcsncpy(pData, A2T( (char*)::sqlite3_column_text(m_pVm, iIndex) ), cchMax);
#else  // UNICODE
      _tcsncpy(pData, (WCHAR*) ::sqlite3_column_text16(m_pVm, iIndex), cchMax);
#endif // UNICODE
   }
   else {
      LPSTR pstr = m_ppSnapshot[ ((m_iPos + 1) * m_nCols) + iIndex ];
      if( pstr == NULL ) {
         _tcscpy(pData, _T(""));
      }
      else {
         USES_CONVERSION;
         LPCSTR pstr = m_ppSnapshot[ ((m_iPos + 1) * m_nCols) + iIndex ];
         _tcsncpy(pData, A2CT(pstr), cchMax);
      }
   }
   return TRUE;
}
开发者ID:okigan,项目名称:dblib,代码行数:27,代码来源:DbSqlite3.cpp


示例11: readWchar

wchar_t EasyUnicodeFileLE::readWchar( )//读取一个宽字符
{
	if( !IsReadMode ) return L'';//输出模式不允许读入
	if( IsEOF( ) ) return L'';//如果已经在文件尾了,就不读了

	wchar_t Temp2[ 2 ];
	wchar_t tempWC[ 2 ];
	try {
		F.read( (char *)tempWC, 2 );
		tempWC[ 1 ] = L'\0';

		if( tempWC[ 0 ] == L'\x000D' ) {
			F.read( (char *)Temp2, 2 );
			Temp2[ 1 ] = L'\0';
			if( Temp2[ 0 ] == L'\x000A' ) return L'\n';
			else {
				SetPointer( -1, ios_base::cur );
				return tempWC[ 0 ];
			}
		}
		else return tempWC[ 0 ];
	}
	catch( ... ) {
		cout << "ERROR_EUFLE008 - Unknown error." << endl;
		system( "PAUSE" );
		return L'';
	}
	return tempWC[ 0 ];
}
开发者ID:GKhime,项目名称:cross-channel_chinese-localization_project,代码行数:29,代码来源:EasyUnicodeFileLE.cpp


示例12: PQgetisnull

   bool 
   PGRecordset::GetIsNull(const AnsiString &FieldName) const
   //---------------------------------------------------------------------------()
   // DESCRIPTION:
   // Returns true if the column contains NULL
   //---------------------------------------------------------------------------()
   {
      if (IsEOF())
      {
         ReportEOFError_(FieldName);
         return false;
      }

      try
      {
         int iColIdx = GetColumnIndex_(FieldName);
         bool isNull = PQgetisnull(result_, cur_row_num_, iColIdx) == 1;

         return isNull;
      }
      catch (...)
      {
         ErrorManager::Instance()->ReportError(ErrorManager::High, 5301, "PGRecordset::GetIsNull", "An error occured while checking for null.");
         throw;
      }
   }
开发者ID:David-Polehonski,项目名称:hmailserver,代码行数:26,代码来源:PGRecordset.cpp


示例13: ReadLine

      /// <summary>Reads the next line, if any</summary>
      /// <param name="line">The line.</param>
      /// <returns>True if read, false if EOF</returns>
      /// <exception cref="Logic::InvalidOperationException">Stream has been closed (reader has been move-copied)</exception>
      /// <exception cref="Logic::IOException">An I/O error occurred</exception>
      bool  StringReader::ReadLine(wstring&  line)
      {
         DWORD start = Position,    // Start of line
               end   = Length;      // End of characters on line
         WCHAR ch;

         // EOF: Return false
         if (IsEOF())
         {
            line.clear();
            return false;
         }

         // Search for EOF/CRLF/CR
         while (ReadChar(ch))
         {
            // CR/LF/CRLF: Set of chars marker, 
            if (ch == '\r' || ch == '\n')
            {
               // Mark end-of-text
               end = Position-1;

               // Consume entire CRLF if present
               if (ch == '\r' && PeekChar(ch) && ch == '\n')
                  ReadChar(ch);

               // Position marker now at start of new line, end-of-char marker at last character
               break;
            }
         }

         // Return line text without CRLF
         line = wstring(Buffer.get() + start, Buffer.get() + end);
         return true;
      }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:40,代码来源:StringReader.cpp


示例14: while

/*===========================================================================
 *
 * Class CSrFile Method - bool ReadLine (Buffer);
 *
 * Inputs a line of text from a text file.
 *
 *=========================================================================*/
bool CSrFile::ReadLine (CSString& Buffer) {
  byte    Value;
  size_t  Result;
  //SSCHAR  TempBuffer[256];
  //SSCHAR* pResult;

	/* Set some initial string size */
  Buffer.SetSizeEmpty(64);
  //Buffer.Empty();

  while (!IsEOF()) {
 
     		/* Attempt to input buffer */
    Result = fread(&Value, 1, 1, m_pFile);

    if (Result != 1) {
      if (HasError()) return AddSrSystemError("Failed to read byte from file!");
      return (true);
    }

    if (Value == '\n') {
      ++m_LineCount;
      return (true);
     }
    else {
      Buffer += Value;
     }
   }

  return (true);
}
开发者ID:Purr4me,项目名称:TES5Edit-GoogleCode,代码行数:38,代码来源:srfile.cpp


示例15: InvalidOperationException

      /// <summary>Reads the next character</summary>
      /// <param name="c">Next character</param>
      /// <returns>True if read, false if EOF</returns>
      /// <exception cref="Logic::InvalidOperationException">Stream has been closed (reader has been move-copied)</exception>
      /// <exception cref="Logic::IOException">An I/O error occurred</exception>
      bool  StringReader::ReadChar(WCHAR&  c)
      {
         // Ensure stream has not been moved
         if (Input == nullptr)
            throw InvalidOperationException(HERE, L"Underlying stream has been closed");

         // First Call: Read entire file 
         else if (Buffer == nullptr)
            Buffer = FileStream::ConvertFileBuffer(Input, Length);

         // EOF: Return false
         if (IsEOF())
         {
            c = NULL;
            return false;
         }

         // Increment line number 
         if (c == L'\n')
            LineNum++;

         // Set byte, advance position, return true
         c = Buffer.get()[Position++];
         return true;
      }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:30,代码来源:StringReader.cpp


示例16: Loop

 bool Loop()
 {
    size_t row = 0;
    if (!(IsBOF() && IsEOF())) for (MoveFirst(); !IsEOF(); MoveNext(), row++)
    {
       //TRACE(_T("row %3d\n"), row);
       NewRecord();
       for (int i = 0; i < GetFieldCount(); i++)
       {
          COleVariant var;
    	   GetFieldValue(i, var);
          SaveField(i, var);
       }
       SaveRecord();
    }
    return true;
 }
开发者ID:4Step,项目名称:crossPlatform_methods,代码行数:17,代码来源:msaccess.cpp


示例17: while

bool Tokenizer::SkipUnwanted()
{
    while (SkipWhiteSpace() || SkipComment())
        ;

    wxChar c = CurrentChar();
    const unsigned int startIndex = m_TokenIndex;

    if (c == _T('#'))
    {
        const PreprocessorType type = GetPreprocessorType();
        if (type != ptOthers)
        {
            HandleConditionPreprocessor(type);
            c = CurrentChar();
        }
    }

    // skip [XXX][YYY]
    if (m_State & tsSkipSubScrip)
    {
        while (c == _T('[') )
        {
            SkipBlock('[');
            SkipWhiteSpace();
            if (IsEOF())
                return false;
            c = CurrentChar();
        }
    }

    // skip the following = or ?
    if (m_State & tsSkipEqual)
    {
        if (c == _T('='))
        {
            if (!SkipToOneOfChars(_T(",;}"), true, true, false))
                return false;
        }
    }
    else if (m_State & tsSkipQuestion)
    {
        if (c == _T('?'))
        {
            if (!SkipToOneOfChars(_T(";}"), false, true))
                return false;
        }
    }

    // skip the following white space and comments
    while (SkipWhiteSpace() || SkipComment())
        ;

    if (startIndex != m_TokenIndex && CurrentChar() == _T('#'))
        return SkipUnwanted();

    return NotEOF();
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:58,代码来源:tokenizer.cpp


示例18: MoveToNextChar

bool TextCutter::MoveToNextChar()
{
    if (IsEOF())
        return false;
	++m_CurIdx;
	++m_CurColumn;
    AdjustColumn();
    return true;
}
开发者ID:GRIMMJr,项目名称:fortranproject,代码行数:9,代码来源:textcutter.cpp


示例19: SetPointer

void EasyUnicodeFileLE::SetPointer( std::streamoff off, basic_istream< char, char_traits< char > >::pos_type PosType )
{
	/*
	参数说明:
		off :需要偏移的值
		PosType :搜索的起始位置
	枚举类型:
		enum seek_dir {beg, cur, end};
		每个枚举常量的含义:
		ios::beg :文件流的起始位置
		ios::cur :文件流的当前位置
		ios::end :文件流的结束位置
	*/

	//注意文件头
	if( IsEOF( ) ) F.clear( );

	if( (int)PosType == ios_base::beg && off >= 0 ) {
		F.seekg( 2 /*+ 2 * off*/, ios_base::beg );//FF FE
		for( int i = 0; i < off; i ++ ) readWchar( );
	}
	else if( (int)PosType == ios_base::cur ) {
		F.seekg( 0/*2 * off*/, ios_base::cur );
		if( off >= 0 ) for( int i = 0; i < off; i ++ ) readWchar( );
		else for( int i = 0; i < -off; i ++ ) {
			try {
				F.seekg( -4, ios_base::cur );
				if( readWchar( ) == L'\n' ) {
					F.seekg( -4, ios_base::cur );
					continue;
				}
			}
			catch( ... ) {
				cout << "ERROR_EUFLE010 - Unknown error." << endl;
				system( "PAUSE" );
			}
		}
	}
	else if( (int)PosType == ios_base::end && off <= 0 ) {
		F.seekg( 0/*2 * off*/, ios_base::end );
		for( int i = 0; i < -off; i ++ ) {
			try {
				F.seekg( -4, ios_base::cur );
			   	if( readWchar( ) == L'\n' ) {
					F.seekg( -4, ios_base::cur );
					continue;
				}
			}
			catch( ... ) {
				cout << "ERROR_EUFLE011 - Unknown error." << endl;
				system( "PAUSE" );
   			}
		}
	}
	else cout << "ERROR_EUFLE012 - Unsupport referring file mode." << endl;
	return;
}
开发者ID:GKhime,项目名称:cross-channel_chinese-localization_project,代码行数:57,代码来源:EasyUnicodeFileLE.cpp


示例20: while

void CXML_Parser::GetAttrValue(CFX_WideString &value)
{
    m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
    if (IsEOF()) {
        return;
    }
    CFX_UTF8Decoder decoder;
    uint8_t mark = 0, ch = 0;
    do {
        while (m_dwIndex < m_dwBufferSize) {
            ch = m_pBuffer[m_dwIndex];
            if (mark == 0) {
                if (ch != '\'' && ch != '"') {
                    return;
                }
                mark = ch;
                m_dwIndex ++;
                ch = 0;
                continue;
            }
            m_dwIndex ++;
            if (ch == mark) {
                break;
            }
            if (ch == '&') {
                decoder.AppendChar(GetCharRef());
                if (IsEOF()) {
                    value = decoder.GetResult();
                    return;
                }
            } else {
                decoder.Input(ch);
            }
        }
        m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
        if (ch == mark || m_dwIndex < m_dwBufferSize || IsEOF()) {
            break;
        }
    } while (ReadNextBlock());
    value = decoder.GetResult();
}
开发者ID:abbro-ca,项目名称:pdfium,代码行数:41,代码来源:fx_xml_parser.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsEffectActive函数代码示例发布时间:2022-05-30
下一篇:
C++ IsDone函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap