本文整理汇总了C++中__iostring::end方法的典型用法代码示例。如果您正苦于以下问题:C++ __iostring::end方法的具体用法?C++ __iostring::end怎么用?C++ __iostring::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类__iostring
的用法示例。
在下文中一共展示了__iostring::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: str_ite
void _STLP_CALL
__convert_float_buffer(__iostring const& str, __iowstring &out,
const ctype<wchar_t>& ct, wchar_t dot, bool __check_dot) {
wchar_t __static_buf[128];
wchar_t *__beg = __static_buf;
wchar_t *__end = __static_buf + (sizeof(__static_buf) / sizeof(wchar_t));
string::const_iterator str_ite(str.begin()), str_end(str.end());
wchar_t *__cur = __beg;
//First loop, check the dot char
if (__check_dot) {
while (str_ite != str_end) {
if (*str_ite != '.') {
*__cur = ct.widen(*str_ite);
} else {
*__cur = dot;
break;
}
++__cur;
if (__cur == __end) {
out.append(__beg, __cur);
__cur = __beg;
}
++str_ite;
}
} else {
if (str_ite != str_end) {
*__cur = ct.widen(*str_ite);
}
}
if (str_ite != str_end) {
++__cur;
++str_ite;
if (__cur == __end) {
out.append(__beg, __cur);
__cur = __beg;
}
//Second loop, dot has been found, no check anymore
while (str_ite != str_end) {
*__cur = ct.widen(*str_ite);
++__cur;
if (__cur == __end) {
out.append(__beg, __cur);
__cur = __beg;
}
++str_ite;
}
}
out.append(__beg, __cur);
}
示例2: find_if
size_t _STLP_CALL
__write_float(__iostring &buf, ios_base::fmtflags flags, int precision,
long double x) {
# ifdef USE_SPRINTF_INSTEAD
/* If we want 'abitrary' precision, we should use 'abitrary' buffer size
* below. - ptr
*/
char static_buf[128];
// char *static_buf = new char [128+precision];
char fmtbuf[64];
int i = fill_fmtbuf(fmtbuf, flags, 'L');
// snprintf(static_buf, 128+precision, fmtbuf, precision, x);
# ifndef N_PLAT_NLM
snprintf(ARRAY_AND_SIZE(static_buf), fmtbuf, precision, x);
# else
sprintf(static_buf, fmtbuf, precision, x);
# endif
// we should be able to return buf + sprintf(), but we do not trust'em...
buf = static_buf;
// delete [] static_buf;
return find_if(buf.begin(), buf.end(), GroupPos()) - buf.begin();
# else
char cvtbuf[NDIG+2];
char * bp;
int decpt, sign;
switch (flags & ios_base::floatfield) {
case ios_base::fixed:
bp = _Stl_qfcvtR(x, (min) (precision, MAXFCVT), &decpt, &sign, cvtbuf);
break;
case ios_base::scientific:
bp = _Stl_qecvtR(x, (min) (precision + 1, MAXECVT), &decpt, &sign, cvtbuf);
break;
default :
bp = _Stl_qecvtR(x, (min) (precision, MAXECVT), &decpt, &sign, cvtbuf);
break;
}
return __format_float(buf, bp, decpt, sign, x, flags, precision, true);
# endif /* USE_SPRINTF_INSTEAD */
}