本文整理汇总了C++中utf8_string::end方法的典型用法代码示例。如果您正苦于以下问题:C++ utf8_string::end方法的具体用法?C++ utf8_string::end怎么用?C++ utf8_string::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utf8_string
的用法示例。
在下文中一共展示了utf8_string::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse_variation
static void parse_variation( utf8_string<zstring const> const &u_picture_str,
utf8_string<zstring const>::const_iterator *u,
picture *pic, QueryLoc const &loc ) {
utf8_string<zstring const>::const_iterator &v = *u;
if ( v == u_picture_str.end() )
return;
if ( *v == '(' ) {
//
// XQuery F&O 3.0 4.6.1: The string of characters between the parentheses,
// if present, is used to select between other possible variations of
// cardinal or ordinal numbering sequences. The interpretation of this
// string is implementation-defined. No error occurs if the implementation
// does not define any interpretation for the defined string.
//
utf8_string<zstring> u_pic_co_string( pic->modifier.co_string );
while ( true ) {
if ( ++v == u_picture_str.end() )
throw XQUERY_EXCEPTION(
err::FODF1310,
ERROR_PARAMS( *u_picture_str.get(), ZED( CharExpected_3 ), ')' ),
ERROR_LOC( loc )
);
unicode::code_point const cp = *v;
if ( cp == ')' )
break;
u_pic_co_string += cp;
}
++v;
}
}
示例2: prepare_frame
binary_string_ptr prepare_frame(frame::opcode::value opcode,
bool mask,
const utf8_string& payload) {
if (opcode != frame::opcode::TEXT) {
// TODO: hybi_legacy doesn't allow non-text frames.
throw;
}
// TODO: mask = ignore?
// TODO: utf8 validation on payload.
binary_string_ptr response(new binary_string(payload.size()+2));
(*response)[0] = 0x00;
std::copy(payload.begin(),payload.end(),response->begin()+1);
(*response)[response->size()-1] = 0xFF;
return response;
}