本文整理汇总了C++中IsError函数的典型用法代码示例。如果您正苦于以下问题:C++ IsError函数的具体用法?C++ IsError怎么用?C++ IsError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Precache
bool FNameTableArchiveReader::Precache( int64 PrecacheOffset, int64 PrecacheSize )
{
if (FileAr && !IsError())
{
return FileAr->Precache( PrecacheOffset, PrecacheSize );
}
return false;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:9,代码来源:NameTableArchive.cpp
示例17: SetSize
void BlockStream::SetSize(int64 size)
{
if(IsError() || !IsOpen()) return;
int64 pos = GetPos();
Flush();
Seek(0);
SetStreamSize(size);
streamsize = size;
Seek(pos < size ? pos : size);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:10,代码来源:BlockStream.cpp
示例18: Tell
bool FNameTableArchiveReader::SerializeNameMap()
{
int64 NameOffset = 0;
*this << NameOffset;
if (IsError() || NameOffset > TotalSize())
{
// The file was corrupted. Return false to fail to load the cache an thus regenerate it.
return false;
}
if( NameOffset > 0 )
{
int64 OriginalOffset = Tell();
Seek( NameOffset );
int32 NameCount = 0;
*this << NameCount;
if (IsError())
{
return false;
}
for ( int32 NameMapIdx = 0; NameMapIdx < NameCount; ++NameMapIdx )
{
// Read the name entry from the file.
FNameEntrySerialized NameEntry(ENAME_LinkerConstructor);
*this << NameEntry;
if (IsError())
{
return false;
}
NameMap.Add(FName(NameEntry));
}
Seek( OriginalOffset );
}
return true;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:43,代码来源:NameTableArchive.cpp
示例19: ErrorMIValue
MIValue const &MIValue::Get(int i) const
{
if(IsError())
return *this;
if(type == MIArray)
return array[i];
if(type == MITuple)
return tuple[i];
return ErrorMIValue("Not an Array value type");
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:10,代码来源:MIValue.cpp
示例20: ToString
wxString wxFileSystemWatcherEvent::ToString() const
{
if (IsError())
{
return wxString::Format("FSW_EVT type=%d (%s) message='%s'", m_changeType,
GetFSWEventChangeTypeName(m_changeType), GetErrorDescription());
}
return wxString::Format("FSW_EVT type=%d (%s) path='%s'", m_changeType,
GetFSWEventChangeTypeName(m_changeType), GetPath().GetFullPath());
}
开发者ID:AmbientMalice,项目名称:pcsx2,代码行数:10,代码来源:fswatchercmn.cpp
注:本文中的IsError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论