本文整理汇总了C++中mongoParser::skip方法的典型用法代码示例。如果您正苦于以下问题:C++ mongoParser::skip方法的具体用法?C++ mongoParser::skip怎么用?C++ mongoParser::skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mongoParser
的用法示例。
在下文中一共展示了mongoParser::skip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertRequest
INT32 getMoreCommand::convertRequest( mongoParser &parser, msgBuffer &sdbMsg )
{
INT32 rc = SDB_OK ;
INT32 nToReturn = -1 ;
INT64 cursorid = 0 ;
MsgHeader *header = NULL ;
MsgOpGetMore *more = NULL ;
parser.opType = OP_GETMORE ;
sdbMsg.reverse( sizeof ( MsgOpGetMore ) ) ;
sdbMsg.advance( sizeof ( MsgOpGetMore ) ) ;
header = ( MsgHeader * )sdbMsg.data() ;
header->opCode = MSG_BS_GETMORE_REQ ;
header->TID = 0 ;
header->routeID.value = 0 ;
header->requestID = parser.id ;
more = ( MsgOpGetMore * )sdbMsg.data() ;
parser.skip( parser.nsLen + 1 ) ;
parser.readNumber( sizeof( INT32 ), ( CHAR * )&nToReturn ) ;
more->numToReturn = (0 == nToReturn ? -1 : nToReturn) ;
if ( 0 > nToReturn )
{
more->numToReturn = -nToReturn ;
}
parser.readNumber( sizeof( SINT64 ), ( CHAR * )&cursorid ) ;
more->contextID = cursorid - 1;
sdbMsg.doneLen() ;
return rc ;
}
示例2: convertRequest
INT32 getMoreCommand::convertRequest( mongoParser &parser,
std::vector<msgBuffer*> &sdbMsgs )
{
INT32 rc = SDB_OK ;
INT32 nToReturn = 0 ;
INT64 cursorid = 0 ;
MsgHeader *header = NULL ;
MsgOpGetMore *more = NULL ;
msgBuffer *sdbMsg = SDB_OSS_NEW msgBuffer() ;
if ( NULL == sdbMsg )
{
rc = SDB_OOM ;
goto error ;
}
parser.opType = OP_GETMORE ;
sdbMsg->reverse( sizeof ( MsgOpGetMore ) ) ;
sdbMsg->advance( sizeof ( MsgOpGetMore ) ) ;
header = ( MsgHeader * )sdbMsg->data() ;
header->opCode = MSG_BS_GETMORE_REQ ;
header->TID = 0 ;
header->routeID.value = 0 ;
header->requestID = parser.id ;
more = ( MsgOpGetMore * )sdbMsg->data() ;
parser.skip( parser.nsLen + 1 ) ;
parser.readNumber( sizeof( INT32 ), ( CHAR * )&nToReturn ) ;
more->numToReturn = nToReturn ;
parser.readNumber( sizeof( SINT64 ), ( CHAR * )&cursorid ) ;
more->contextID = cursorid ;
header->messageLength = sdbMsg->size() ;
sdbMsgs.push_back( sdbMsg ) ;
done:
return rc ;
error:
goto done ;
}