当前位置: 首页>>代码示例>>C++>>正文


C++ IsError函数代码示例

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


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

示例1: Peek

bool Socket::Data::CloseRaw(int msecs_timeout)
{
	if(socket == INVALID_SOCKET)
		return false;
	bool ok = !IsError() && Peek(msecs_timeout, true);
	SOCKET old_socket = socket;
	socket = INVALID_SOCKET;
	if(old_socket != INVALID_SOCKET) {
		SLOG("Socket::Data::CloseRaw(" << (int)old_socket << ")");
		int res;
#if defined(PLATFORM_WIN32)
		res = closesocket(old_socket);
#elif defined(PLATFORM_POSIX)
		res = close(old_socket);
#else
#error Unsupported platform
#endif
		if(res && !IsError()) {
			SetSockError("close");
			ok = false;
		}
	}
	SLOG("//Socket::Data::CloseRaw, ok = " << ok);
	return ok;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:25,代码来源:socket.cpp

示例2: Error

void CGCode3DParser::M26Command()
{
	// set sd pos

	if (!GetExecutingFile() || CControl::GetInstance()->PrintFromSDRunnding())
	{
		Error(MESSAGE_PARSER3D_NO_FILE_SELECTED);
		return;
	}

	if (_reader->SkipSpacesToUpper() == 'S')
	{
		_reader->GetNextChar();
		_state._printFilePos = GetUInt32();
		_state._printFileLine = 1;					// TO DO => count line 
		if (IsError()) return;

		GetExecutingFile().seek(_state._printFilePos);
	}
	else if (_reader->GetCharToUpper() == 'L')
	{
		_reader->GetNextChar();
		unsigned long lineNr = GetUInt32();
		if (IsError()) return;

		if (lineNr < 1)
		{
			Error(MESSAGE_PARSER3D_LINE_SEEK_ERROR);
			return;
		}

		GetExecutingFile().seek(0);

		for (unsigned long line = 1; line < lineNr; line++)
		{
			// read line until \n
			char ch;
			do
			{
				if (GetExecutingFile().available() == 0)
				{
					Error(MESSAGE_PARSER3D_LINE_SEEK_ERROR);
					return;
				}

				ch = GetExecutingFile().read();
			} 
			while (ch != '\n');
		}
		
		_state._printFileLine = lineNr;
		_state._printFilePos = GetExecutingFile().position();
	}
}
开发者ID:aiten,项目名称:CNCLib,代码行数:54,代码来源:GCode3DParser.cpp

示例3: while

void EzSockets::update()
{
	if (IsError()) //If socket is in error, don't bother.
		return;
	
	while (CanRead() && !IsError()) //Check for Reading
		if (pUpdateRead() < 1)
			break;
	
	if (CanWrite() && (outBuffer.length()>0))
		pUpdateWrite();
}
开发者ID:geekmaster,项目名称:stepmania-3.9,代码行数:12,代码来源:ezsockets.cpp

示例4: Seek

void FNameTableArchiveReader::Seek( int64 InPos )
{
    if (!IsError())
    {
        Reader.Seek( InPos );
    }
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:7,代码来源:NameTableArchive.cpp

示例5: Serialize

void FNameTableArchiveReader::Serialize( void* V, int64 Length )
{
    if (!IsError())
    {
        Reader.Serialize( V, Length );
    }
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:7,代码来源:NameTableArchive.cpp

示例6: switch

bool CAddModuleSession::OnProcessMessage (const SArchonMessage &Msg)

//	OnProcessMessage
//
//	Process a response

	{
	switch (m_iState)
		{
		case stateWaitForMsg:
			{
			if (IsError(Msg))
				{
				SendMessageReplyError(Msg.sMsg, Msg.dPayload.GetElement(0));
				return false;
				}

			SendMessageReply(MSG_OK);
			return false;
			}

		default:
			return false;
		}
	}
开发者ID:gmoromisato,项目名称:Hexarc,代码行数:25,代码来源:MsgAddModule.cpp

示例7: Print

CString CCInteger::Print (CCodeChain *pCC, DWORD dwFlags)

//	Print
//
//	Returns a text representation of this item

	{
	//	If this is an error code, translate it

	if (IsError())
		{
		switch (m_iValue)
			{
			case CCRESULT_NOTFOUND:
				return strPatternSubst(LITERAL("[%d] Item not found."), m_iValue);

			case CCRESULT_CANCEL:
				return strPatternSubst(LITERAL("[%d] Operation canceled."), m_iValue);

			case CCRESULT_DISKERROR:
				return strPatternSubst(LITERAL("[%d] Disk error."), m_iValue);

			default:
				return strPatternSubst(LITERAL("[%d] Unknown error."), m_iValue);
			}
		}

	//	Otherwise, just print the integer value

	else
		return strFromInt(m_iValue, TRUE);
	}
开发者ID:Sdw195,项目名称:Transcendence,代码行数:32,代码来源:CCInteger.cpp

示例8: CPLError

bool OGRCouchDBDataSource::IsOK(json_object* poAnswerObj,
                                const char* pszErrorMsg)
{
    if ( poAnswerObj == NULL ||
        !json_object_is_type(poAnswerObj, json_type_object) )
    {
        CPLError(CE_Failure, CPLE_AppDefined, "%s",
                 pszErrorMsg);

        return false;
    }

    json_object* poOK = CPL_json_object_object_get(poAnswerObj, "ok");
    if ( !poOK )
    {
        IsError(poAnswerObj, pszErrorMsg);

        return false;
    }

    const char* pszOK = json_object_get_string(poOK);
    if ( !pszOK || !CPLTestBool(pszOK) )
    {
        CPLError(CE_Failure, CPLE_AppDefined, "%s", pszErrorMsg);

        return false;
    }

    return true;
}
开发者ID:Mavrx-inc,项目名称:gdal,代码行数:30,代码来源:ogrcouchdbdatasource.cpp

示例9: SyncPos

bool BlockStream::SyncPos()
{
	if(IsError())
		return false;
	SetPos(GetPos());
	return SyncPage();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:BlockStream.cpp

示例10: Serialize

void FNameTableArchiveReader::Serialize( void* V, int64 Length )
{
	if (FileAr && !IsError())
	{
		FileAr->Serialize( V, Length );
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:7,代码来源:NameTableArchive.cpp

示例11: Seek

void FNameTableArchiveReader::Seek( int64 InPos )
{
	if (FileAr && !IsError())
	{
		FileAr->Seek( InPos );
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:7,代码来源:NameTableArchive.cpp

示例12:

ThemeManager::ThemeManager(FAContext *pContext)
{
    char   szThemePath[_MAX_PATH];
    uint32 len = _MAX_PATH;
    Error eRet;

    m_pContext = pContext;
    m_oCurrentTheme = "";
    m_bDevelTheme = false;

    szThemePath[0] = 0;
    eRet = pContext->prefs->GetPrefString(kThemePathPref, szThemePath, &len);
    if (IsError(eRet) || strlen(szThemePath) == 0) {
        m_oCurrentTheme = BRANDING_DEFAULT_THEME;
    }
    else {
        struct stat buf;

        m_oCurrentTheme = szThemePath;
        if (stat(szThemePath, &buf) == 0 && S_ISDIR(buf.st_mode)) {
            m_bDevelTheme = true; 
            m_oDevelTheme = m_oCurrentTheme;
            m_oCurrentTheme = THEME_IN_DEVEL;
        }
    }
}
开发者ID:pontocom,项目名称:opensdrm,代码行数:26,代码来源:ThemeManager.cpp

示例13: Scan

Value ConvertDate::Scan(const Value& text) const {
	Value v = UPP::Scan(DATE_V, text, defaultval);
	if(IsError(v)) return v;
	if(IsNull(v)) return notnull ? NotNullError() : v;
	Date m = v;
	if(m >= minval && m <= maxval) return v;
	return ErrorValue(t_("Date must be between ") + UPP::Format(minval) + t_("range\v and ") + UPP::Format(maxval) + ".");
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:8,代码来源:Convert.cpp

示例14: _Put

void BlockStream::_Put(int c) {
	if(!IsOpen()) return;
	if(IsError() || !SyncPos())
		ptr = buffer;
	wrlim = buffer + pagesize;
	pagedirty = true;
	*ptr++ = c;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:8,代码来源:BlockStream.cpp

示例15: ParseJson

static kbool_t ParseJson(KonohaContext *kctx, struct JsonBuf *jsonbuf, const char *text, size_t length, KTraceInfo *trace)
{
	JSON json = parseJSON((JSONMemoryPool *)(JSONAPI JsonHandler), text, text + length);
	if(IsError(json.val)) {
		KLIB KRuntime_raise(kctx, KException_("InvalidJsonText"), SoftwareFault, NULL, trace->baseStack);
	}
	jsonbuf->json_i = json.bits;
	return jsonbuf->json_i != 0;
}
开发者ID:stadaki,项目名称:konoha3,代码行数:9,代码来源:Json.c


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