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

C++ poco_assert_dbg函数代码示例

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

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



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

示例1: poco_assert_dbg

int StreamConverterBuf::writeToDevice(char c)
{
	poco_assert_dbg (_pOstr);

	if (_sequenceLength == 0)
	{
		int n = _inEncoding.characterMap()[(unsigned char) c];
		if (n == -1)
		{
			++_errors;
			return -1;
		}
		_buffer[0] = (unsigned char) c;
		_sequenceLength = n < 0 ? -n : 1;
		_pos = 1;
	}
	else _buffer[_pos++] = (unsigned char) c;
	if (_pos == _sequenceLength)
	{
		int uc = _inEncoding.convert(_buffer);
		if (uc == -1)
		{
			++_errors; 
			return -1;
		}
		int n = _outEncoding.convert(uc, _buffer, sizeof(_buffer));
		if (n == 0) n = _outEncoding.convert(_defaultChar, _buffer, sizeof(_buffer));
		poco_assert_dbg (n <= sizeof(_buffer));
		_pOstr->write((char*) _buffer, n);
		_sequenceLength = 0;
		_pos = 0;
	}
	return charToInt(c);
}
开发者ID:carvalhomb,项目名称:tsmells,代码行数:34,代码来源:StreamConverter.cpp


示例2: poco_assert_dbg

int StreamConverterBuf::writeToDevice(char c)
{
	poco_assert_dbg (_pOstr);

	_buffer[_pos++] = (unsigned char) c;
	if (_sequenceLength == 0 || _sequenceLength == _pos)
	{
		int n = _inEncoding.queryConvert(_buffer, _pos);
		if (-1 <= n)
		{
			int uc = n;
			if (-1 == n)
			{
				++_errors;
				return -1;
			}
			int n1 = _outEncoding.convert(uc, _buffer, sizeof(_buffer));
			if (n1 == 0) n1 = _outEncoding.convert(_defaultChar, _buffer, sizeof(_buffer));
			poco_assert_dbg (n1 <= sizeof(_buffer));
			_pOstr->write((char*) _buffer, n1);
			_sequenceLength = 0;
			_pos = 0;
		}
		else
		{
			_sequenceLength = -n;
		}
	}

	return charToInt(c);
}
开发者ID:sdottaka,项目名称:winmerge-v2,代码行数:31,代码来源:StreamConverter.cpp


示例3: includeFile

CodeGenerator::FwdDecl::FwdDecl(const std::string& inc, const std::string& cN, const std::string& ns):
	includeFile(inc),
	className(cN),
	fullNameSpace(ns)
{
	poco_assert_dbg (!includeFile.empty());
	poco_assert_dbg (!className.empty());
}
开发者ID:jacklicn,项目名称:macchina.io,代码行数:8,代码来源:CodeGenerator.cpp


示例4: poco_assert_dbg

