本文整理汇总了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);}
}
}
示例2: set_timezone
inline void set_timezone(timezone tz)
{
if (tz == timezone::local)
setf(uses_local);
else
unsetf(uses_local);
}
示例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);
}
示例4: set_duration_style
inline void set_duration_style(duration_style style)
{
if (style == duration_style::symbol)
setf(uses_symbol);
else
unsetf(uses_symbol);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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 );
}
示例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);
}
}
示例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));
}
示例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);
}
示例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;
}