本文整理汇总了C++中poco_check_ptr函数的典型用法代码示例。如果您正苦于以下问题:C++ poco_check_ptr函数的具体用法?C++ poco_check_ptr怎么用?C++ poco_check_ptr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了poco_check_ptr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: poco_check_ptr
int TextConverter::convert(const void* source, int length, std::string& destination, Transform trans)
{
poco_check_ptr (source);
int errors = 0;
const unsigned char* it = (const unsigned char*) source;
const unsigned char* end = (const unsigned char*) source + length;
unsigned char buffer[TextEncoding::MAX_SEQUENCE_LENGTH];
while (it < end)
{
int n = _inEncoding.queryConvert(it, 1);
int uc;
int read = 1;
while (-1 > n && (end - it) >= -n)
{
read = -n;
n = _inEncoding.queryConvert(it, read);
}
if (-1 > n)
{
it = end;
}
else
{
it += read;
}
if (-1 >= n)
{
uc = _defaultChar;
++errors;
}
else
{
uc = n;
}
uc = trans(uc);
n = _outEncoding.convert(uc, buffer, sizeof(buffer));
if (n == 0) n = _outEncoding.convert(_defaultChar, buffer, sizeof(buffer));
poco_assert (n <= sizeof(buffer));
destination.append((const char*) buffer, n);
}
return errors;
}
开发者ID:Victorcasas,项目名称:georest,代码行数:48,代码来源:TextConverter.cpp
示例2: handleScope
v8::Handle<v8::ObjectTemplate> ServiceListenerWrapper::objectTemplate(v8::Isolate* pIsolate)
{
v8::EscapableHandleScope handleScope(pIsolate);
Poco::JS::Core::PooledIsolate* pPooledIso = Poco::JS::Core::PooledIsolate::fromIsolate(pIsolate);
poco_check_ptr (pPooledIso);
v8::Persistent<v8::ObjectTemplate>& pooledObjectTemplate(pPooledIso->objectTemplate("OSP.ServiceListener"));
if (pooledObjectTemplate.IsEmpty())
{
v8::Handle<v8::ObjectTemplate> objectTemplate = v8::ObjectTemplate::New(pIsolate);
objectTemplate->SetInternalFieldCount(1);
objectTemplate->Set(v8::String::NewFromUtf8(pIsolate, "dispose"), v8::FunctionTemplate::New(pIsolate, dispose));
pooledObjectTemplate.Reset(pIsolate, objectTemplate);
}
v8::Local<v8::ObjectTemplate> serviceListenerTemplate = v8::Local<v8::ObjectTemplate>::New(pIsolate, pooledObjectTemplate);
return handleScope.Escape(serviceListenerTemplate);
}
开发者ID:macchina-io,项目名称:macchina.io,代码行数:16,代码来源:ServiceListenerWrapper.cpp
示例3: if
void SocketChannel::init()
{
delete _pSocket;
if (isStream())
_pSocket = new Poco::Net::StreamSocket();
else if (isDatagram())
_pSocket = new Poco::Net::DatagramSocket();
else
throw IllegalStateException();
poco_check_ptr (_pSocket);
open();
if (!_pSocket) throw NullPointerException();
}
开发者ID:joobn72,项目名称:sandbox,代码行数:16,代码来源:SocketChannel.cpp
示例4: poco_check_ptr
void PriorityNotificationQueue::enqueueNotification(Notification::Ptr pNotification, int priority)
{
poco_check_ptr (pNotification);
FastMutex::ScopedLock lock(_mutex);
if (_waitQueue.empty())
{
_nfQueue.insert(NfQueue::value_type(priority, pNotification));
}
else
{
poco_assert_dbg(_nfQueue.empty());
WaitInfo* pWI = _waitQueue.front();
_waitQueue.pop_front();
pWI->pNf = pNotification;
pWI->nfAvailable.set();
}
}
开发者ID:as2120,项目名称:ZPoco,代码行数:17,代码来源:PriorityNotificationQueue.cpp
示例5: if
Poco::Net::Socket& NetChannel::newSocket()
{
delete _pSocket;
if (isStream())
_pSocket = new Poco::Net::StreamSocket();
else if (isDatagram())
_pSocket = new Poco::Net::DatagramSocket();
else
throw InvalidArgumentException();
poco_check_ptr (_pSocket);
open();
if (!_pSocket) throw NullPointerException();
return *_pSocket;
}
开发者ID:RangelReale,项目名称:sandbox,代码行数:17,代码来源:NetChannel.cpp
示例6: handleScope
v8::Handle<v8::ObjectTemplate> HTMLFormWrapper::objectTemplate(v8::Isolate* pIsolate)
{
v8::EscapableHandleScope handleScope(pIsolate);
Poco::JS::Core::PooledIsolate* pPooledIso = Poco::JS::Core::PooledIsolate::fromIsolate(pIsolate);
poco_check_ptr (pPooledIso);
v8::Persistent<v8::ObjectTemplate>& pooledObjectTemplate(pPooledIso->objectTemplate("Net.HTMLForm"));
if (pooledObjectTemplate.IsEmpty())
{
v8::Handle<v8::ObjectTemplate> objectTemplate = v8::ObjectTemplate::New();
objectTemplate->SetInternalFieldCount(1);
objectTemplate->Set(v8::String::NewFromUtf8(pIsolate, "hasField"), v8::FunctionTemplate::New(pIsolate, hasField));
objectTemplate->Set(v8::String::NewFromUtf8(pIsolate, "getField"), v8::FunctionTemplate::New(pIsolate, getField));
pooledObjectTemplate.Reset(pIsolate, objectTemplate);
}
v8::Local<v8::ObjectTemplate> formTemplate = v8::Local<v8::ObjectTemplate>::New(pIsolate, pooledObjectTemplate);
return handleScope.Escape(formTemplate);
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:17,代码来源:HTMLFormWrapper.cpp
示例7: poco_check_ptr
void DOMWriter::writeNode(XMLByteOutputStream& ostr, const Node* pNode)
{
poco_check_ptr (pNode);
bool isFragment = pNode->nodeType() != Node::DOCUMENT_NODE;
XMLWriter writer(ostr, _options, _encodingName, _pTextEncoding);
writer.setNewLine(_newLine);
DOMSerializer serializer;
serializer.setContentHandler(&writer);
serializer.setDTDHandler(&writer);
serializer.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<LexicalHandler*>(&writer));
if (isFragment) writer.startFragment();
serializer.serialize(pNode);
if (isFragment) writer.endFragment();
}
开发者ID:Victorcasas,项目名称:georest,代码行数:17,代码来源:DOMWriter.cpp
示例8: handleScope
v8::Handle<v8::ObjectTemplate> TimerWrapper::objectTemplate(v8::Isolate* pIsolate)
{
v8::EscapableHandleScope handleScope(pIsolate);
Poco::JS::Core::PooledIsolate* pPooledIso = Poco::JS::Core::PooledIsolate::fromIsolate(pIsolate);
poco_check_ptr (pPooledIso);
v8::Persistent<v8::ObjectTemplate>& pooledObjectTemplate(pPooledIso->objectTemplate("Core.Timer"));
if (pooledObjectTemplate.IsEmpty())
{
v8::Handle<v8::ObjectTemplate> objectTemplate = v8::ObjectTemplate::New();
objectTemplate->SetInternalFieldCount(1);
objectTemplate->SetAccessor(v8::String::NewFromUtf8(pIsolate, "cancelled"), cancelled);
objectTemplate->Set(v8::String::NewFromUtf8(pIsolate, "cancel"), v8::FunctionTemplate::New(pIsolate, cancel));
pooledObjectTemplate.Reset(pIsolate, objectTemplate);
}
v8::Local<v8::ObjectTemplate> timerTemplate = v8::Local<v8::ObjectTemplate>::New(pIsolate, pooledObjectTemplate);
return handleScope.Escape(timerTemplate);
}
开发者ID:hongweijia,项目名称:macchina.io,代码行数:17,代码来源:TimerWrapper.cpp
示例9: poco_check_ptr
const std::string ChildrenFirstTraverse::next(Stack* itStack, bool* isFinished)
{
// pointer mustn't point to NULL and iteration mustn't be finished
poco_check_ptr(isFinished);
poco_assert(!(*isFinished));
std::stack<DirectoryIterator> it;
//_depthDeterminer(it);
// go deeper into not empty directory
// (if depth limit allows)
bool isDepthLimitReached = isFiniteDepth() && _depthDeterminer(*itStack) >= _maxDepth;
if (!isDepthLimitReached && isDirectory(*itStack->top()))
{
DirectoryIterator child_it(itStack->top().path());
// check if directory is empty
if (child_it != _itEnd)
{
itStack->push(child_it);
return child_it->path();
}
}
++(itStack->top());
poco_assert(!itStack->empty());
// return up until there isn't right sibling
while (itStack->top() == _itEnd)
{
itStack->pop();
// detect end of traversal
if (itStack->empty())
{
*isFinished = true;
return _itEnd->path();
}
else
{
++(itStack->top());
}
}
return itStack->top()->path();
}
开发者ID:12307,项目名称:poco,代码行数:46,代码来源:DirectoryIteratorStrategy.cpp
示例10: poco_assert
int SecureSocketImpl::completeHandshake()
{
poco_assert (_pSocket->initialized());
poco_check_ptr (_pSSL);
int rc;
do
{
rc = SSL_do_handshake(_pSSL);
}
while (rc <= 0 && _pSocket->lastError() == POCO_EINTR);
if (rc <= 0)
{
return handleError(rc);
}
_needHandshake = false;
return rc;
}
开发者ID:JerkWisdom,项目名称:zpublic,代码行数:18,代码来源:SecureSocketImpl.cpp
示例11: _id
Bundle::Bundle(int id, BundleLoader& loader, BundleStorage::Ptr pStorage, const LanguageTag& language):
_id(id),
_state(BUNDLE_INSTALLED),
_loader(loader),
_pStorage(pStorage),
_language(language),
_pProperties(new BundleProperties),
_pActivator(0)
{
poco_check_ptr (_pStorage);
loadManifest();
loadProperties();
_name = _pProperties->expand(_pManifest->name());
_vendor = _pProperties->expand(_pManifest->vendor());
_copyright = _pProperties->expand(_pManifest->copyright());
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:18,代码来源:Bundle.cpp
示例12: _rc
TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, TCPServerParams::Ptr pParams):
_rc(1),
_pParams(pParams),
_currentThreads(0),
_totalConnections(0),
_currentConnections(0),
_maxConcurrentConnections(0),
_refusedConnections(0),
_stopped(false),
_pConnectionFactory(pFactory),
_threadPool(threadPool)
{
poco_check_ptr (pFactory);
if (!_pParams)
_pParams = new TCPServerParams;
if (_pParams->getMaxThreads() == 0)
_pParams->setMaxThreads(threadPool.capacity());
}
开发者ID:Akryllax,项目名称:extDB2,代码行数:20,代码来源:TCPServerDispatcher.cpp
示例13: poco_check_ptr
BinaryWriter& BinaryWriter::operator << (const char* value)
{
poco_check_ptr (value);
if (_pTextConverter)
{
std::string converted;
_pTextConverter->convert(value, static_cast<int>(std::strlen(value)), converted);
UInt32 length = (UInt32) converted.size();
write7BitEncoded(length);
_ostr.write(converted.data(), length);
}
else
{
UInt32 length = static_cast<UInt32>(std::strlen(value));
write7BitEncoded(length);
_ostr.write(value, length);
}
return *this;
}
开发者ID:Kampbell,项目名称:poco,代码行数:20,代码来源:BinaryWriter.cpp
示例14: poco_check_ptr
void Notifier::sqliteUpdateCallbackFn(void* pVal, int opCode, const char* pDB, const char* pTable, Poco::Int64 row)
{
poco_check_ptr(pVal);
Notifier* pV = reinterpret_cast<Notifier*>(pVal);
if (opCode == Utility::OPERATION_INSERT)
{
pV->_row = row;
pV->insert.notify(pV);
}
else if (opCode == Utility::OPERATION_UPDATE)
{
pV->_row = row;
pV->update.notify(pV);
}
else if (opCode == Utility::OPERATION_DELETE)
{
pV->_row = row;
pV->erase.notify(pV);
}
}
开发者ID:12307,项目名称:poco,代码行数:20,代码来源:Notifier.cpp
示例15: poco_check_ptr
void NodeAppender::appendChild(Node* newChild)
{
poco_check_ptr (newChild);
poco_assert (_pLast == 0 || _pLast->_pNext == 0);
if (static_cast<AbstractNode*>(newChild)->_pOwner != _pParent->_pOwner)
throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
if (newChild->nodeType() == Node::DOCUMENT_FRAGMENT_NODE)
{
AbstractContainerNode* pFrag = static_cast<AbstractContainerNode*>(newChild);
AbstractNode* pChild = pFrag->_pFirstChild;
if (pChild)
{
if (_pLast)
_pLast->_pNext = pChild;
else
_pParent->_pFirstChild = pChild;
while (pChild)
{
_pLast = pChild;
pChild->_pParent = _pParent;
pChild = pChild->_pNext;
}
pFrag->_pFirstChild = 0;
}
}
else
{
AbstractNode* pAN = static_cast<AbstractNode*>(newChild);
pAN->duplicate();
if (pAN->_pParent)
pAN->_pParent->removeChild(pAN);
pAN->_pParent = _pParent;
if (_pLast)
_pLast->_pNext = pAN;
else
_pParent->_pFirstChild = pAN;
_pLast = pAN;
}
}
开发者ID:Alcibiades586,项目名称:roadrunner,代码行数:41,代码来源:NodeAppender.cpp
示例16: rowCount
Row& RecordSet::row(std::size_t pos)
{
std::size_t rowCnt = rowCount();
if (0 == rowCnt || pos > rowCnt - 1)
throw RangeException("Invalid recordset row requested.");
RowMap::const_iterator it = _rowMap.find(pos);
Row* pRow = 0;
std::size_t columns = columnCount();
if (it == _rowMap.end())
{
if (_rowMap.size())
{
//reuse first row column names and sorting fields to save some memory
pRow = new Row(_rowMap.begin()->second->names(),
_rowMap.begin()->second->getSortMap(),
getRowFormatter());
for (std::size_t col = 0; col < columns; ++col)
pRow->set(col, value(col, pos));
}
else
{
pRow = new Row;
pRow->setFormatter(getRowFormatter());
for (std::size_t col = 0; col < columns; ++col)
pRow->append(metaColumn(static_cast<UInt32>(col)).name(), value(col, pos));
}
_rowMap.insert(RowMap::value_type(pos, pRow));
}
else
{
pRow = it->second;
poco_check_ptr (pRow);
}
return *pRow;
}
开发者ID:RobertAcksel,项目名称:poco,代码行数:39,代码来源:RecordSet.cpp
示例17: icompare
int icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, const std::string::value_type* ptr)
{
poco_check_ptr (ptr);
std::string::size_type sz = str.size();
if (pos > sz) pos = sz;
if (pos + n > sz) n = sz - pos;
std::string::const_iterator it = str.begin() + pos;
std::string::const_iterator end = str.begin() + pos + n;
while (it != end && *ptr)
{
std::string::value_type c1 = Ascii::toLower(*it);
std::string::value_type c2 = Ascii::toLower(*ptr);
if (c1 < c2)
return -1;
else if (c1 > c2)
return 1;
++it; ++ptr;
}
if (it == end)
return *ptr == 0 ? 0 : -1;
else
return 1;
}
开发者ID:jacklicn,项目名称:macchina.io,代码行数:24,代码来源:String.cpp
示例18: poco_check_ptr
Attr* Element::removeAttributeNode(Attr* oldAttr)
{
poco_check_ptr (oldAttr);
if (_pOwner->events())
dispatchAttrModified(oldAttr, MutationEvent::REMOVAL, oldAttr->getValue(), EMPTY_STRING);
if (oldAttr != _pFirstAttr)
{
Attr* pCur = _pFirstAttr;
while (pCur->_pNext != oldAttr) pCur = static_cast<Attr*>(pCur->_pNext);
if (pCur)
{
pCur->_pNext = static_cast<Attr*>(pCur->_pNext->_pNext);
}
else throw DOMException(DOMException::NOT_FOUND_ERR);
}
else _pFirstAttr = static_cast<Attr*>(_pFirstAttr->_pNext);
oldAttr->_pNext = 0;
oldAttr->_pParent = 0;
oldAttr->autoRelease();
return oldAttr;
}
开发者ID:119,项目名称:vdc,代码行数:24,代码来源:Element.cpp
示例19: poco_check_ptr
HostEntry::HostEntry(struct hostent* entry)
{
poco_check_ptr (entry);
_name = entry->h_name;
char** alias = entry->h_aliases;
if (alias)
{
while (*alias)
{
_aliases.push_back(std::string(*alias));
++alias;
}
}
char** address = entry->h_addr_list;
if (address)
{
while (*address)
{
_addresses.push_back(IPAddress(*address, entry->h_length));
++address;
}
}
}
开发者ID:elix22,项目名称:android-cplus-lib,代码行数:24,代码来源:HostEntry.cpp
示例20: poco_check_ptr
int UTF8::icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, const std::string::value_type* ptr)
{
poco_check_ptr (ptr);
std::string::size_type sz = str.size();
if (pos > sz) pos = sz;
if (pos + n > sz) n = sz - pos;
TextIterator uit(str.begin() + pos, str.begin() + pos + n, utf8);
TextIterator uend(str.begin() + pos + n);
while (uit != uend && *ptr)
{
int c1 = Unicode::toLower(*uit);
int c2 = Unicode::toLower(*ptr);
if (c1 < c2)
return -1;
else if (c1 > c2)
return 1;
++uit; ++ptr;
}
if (uit == uend)
return *ptr == 0 ? 0 : -1;
else
return 1;
}
开发者ID:babafall,项目名称:Sogeti-MasterThesis-CrossPlatformMobileDevelopment,代码行数:24,代码来源:UTF8String.cpp
注:本文中的poco_check_ptr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论