std::string URIUtility::createURIPath(const Identifiable::ObjectId& oid, const Identifiable::TypeId& tid, const std::string& protocol)
{
	poco_assert_dbg(!oid.empty());
	poco_assert_dbg(!tid.empty());
	poco_assert_dbg(!protocol.empty());
	std::string result("/");
	result += protocol;
	result += '/';
	result += tid;
	result += '/';
	result += oid;
	return result;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:13,代码来源:URIUtility.cpp


示例5: _forceZip64

ZipLocalFileHeader::ZipLocalFileHeader(std::istream& inp, bool assumeHeaderRead, ParseCallback& callback):
    _forceZip64(false),
    _rawHeader(),
    _startPos(inp.tellg()),
    _endPos(-1),
    _fileName(),
    _lastModifiedAt(),
    _extraField(),
    _crc32(0),
    _compressedSize(0),
    _uncompressedSize(0)
{
    poco_assert_dbg( (EXTRA_FIELD_POS+EXTRA_FIELD_LENGTH) == FULLHEADER_SIZE);

    if (assumeHeaderRead)
        _startPos -= ZipCommon::HEADER_SIZE;

    parse(inp, assumeHeaderRead);

    bool ok = callback.handleZipEntry(inp, *this);

    if (ok)
    {
        if (searchCRCAndSizesAfterData())
        {
            char header[ZipCommon::HEADER_SIZE]={'\x00', '\x00', '\x00', '\x00'};
            inp.read(header, ZipCommon::HEADER_SIZE);
            if (std::memcmp(header, ZipDataInfo64::HEADER, sizeof(header)) == 0) 
            {
                ZipDataInfo64 nfo(inp, true);
                setCRC(nfo.getCRC32());
                setCompressedSize(nfo.getCompressedSize());
                setUncompressedSize(nfo.getUncompressedSize());
            } 
            else 
            {
                ZipDataInfo nfo(inp, true);
                setCRC(nfo.getCRC32());
                setCompressedSize(nfo.getCompressedSize());
                setUncompressedSize(nfo.getUncompressedSize());
            }
        }
    }
    else
    {
        poco_assert_dbg(!searchCRCAndSizesAfterData());
        ZipUtil::sync(inp);
    }
    _endPos = _startPos + getHeaderSize() + _compressedSize; // exclude the data block!
}
开发者ID:RobertoMalatesta,项目名称:of-1,代码行数:50,代码来源:ZipLocalFileHeader.cpp


示例6: addWriter

bool RWLockImpl::tryWriteLockImpl()
{
	addWriter();
	HANDLE h[2];
	h[0] = _mutex;
	h[1] = _writeEvent;
	switch (WaitForMultipleObjects(2, h, TRUE, 1))
	{
	case WAIT_OBJECT_0:
	case WAIT_OBJECT_0 + 1:
		--_writersWaiting;
		++_readers;
		++_writers;
		ResetEvent(_readEvent);
		ResetEvent(_writeEvent);
		ReleaseMutex(_mutex);
		poco_assert_dbg(_writers == 1);
		return true;
	case WAIT_TIMEOUT:
		removeWriter();
		return false;
	default:
		removeWriter();
		throw SystemException("cannot lock reader/writer lock");
	}
}
开发者ID:119,项目名称:vdc,代码行数:26,代码来源:RWLock_WIN32.cpp


示例7: InvalidAccessException

void SessionImpl::open(const std::string& connect)
{
	if (connect != connectionString())
	{
		if (isConnected())
			throw InvalidAccessException("Session already connected");

		if (!connect.empty())
			setConnectionString(connect);
	}

	poco_assert_dbg (!connectionString().empty());

	try
	{
		ActiveConnector connector(connectionString(), &_pDB);
		ActiveResult<int> result = connector.connect();
		if (!result.tryWait(getLoginTimeout() * 1000))
			throw ConnectionFailedException("Timed out.");

		int rc = result.data();
		if (rc != 0)
		{
			close();
			Utility::throwException(rc);
		}
	} 
	catch (SQLiteException& ex)
	{
		throw ConnectionFailedException(ex.displayText());
	}

	_connected = true;
}
开发者ID:RobertAcksel,项目名称:poco,代码行数:34,代码来源:SessionImpl.cpp


示例8: poco_assert_dbg

Var Var::parseObject(const std::string& val, std::string::size_type& pos)
{
	poco_assert_dbg (val[pos] == '{');
	++pos;
	skipWhiteSpace(val, pos);
	DynamicStruct aStruct;
	while (val[pos] != '}' && pos < val.size())
	{
		std::string key = parseString(val, pos);
		skipWhiteSpace(val, pos);
		if (val[pos] != ':')
			throw DataFormatException("Incorrect object, must contain: key : value pairs"); 
		++pos; // skip past :
		Var value = parse(val, pos);
		aStruct.insert(key, value);
		skipWhiteSpace(val, pos);
		if (val[pos] == ',')
		{
			++pos;
			skipWhiteSpace(val, pos);
		}
	}
	if (val[pos] != '}')
		throw DataFormatException("Unterminated object"); 
	++pos;
	return aStruct;
}
开发者ID:Chingliu,项目名称:poco,代码行数:27,代码来源:Var.cpp


示例9: poco_assert_dbg

bool FrameQueue::handleFrame(Connection::Ptr pConnection, Frame::Ptr pFrame)
{
	poco_assert_dbg (pConnection == _pConnection);

	if ((_frameType == 0 || pFrame->type() == _frameType) && pFrame->channel() == _channel)
	{
		{
			Poco::FastMutex::ScopedLock lock(_mutex);
			int rounds = 0;
			while (_queue.size() == MAX_QUEUE_SIZE && rounds < 100)
			{
				Poco::ScopedUnlock<Poco::FastMutex> unlock(_mutex);
				Poco::Thread::sleep(5);
				rounds++;
			}
			if (_queue.size() < MAX_QUEUE_SIZE)
			{
				_queue.push_back(pFrame);
				_sema.set();
				return true;
			}
		}
	}
	return false;
}
开发者ID:curiousTauseef,项目名称:macchina.io,代码行数:25,代码来源:FrameQueue.cpp


示例10: cKey

void ConfigurationMapper::enumerate(const std::string& key, Keys& range) const
{
	std::string cKey(key);
	if (!cKey.empty()) cKey += '.';
	std::string::size_type keyLen = cKey.length();
	if (keyLen < _toPrefix.length())
	{
		if (_toPrefix.compare(0, keyLen, cKey) == 0)
		{
			std::string::size_type pos = _toPrefix.find_first_of('.', keyLen);
			poco_assert_dbg(pos != std::string::npos);
			range.push_back(_toPrefix.substr(keyLen, pos - keyLen));
		}
	}
	else
	{
		std::string translatedKey;
		if (cKey == _toPrefix)
		{
			translatedKey = _fromPrefix;
			if (!translatedKey.empty())
				translatedKey.resize(translatedKey.length() - 1);
		}
		else translatedKey = translateKey(key);
		_pConfig->enumerate(translatedKey, range);
	}
}
开发者ID:beneon,项目名称:MITK,代码行数:27,代码来源:ConfigurationMapper.cpp


示例11: Array

void ParseHandler::startArray()
{
	Array::Ptr newArr = new Array();

	if ( _stack.empty() ) // The first array
	{
		_result = newArr;
	}
	else
	{
		Var parent = _stack.top();

		if ( parent.type() == typeid(Array::Ptr) )
		{
			Array::Ptr arr = parent.extract<Array::Ptr>();
			arr->add(newArr);
		}
		else if ( parent.type() == typeid(Object::Ptr) )
		{
			poco_assert_dbg(!_key.empty());
			Object::Ptr obj = parent.extract<Object::Ptr>();
			obj->set(_key, newArr);
			_key.clear();
		}
	}

	_stack.push(newArr);
}
开发者ID:12307,项目名称:poco,代码行数:28,代码来源:ParseHandler.cpp


示例12: init

std::string ZipUtil::fakeZLibInitString(ZipCommon::CompressionLevel cl)
{
	std::string init(2, ' ');

	// compression info:
	// deflate is used, bit 0-3: 0x08
	// dictionary size is always 32k: calc ld2(32k)-8 = ld2(2^15) - 8 = 15 - 8 = 7 --> bit 4-7: 0x70
	init[0] = '\x78';

	// now fake flags
	// bits 0-4 check bits: set them so that init[0]*256+init[1] % 31 == 0
	// bit 5: preset dictionary? always no for us, set to 0
	// bits 6-7: compression level: 00 very fast, 01 fast, 10 normal, 11 best
	if (cl == ZipCommon::CL_SUPERFAST)
		init[1] = '\x00';
	else if (cl == ZipCommon::CL_FAST)
		init[1] = '\x40';
	else if (cl == ZipCommon::CL_NORMAL)
		init[1] = '\x80';
	else
		init[1] = '\xc0';
	// now set the last 5 bits
	Poco::UInt16 tmpVal = ((Poco::UInt16)init[0])*256+((unsigned char)init[1]);
	char checkBits = (31 - (char)(tmpVal%31));
	init[1] |= checkBits; // set the lower 5 bits
	tmpVal = ((Poco::UInt16)init[0])*256+((unsigned char)init[1]);
	poco_assert_dbg ((tmpVal % 31) == 0);
	return init;
}
开发者ID:macchina-io,项目名称:macchina.io,代码行数:29,代码来源:ZipUtil.cpp


示例13: poco_assert_dbg

void MQFunctions::inq(MQHCONN conn, MQHOBJ obj, MQLONG selectorCount, MQLONG* selectors, MQLONG intAttrCount, MQLONG* intAttrs, MQLONG charAttrLength, PMQCHAR charAttrs, MQLONG* cc, MQLONG* rc)
{
	poco_assert_dbg(_inqFn != NULL);

	_inqFn(conn, obj, selectorCount, selectors, intAttrCount, intAttrs, charAttrLength, charAttrs, cc, rc);

	trace("", "MQINQ", cc, rc);
}
开发者ID:fbraem,项目名称:mqweb,代码行数:8,代码来源:MQFunctions.cpp


示例14: _entries

ZipArchive::ZipArchive(std::istream& in, ParseCallback& pc):
	_entries(),
	_infos(),
	_disks()
{
	poco_assert_dbg (in);
	parse(in, pc);
}
开发者ID:Chingliu,项目名称:poco,代码行数:8,代码来源:ZipArchive.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ poco_check_ptr函数代码示例发布时间:2022-05-30
下一篇:
C++ poco_assert函数代码示例发布时间: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