本文整理汇总了C++中IsEOF函数的典型用法代码示例。如果您正苦于以下问题:C++ IsEOF函数的具体用法?C++ IsEOF怎么用?C++ IsEOF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsEOF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: while
bool TextCutter::SkipWhiteSpace()
{
if (IsEOF())
return false;
while (!IsEOF() && isspace(CurrentChar()))
MoveToNextChar();
return true;
}
示例4: MoveNext
void CollateRecordset::MoveNext()
{
if (!IsEOF())
{
++m_index;
if (m_index == m_items.size() && !IsEOF())
GetSome();
}
}
示例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;
}
示例6: while
void CSessions::clearRecords()
{
if (!IsBOF() || !IsEOF())
{
while (!IsEOF())
{
Delete();
MoveNext();
}
}
}
示例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());
}
示例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;
}
}
示例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;
}
示例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;
}
示例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 ];
}
示例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;
}
}
示例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;
}
示例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);
}
示例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;
}