当前位置: 首页>>代码示例>>C++>>正文


C++ setf函数代码示例

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


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


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