• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setf函数的典型用法代码示例。如果您正苦于以下问题:C++ setf函数的具体用法?C++ setf怎么用?C++ setf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PrimeTable

 PrimeTable(T limit) {
     limit = (limit+31) / 32 * 32;
     array.resize(limit / 32, -1);
     setf(0); setf(1); T d, n;
     for (d=2; d*d<limit; ++d) if(isPrime(d)) {
         for (n=d+d; n<limit; n+=d) {setf(n);}
     }
     plist.push_back(0); for (n=1; n<limit; ++n) {
         if (isPrime(n)) {plist.push_back(n);}
     }
 }
开发者ID:dploop,项目名称:oj,代码行数:11,代码来源:solution.cpp


示例2: set_timezone

 inline void set_timezone(timezone tz)
 {
   if (tz == timezone::local)
     setf(uses_local);
   else
     unsetf(uses_local);
 }
开发者ID:cboulay,项目名称:labstreaminglayer,代码行数:7,代码来源:ios_base_state.hpp


示例3: Shape_GetCenter

void Shape_GetCenter(avm *vm)
{
    word w;
    long off = newtable(vm, ZEN_INITIALTABLESIZE);
    long tindex = TOTinsert(vm, off);
    ctable* tbl = (ctable*)getdata(vm->hp.heap, off);
    word index, source;
    sets(&index, newstring(vm, "X"));
    setf(&source, sfShape_GetCenterX(getint(vm, 0)));
    IA(vm, tbl, tindex, &index, &source);
    sets(&index, newstring(vm, "Y"));
    setf(&source, sfShape_GetCenterY(getint(vm, 0)));
    IA(vm, tbl, tindex, &index, &source);
    sett(&w, tindex);
    returnv(vm, &w);
}
开发者ID:Origin-Development-Studio,项目名称:Zen-Programming-Language,代码行数:16,代码来源:shape.c


示例4: set_duration_style

 inline void set_duration_style(duration_style style)
 {
   if (style == duration_style::symbol)
     setf(uses_symbol);
   else
     unsetf(uses_symbol);
 }
开发者ID:cboulay,项目名称:labstreaminglayer,代码行数:7,代码来源:ios_base_state.hpp


示例5: switch

