📄 wy__scanum.h
字号:
/* Copyright is licensed under GNU LGPL. by I.J.Wang 2006 Header only for inclusion*/#ifndef WY__SCAN_NUM_H__#define WY__SCAN_NUM_H__// [Benefit] Make usage like sscanf(text,"%f %ld %d %x",..) easier//template <typename ValueType>WyRet wy__scanum(ValueType& value, size_t& idx, const WyCSeg& text, const int& radix){ static const WyCSeg Blanks=" \f\n\r\t\v"; const char* endptr; size_t fidx=idx; ValueType res; if(text.findc_not(&fidx,fidx,Blanks)==false) { WY_RETURN( Wym_ENOENT ); // all blanks } const WyRet r=Wy::_strnum(res,&endptr,text.cseg(fidx),radix); if((r==Ok)||(r==Wym_EBADMSG)) { idx=endptr-text.begin(); value=res; return(Ok); } WY_RETURN(r);};#endif // end WY__SCAN_NUM_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -