本文整理汇总了C++中URI::set_opaque_part方法的典型用法代码示例。如果您正苦于以下问题:C++ URI::set_opaque_part方法的具体用法?C++ URI::set_opaque_part怎么用?C++ URI::set_opaque_part使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::set_opaque_part方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XQUERY_EXCEPTION
bool
SerializeURIIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
store::Item_t lItemURI, lItemKey;
zorba::zstring lStrValue, lStrKey, lStrRes;
store::Iterator_t lKeys;
URI uri = URI();
int lIntPort = 0;
bool lHasSchemeField, lHasOpaqueField, lHasNotOpaqueField;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
consumeNext(lItemURI, theChildren[0].getp(), planState);
lHasSchemeField = lHasOpaqueField = lHasNotOpaqueField = false;
if(lItemURI->isObject()) {
lKeys = lItemURI->getObjectKeys();
if(!lKeys.isNull()){
lKeys->open();
while(lKeys->next(lItemKey)){
lStrKey = lItemKey->getStringValue();
lStrValue = lItemURI->getObjectValue(lItemKey)->getStringValue();
if(lStrKey == SCHEME_NAME && !lStrValue.empty()){
uri.set_scheme(lStrValue);
lHasSchemeField = true;
} else if(lStrKey == OPAQUE_PART_NAME && !lStrValue.empty()){
uri.set_opaque_part(lStrValue);
lHasOpaqueField = true;
} else if(lStrKey == AUTHORITY_NAME && !lStrValue.empty()){
uri.set_reg_based_authority(lStrValue);
lHasNotOpaqueField = true;
} else if(lStrKey == USER_INFO_NAME && !lStrValue.empty()){
uri.set_user_info(lStrValue);
lHasNotOpaqueField = true;
} else if(lStrKey == HOST_NAME && !lStrValue.empty()){
uri.set_host(lStrValue);
lHasNotOpaqueField = true;
} else if(lStrKey == PORT_NAME){
sscanf(lStrValue.str().c_str(), "%d", &lIntPort);
if(lIntPort != 0){
uri.set_port(lIntPort);
lHasNotOpaqueField = true;
}
} else if(lStrKey == PATH_NAME && !lStrValue.empty()){
uri.set_path(lStrValue);
lHasNotOpaqueField = true;
} else if(lStrKey == QUERY_NAME){
uri.set_query(lStrValue);
lHasNotOpaqueField = true;
} else if(lStrKey == FRAGMENT_NAME){
uri.set_fragment(lStrValue);
}
}
lKeys->close();
}
}
// check for errors
if(lHasOpaqueField && lHasNotOpaqueField)
{
throw XQUERY_EXCEPTION(
zuri::OPAQUE_COMB_NOT_VALID,
ERROR_LOC( loc )
);
}
if(lHasOpaqueField && !lHasSchemeField)
{
throw XQUERY_EXCEPTION(
zuri::OPAQUE_WITHOUT_SCHEME,
ERROR_LOC( loc )
);
}
if(lHasSchemeField && !uri.get_encoded_path().empty() && (uri.get_encoded_path().substr(0,1) != "/"))
{
throw XQUERY_EXCEPTION(
zuri::INVALID_ABSOLUTE_PATH,
ERROR_LOC( loc )
);
}
lStrRes = zorba::zstring(uri.toString());
STACK_PUSH(GENV_ITEMFACTORY->createString(result, lStrRes), state );
STACK_END (state);
}