MyAVIError::MyAVIError(const char *s, uint32 avierr) {
	const char *err = "(Unknown)";

	switch(avierr) {
	case AVIERR_UNSUPPORTED:		err = "unsupported"; break;
	case AVIERR_BADFORMAT:			err = "bad format"; break;
	case AVIERR_MEMORY:				err = "out of memory"; break;
	case AVIERR_INTERNAL:			err = "internal error"; break;
	case AVIERR_BADFLAGS:			err = "bad flags"; break;
	case AVIERR_BADPARAM:			err = "bad parameters"; break;
	case AVIERR_BADSIZE:			err = "bad size"; break;
	case AVIERR_BADHANDLE:			err = "bad AVIFile handle"; break;
	case AVIERR_FILEREAD:			err = "file read error"; break;
	case AVIERR_FILEWRITE:			err = "file write error"; break;
	case AVIERR_FILEOPEN:			err = "file open error"; break;
	case AVIERR_COMPRESSOR:			err = "compressor error"; break;
	case AVIERR_NOCOMPRESSOR:		err = "compressor not available"; break;
	case AVIERR_READONLY:			err = "file marked read-only"; break;
	case AVIERR_NODATA:				err = "no data (?)"; break;
	case AVIERR_BUFFERTOOSMALL:		err = "buffer too small"; break;
	case AVIERR_CANTCOMPRESS:		err = "can't compress (?)"; break;
	case AVIERR_USERABORT:			err = "aborted by user"; break;
	case AVIERR_ERROR:				err = "error (?)"; break;
	}

	setf("%s error: %s (%08lx)", s, err, avierr);
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:27,代码来源:error_win32.cpp


示例6: CAF_LOG_TRACE

void abstract_broker::init_broker() {
  CAF_LOG_TRACE("");
  setf(is_initialized_flag);
  // launch backends now, because user-defined initialization
  // might call functions like add_connection
  for (auto& kvp : doormen_)
    kvp.second->launch();

}
开发者ID:crudbug,项目名称:actor-framework,代码行数:9,代码来源:abstract_broker.cpp


示例7: Shape_GetPointPosition

void Shape_GetPointPosition(avm *vm)
{
    float X, Y;
    sfShape_GetPointPosition(getint(vm, 0), getint(vm, 1), &X, &Y);
    word w;
    long off = newtable(vm, ZEN_INITIALTABLESIZE);
    long tindex = TOTinsert(vm, off);
    ctable* tbl = (ctable*)getdata(vm->hp.heap, off);
    word index, source;
    sets(&index, newstring(vm, "X"));
    setf(&source, X);
    IA(vm, tbl, tindex, &index, &source);
    sets(&index, newstring(vm, "Y"));
    setf(&source, Y);
    IA(vm, tbl, tindex, &index, &source);
    sett(&w, tindex);
    returnv(vm, &w);
}
开发者ID:Origin-Development-Studio,项目名称:Zen-Programming-Language,代码行数:18,代码来源:shape.c


示例8: r_anal_hint_del

R_API void r_anal_hint_del (RAnal *a, ut64 addr, int size) {
	char key[128];
	if (size>1) {
		eprintf ("TODO: r_anal_hint_del: in range\n");
	} else {
		setf (key, "hint.0x%08"PFMT64x, addr);
		sdb_unset (a->sdb_hints, key, 0);
	}
}
开发者ID:dequis,项目名称:radare2,代码行数:9,代码来源:hint.c


示例9: setf

R_API RAnalHint *r_anal_hint_get(RAnal *a, ut64 addr) {
	char key[64];
	setf (key, "hint.0x%08"PFMT64x, addr);
	const char *s = sdb_const_get (DB, key, 0);
	if (!s) {
		return NULL;
	}
	return r_anal_hint_from_string (a, addr, s);
}
开发者ID:xarkes,项目名称:radare2,代码行数:9,代码来源:hint.c


示例10: setw

void Foam::functionObjects::writeFile::writeHeader
(
    Ostream& os,
    const string& str
) const
{
    os  << setw(1) << "#" << setw(1) << ' '
        << setf(ios_base::left) << setw(charWidth() - 2) << str.c_str() << nl;
}
开发者ID:qyzeng,项目名称:OpenFOAM-dev,代码行数:9,代码来源:writeFile.C


示例11: setf

iostream::iostream( streambuf *sb ) {
/***********************************/
// Public constructor, making an iostream with a streambuf attached.
// No point in calling non-default constructors since there are
// multiply-inherited derived classes that will only call the default
// constructors anyway.

    ios::init( sb );
    setf( ios::skipws );
}
开发者ID:kendallb,项目名称:scitech-mgl,代码行数:10,代码来源:iotconbf.cpp


示例12: unsetHint

static void unsetHint(RAnal *a, const char *type, ut64 addr) {
	int idx;
	char key[128];
	setf (key, "hint.0x%08"PFMT64x, addr);
	idx = sdb_array_indexof (DB, key, type, 0);
	if (idx != -1) {
		sdb_array_delete (DB, key, idx, 0);
		sdb_array_delete (DB, key, idx, 0);
	}
}
开发者ID:xarkes,项目名称:radare2,代码行数:10,代码来源:hint.c


示例13: va_start

MyICError::MyICError(uint32 icErr, const char *format, ...) {
	char tmpbuf[1024];

	va_list val;
	va_start(val, format);
	tmpbuf[(sizeof tmpbuf) - 1] = 0;
	_vsnprintf(tmpbuf, (sizeof tmpbuf) - 1, format, val);
	va_end(val);

	setf(tmpbuf, GetVCMErrorString(icErr));
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:11,代码来源:error_win32.cpp


示例14: va_start

MyInternalError::MyInternalError(const char *format, ...) {
	char buf[1024];
	va_list val;

	va_start(val, format);
	_vsnprintf(buf, (sizeof buf) - 1, format, val);
	buf[1023] = 0;
	va_end(val);

	setf("Internal error: %s", buf);
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:11,代码来源:Error.cpp


示例15: setw

void Foam::functionObjects::writeFile::writeHeaderValue
(
    Ostream& os,
    const string& property,
    const Type& value
) const
{
    os  << setw(1) << '#' << setw(1) << ' '
        << setf(ios_base::left) << setw(charWidth() - 2) << property.c_str()
        << setw(1) << ':' << setw(1) << ' ' << value << nl;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:11,代码来源:writeFileTemplates.C


示例16: setf

R_API RAnalHint *r_anal_hint_get(RAnal *a, ut64 addr) {
	char key[128];
	const char *s;
	RAnalHint *hint;

	setf (key, "hint.0x%"PFMT64x, addr);
	s = sdb_const_get (DB, key, 0);
	if (!s) {
		return NULL;
	}
	hint = r_anal_hint_from_string (a, addr, s);
	return hint;
}
开发者ID:dequis,项目名称:radare2,代码行数:13,代码来源:hint.c


示例17: m_timer

TimeF::TimeF(
    const t_longf time
,   const t_longf secondsPerCycle)
:   m_timer(new osg::Timer())
,   m_secondsPerCycle(secondsPerCycle)
,   m_mode(M_Pausing)
,   m_offset(0.f)
,   m_lastModeChangeTime(0.f)
,   m_utcOffset(0)
{
    initialize();
    setf(time, true);
}
开发者ID:helsing72,项目名称:osghimmel,代码行数:13,代码来源:timef.cpp


示例18: setHint

static void setHint (RAnal *a, const char *type, ut64 addr, const char *s, ut64 ptr) {
	int idx;
	char key[128], val[128], *nval = NULL;
	setf (key, "hint.0x%"PFMT64x, addr);
	idx = sdb_array_indexof (DB, key, type, 0);
	if (s) nval = sdb_encode ((const ut8*)s, -1);
	else nval = sdb_itoa (ptr, val, 16);
	if (idx != -1) {
		if (!s) nval = sdb_itoa (ptr, val, 16);
		sdb_array_set (DB, key, idx+1, nval, 0);
	} else {
		sdb_array_push (DB, key, nval, 0);
		sdb_array_push (DB, key, type, 0);
	}
	if (s) free (nval);
}
开发者ID:dequis,项目名称:radare2,代码行数:16,代码来源:hint.c


示例19: OFstream

Foam::ensightFile::ensightFile
(
    const fileName& pathname,
    IOstream::streamFormat format
)
:
    OFstream(pathname, format)
{
    // ascii formatting specs
    setf
    (
        ios_base::scientific,
        ios_base::floatfield
    );
    precision(5);
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:16,代码来源:ensightFile.C


示例20: switch

MyCrashError::MyCrashError(const char *format, uint32 dwExceptionCode) {
	const char *s = "(Unknown Exception)";

	switch(dwExceptionCode) {
	case EXCEPTION_ACCESS_VIOLATION:
		s = "Access Violation";
		break;
	case EXCEPTION_PRIV_INSTRUCTION:
		s = "Privileged Instruction";
		break;
	case EXCEPTION_INT_DIVIDE_BY_ZERO:
		s = "Integer Divide By Zero";
		break;
	case EXCEPTION_BREAKPOINT:
		s = "User Breakpoint";
		break;
	}

	setf(format, s);
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:20,代码来源:Error.cpp



注:本文中的setf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setfile函数代码示例发布时间:2022-05-30
下一篇:
C++ seterror函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap