本文整理汇总了C++中sb函数的典型用法代码示例。如果您正苦于以下问题:C++ sb函数的具体用法?C++ sb怎么用?C++ sb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: VALIDATE_NOT_NULL
ECode WifiP2pServiceResponse::ToString(
/* [out] */ String* string)
{
VALIDATE_NOT_NULL(string);
StringBuilder sb("serviceType:");
sb += mServiceType;
sb += " status:";
sb += StatusToString(mStatus);
String temp;
FAIL_RETURN(mDevice->GetDeviceAddress(&temp));
sb += " srcAddr:";
sb += temp;
sb += " data:";
sb += mData ? (const char*)mData->GetPayload() : "";
*string = sb.ToString();
return NOERROR;
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:22,代码来源:WifiP2pServiceResponse.cpp
示例2: sb
void CTaskModel::RemovePrerequisite(unsigned __int64 prereq)
{
MSXML2::IXMLDOMNode *pNode = 0, *pOld = 0;
StringBuffer sb(_T("prerequisite[@taskid=\""));
StringBuffer buf(32);
sb.append(ModelUtils::toHexString(prereq, buf));
sb.append(_T("\"]"));
BSTR xpath = SysAllocString(sb);
HRESULT hr = m_pNode->selectSingleNode(xpath, &pNode);
SysFreeString(xpath);
if(hr == S_OK && pNode)
{
hr = m_pNode->removeChild(pNode, &pOld);
if(hr == S_OK)
{
pOld->Release();
}
pNode->Release();
}
//TODO: notify?..
}
开发者ID:jaylauffer,项目名称:loadngo,代码行数:22,代码来源:TaskModel.cpp
示例3: sb
bool System::Execute(const String& s)
{
STARTUPINFOW si= {sizeof(STARTUPINFO)};
PROCESS_INFORMATION pi;
StringBuffer<wchar_t> sb(s);
sb.push_back(0);
if(!::CreateProcessW(NULL,sb.data(),NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
{
System::LogTrace("System::Exectue:%s FAILED",s);
return false;
}
System::LogTrace("System::Exectue:%s",s);
::CloseHandle(pi.hProcess);
::CloseHandle(pi.hThread);
return true;
}
开发者ID:xuanya4202,项目名称:ew_base,代码行数:22,代码来源:system.cpp
示例4: testShape
void testShape() {
Util util;
FrameBuffer fb;
ShadowBuffer sb(fb.width, fb.height, 0, 0, fb.finfo.line_length);
fb.backgroundColor = Color(0, 20, 30);
sb.backgroundColor = Color(0, 20, 30);
map<string, vector<Point> > point = util.readObject("Peta.txt");
Shape shape(util.convertPoint(point, "Baling", 0, 0, 2, 2)[0]);
for (int i = 0; i < 360; i++) {
Point * tipPoints = shape.getTipPoints();
Point midAxis((tipPoints[0].x + tipPoints[1].x) / 2, (tipPoints[0].y + tipPoints[1].y) / 2, 0 );
shape.rotate(midAxis, 5);
shape.scale(midAxis, 1.005, 1.005);
shape.color = Color(rand() % 255, rand() % 255, rand() % 255);
sb.clear();
shape.draw(sb);
fb.draw(sb);
}
}
开发者ID:Astahta,项目名称:Grafika_6,代码行数:22,代码来源:test.cpp
示例5: nlassert
//***********************************************************************************************
void CParticleWorkspace::CNode::createEmptyPS()
{
nlassert(_WS);
NL3D::CParticleSystem emptyPS;
NL3D::CParticleSystemShape *pss = new NL3D::CParticleSystemShape;
pss->buildFromPS(emptyPS);
std::auto_ptr<NL3D::CShapeBank> sb(new NL3D::CShapeBank);
std::string shapeName = NLMISC::CFile::getFilename(_RelativePath);
sb->add(shapeName, pss);
NL3D::CShapeBank *oldSB = NL3D::CNELU::Scene->getShapeBank();
NL3D::CNELU::Scene->setShapeBank(sb.get());
NL3D::CParticleSystemModel *psm = NLMISC::safe_cast<NL3D::CParticleSystemModel *>(NL3D::CNELU::Scene->createInstance(shapeName));
nlassert(psm);
NL3D::CNELU::Scene->setShapeBank(oldSB);
setup(*psm);
unload();
// commit new values
_PS = psm->getPS();
_PSM = psm;
_ShapeBank = sb.release();
_Modified = false;
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:23,代码来源:particle_workspace.cpp
示例6: indexAt
void FocusableListView::mouseMoveEvent(QMouseEvent * _e)
{
if (selectByMouseHoverEnabled_)
{
const auto index = indexAt(_e->pos());
if (index.isValid())
{
auto sm = selectionModel();
auto prevSelected = sm->currentIndex();
{
QSignalBlocker sb(sm);
sm->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
}
if (prevSelected.isValid())
model()->dataChanged(prevSelected, prevSelected);
}
}
QListView::mouseMoveEvent(_e);
}
开发者ID:mailru,项目名称:icqdesktop,代码行数:22,代码来源:TransparentScrollBar.cpp
示例7: sb
void LengthDoubleSpinBox::setLength(double v)
{
d->m_orgLengthMm = v;
d->m_valueHasChanged = false;
cpp::ScopedBool sb(d->m_isInternalUpdateContext, true);
Q_UNUSED(sb);
switch (this->measurementSystem()) {
case QLocale::MetricSystem:
this->setValue(AbstractLengthEditor::asMetricLength(
v, this->preferredMetricUnit()));
break;
#if QT_VERSION >= 0x050000
case QLocale::ImperialUKSystem:
#endif // QT_VERSION
case QLocale::ImperialSystem:
this->setValue(AbstractLengthEditor::asImperialLength(
v, this->preferredImperialUnit()));
break;
}
}
开发者ID:fougue,项目名称:fougtools,代码行数:22,代码来源:length_double_spinbox.cpp
示例8: VALIDATE_NOT_NULL
ECode WifiTile::CallbackInfo::ToString(
/* [out] */ String* str)
{
VALIDATE_NOT_NULL(str);
StringBuilder sb("CallbackInfo[");
sb.Append("enabled=");
sb.Append(mEnabled);
sb.Append(",connected=");
sb.Append(mConnected);
sb.Append(",wifiSignalIconId=");
sb.Append(mWifiSignalIconId);
sb.Append(",enabledDesc=");
sb.Append(mEnabledDesc);
sb.Append(",activityIn=");
sb.Append(mActivityIn);
sb.Append(",activityOut=");
sb.Append(mActivityOut);
sb.Append(",wifiSignalContentDescription=");
sb.Append(mWifiSignalContentDescription);
sb.Append(']');
return sb.ToString(str);
}
开发者ID:maerson,项目名称:CPP_Framework_Elastos5,代码行数:22,代码来源:WifiTile.cpp
示例9: SkASSERT
bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
SkASSERT(NULL == rt->renderTargetPriv().getStencilBuffer());
GrUniqueKey sbKey;
int width = rt->width();
int height = rt->height();
if (this->caps()->oversizedStencilSupport()) {
width = SkNextPow2(width);
height = SkNextPow2(height);
}
GrStencilBuffer::ComputeSharedStencilBufferKey(width, height, rt->numSamples(), &sbKey);
SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>(
this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey)));
if (sb) {
if (this->attachStencilBufferToRenderTarget(sb, rt)) {
rt->renderTargetPriv().didAttachStencilBuffer(sb);
return true;
}
return false;
}
if (this->createStencilBufferForRenderTarget(rt, width, height)) {
// Right now we're clearing the stencil buffer here after it is
// attached to an RT for the first time. When we start matching
// stencil buffers with smaller color targets this will no longer
// be correct because it won't be guaranteed to clear the entire
// sb.
// We used to clear down in the GL subclass using a special purpose
// FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported
// FBO status.
this->clearStencil(rt);
GrStencilBuffer* sb = rt->renderTargetPriv().getStencilBuffer();
sb->resourcePriv().setUniqueKey(sbKey);
return true;
} else {
return false;
}
}
开发者ID:merckhung,项目名称:libui,代码行数:38,代码来源:GrGpu.cpp
示例10: sb
Stringp StackTrace::format(AvmCore* core)
{
if(!stringRep)
{
Stringp s = core->kEmptyString;
int displayDepth = depth;
if (displayDepth > kMaxDisplayDepth) {
displayDepth = kMaxDisplayDepth;
}
const Element *e = elements;
for (int i=0; i<displayDepth; i++, e++)
{
// env will be NULL if the element is from a fake CallStackNode
// omit them since they are only for profiling purposes
if (!e->info())
continue;
if(i != 0)
s = s->appendLatin1("\r\n");
Stringp filename=NULL;
if(e->filename())
{
StringBuffer sb(core->gc);
dumpFilename(e->filename(), sb);
filename = core->newStringUTF8(sb.c_str());
}
s = core->concatStrings(s, getStackTraceLine(e->info(), filename));
if(e->filename())
{
s = core->concatStrings(s, core->intToString(e->linenum()));
s = s->appendLatin1("]");
}
}
stringRep = s;
}
return stringRep;
}
开发者ID:hgl888,项目名称:nashtest,代码行数:38,代码来源:StackTrace.cpp
示例11: checker_calc
int checker_calc(t_e *e)
{
char *line;
while (get_next_line(0, &line) != 0)
{
if (ft_strcmp("sa", line) == 0)
sa(e->l_a);
else if (ft_strcmp("sb", line) == 0)
sb(e->l_b);
else if (ft_strcmp("ss", line) == 0)
ss(e->l_a, e->l_b);
else if (ft_strcmp("ra", line) == 0)
ra(e->l_a);
else if (ft_strcmp("rb", line) == 0)
rb(e->l_b);
else if (ft_strcmp("rr", line) == 0)
rr(e->l_a, e->l_b);
else if (ft_strcmp("rra", line) == 0)
rra(e->l_a);
else if (ft_strcmp("rrb", line) == 0)
rrb(e->l_b);
else if (ft_strcmp("rrr", line) == 0)
rrr(e->l_a, e->l_b);
else if (ft_strcmp("pa", line) == 0)
pa(e->l_a, e->l_b);
else if (ft_strcmp("pb", line) == 0)
pb(e->l_a, e->l_b);
else
{
ft_putendl_fd("Error", 2);
ft_memdel((void **)&line);
return (0);
}
ft_memdel((void **)&line);
}
return (1);
}
开发者ID:ajuber,项目名称:project-push_swap3,代码行数:38,代码来源:main_checker.c
示例12: testLine
void testLine() {
Util util;
FrameBuffer fb;
ShadowBuffer sb(fb.width, fb.height, 0, 0, fb.finfo.line_length);
fb.backgroundColor = Color(0, 20, 30);
sb.backgroundColor = Color(0, 20, 30);
vector<Point> points;
points.push_back(Point(0, 20,20));
points.push_back(Point(800, 500, 300));
Line line(points);
for (int i = 0; i < 360; i++) {
Point * tipPoints = line.getTipPoints();
Point midAxis((tipPoints[0].x + tipPoints[1].x) / 2, (tipPoints[0].y + tipPoints[1].y) / 2, 0);
line.rotate(midAxis, 5);
line.color = Color(rand() % 255, rand() % 255, rand() % 255);
sb.clear();
line.draw(sb);
fb.draw(sb);
}
}
开发者ID:Astahta,项目名称:Grafika_6,代码行数:23,代码来源:test.cpp
示例13: sb
void CategoryPage::btOk_Click(Web::HttpConnector& h)
{
Sql::StringBuilder sb(L"category", L"category_id", category_id);
sb.Bind(L"descr", tbxDescr);
Sql::SqlConnection conn;
int rows = 0;
try
{
//conn.OpenSession(DSN, USERNAME, PASSWORD); //Control Panel>Administrative Tools>Data Sources (ODBC)>Create dsn_myDatabase
conn.OpenSession(NULL, CONNECTION_STRING);
rows = conn.ExecuteNonQuery(sb.GetString());
if (rows!=1)
{
this->MessageBox(Sys::Convert::ToString(rows), L"Error -number of rows", MB_OK | MB_ICONERROR);
}
}
catch (Sql::SqlException e)
{
this->MessageBox(e.GetDescription(), L"Error", MB_OK | MB_ICONERROR);
}
h.NavigateTo(L"Index");
}
开发者ID:israelfloresdga,项目名称:Wintempla-Information-System,代码行数:23,代码来源:CategoryPage.cpp
示例14: sb
String IntentBindRecord::ToString()
{
if (!mStringName.IsNull()) {
return mStringName;
}
StringBuilder sb(128);
sb += "IntentBindRecord{";
sb += StringUtils::ToString(Int32(this), 16);
sb += ' ';
if ((CollectFlags()& IContext::BIND_AUTO_CREATE) != 0) {
sb += "CR ";
}
sb += mService->mShortName;
sb += ':';
if (mIntent != NULL) {
AutoPtr<IIntent> intent;
mIntent->GetIntent((IIntent**)&intent);
intent->ToShortString(&sb, FALSE, FALSE, FALSE, FALSE);
}
sb += '}';
return mStringName = sb.ToString();
}
开发者ID:XilongPei,项目名称:Elastos5,代码行数:23,代码来源:IntentBindRecord.cpp
示例15: IndexError
template< class T > T Correlation< T >::operator () (const vector < T > & a, const vector < T > & b) const
{
static char F_Name[] = "template< class T > T Correlation< T >::operator () (const vector < T > & a, const vector < T > & b) const";
if(a.size() != b.size()) {
TKVPairList kvlist;
kvlist.push_back(TKVPair("Size", a.size()));
kvlist.push_back(TKVPair("Size", b.size()));
throw IndexError(F_Name, kvlist);
}
T av_a, av_b, d_a, d_b, sp(0), sa(0), sb(0);
av_a = average(a);
av_b = average(b);
for(unsigned i=0; i<a.size(); i++) {
d_a = a[i] - av_a;
d_b = b[i] - av_b;
sp += d_a * d_b;
sa += SQR(d_a);
sb += SQR(d_b);
}
return sp / sqrt(sa * sb);
}
开发者ID:proofy,项目名称:boss,代码行数:23,代码来源:dsp_distances.cpp
示例16: main
int main(int, char**)
{
{
char buf[10] = "123";
test sb(buf, 0, buf + 3);
assert(sb.underflow() == '1');
assert(sb.underflow() == '1');
assert(sb.snextc() == '2');
assert(sb.underflow() == '2');
assert(sb.underflow() == '2');
assert(sb.snextc() == '3');
assert(sb.underflow() == '3');
assert(sb.underflow() == '3');
assert(sb.snextc() == EOF);
assert(sb.underflow() == EOF);
assert(sb.underflow() == EOF);
sb.sputc('4');
assert(sb.underflow() == '4');
assert(sb.underflow() == '4');
}
return 0;
}
开发者ID:ingowald,项目名称:llvm-project,代码行数:23,代码来源:underflow.pass.cpp
示例17: sb
String BackupRecord::ToString()
{
if (!mStringName.IsNull()) {
return mStringName;
}
StringBuilder sb(128);
sb.Append("BackupRecord{");
sb.Append((Int32)this); // (Integer.toHexString(System.identityHashCode(this)))
sb.AppendChar(' ');
String pkgName;
mAppInfo->GetPackageName(&pkgName);
sb.Append(pkgName);
sb.AppendChar(' ');
String name;
mAppInfo->GetName(&name);
sb.Append(name);
sb.AppendChar(' ');
String bName;
mAppInfo->GetBackupAgentName(&bName);
sb.Append(bName);
sb.AppendChar('}');
return mStringName = sb.ToString();
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:23,代码来源:BackupRecord.cpp
示例18: Handle80211DataFromAP
void Handle80211DataFromAP(const struct timeval& t, const data_hdr_t *hdr, const u_char *rest, int len) {
if (opt_enforce_80211_frame_checksum && !fcs_ok) return;
#ifdef DEBUG_WIFI
cout << hdr->sa;
cout << " " << "802.11 data from AP:\t"
<< hdr->sa << " -> " << hdr->da << "\t" << len << endl;
#endif
struct timeval tv;
/* TK1: Does the pcap header make sense? */
/* TK2: How do we get and preserve the the three MAC addresses? */
printf("DATA_HDRLEN=%d DATA_WDS_HDRLEN=%d\n",DATA_HDRLEN,DATA_WDS_HDRLEN);
sbuf_t sb(pos0_t(),rest,len,len,0);
sb.hex_dump(std::cout);
rest += 10; // where does 10 come from?
len -= 10;
be13::packet_info pi(DLT_IEEE802_11,(const pcap_pkthdr *)0,(const u_char *)0,tvshift(tv,t),rest,len);
printf("pi.ip_version=%d\n",pi.ip_version());
process_packet_info(pi);
}
开发者ID:constcast,项目名称:tcpflow,代码行数:23,代码来源:wifi_datalink.cpp
示例19: testShapeGroup
void testShapeGroup() {
Util util;
FrameBuffer fb;
ShadowBuffer sb(fb.width, fb.height, 0, 0, fb.finfo.line_length);
fb.backgroundColor = Color(0, 20, 30);
sb.backgroundColor = Color(0, 20, 30);
ShapeGroup indonesia("Peta");
for (int i = 0; i < 180; i++) {
Point * tipPoints = indonesia.getTipPoints();
Point midAxis((tipPoints[0].x + tipPoints[1].x) / 2, (tipPoints[0].y + tipPoints[1].y) / 2, 0);
indonesia.rotate(midAxis, 5);
indonesia.scale(midAxis, 1.005, 1.005);
for (int i = 0; i < indonesia.shapes.size(); i++) {
indonesia.shapes[i].color = Color(rand() % 255, rand() % 255, rand() % 255);
}
sb.clear();
indonesia.draw(sb);
fb.draw(sb);
}
}
开发者ID:Astahta,项目名称:Grafika_6,代码行数:24,代码来源:test.cpp
示例20: main
int main(){
long n, m, W; scanf("%ld %ld %ld", &n, &m, &W);
std::vector<long> w(n); for(long p = 0; p < n; p++){scanf("%ld", &w[p]);}
std::vector<long> b(n); for(long p = 0; p < n; p++){scanf("%ld", &b[p]);}
std::vector<std::vector<long> > g(n);
for(long p = 0; p < m; p++){
long x, y; scanf("%ld %ld", &x, &y);
--x; --y;
g[x].push_back(y);
g[y].push_back(x);
}
std::vector<long> head(n, -1);
for(long p = 0; p < n; p++){dfs(p, g, head, p);}
std::vector<long> sw(n, 0); std::vector<long> sb(n, 0);
std::vector<std::vector<long> > sv(n);
for(long p = 0; p < n; p++){sw[head[p]] += w[p]; sb[head[p]] += b[p]; sv[head[p]].push_back(p);}
std::vector<long> f(W + 1, 0);
for(long p = 0; p < n; p++){
if(head[p] != p){continue;}
for(long ww = W; ww >= 0; ww--){
if(sw[p] <= ww){f[ww] = std::max(f[ww], f[ww - sw[p]] + sb[p]);}
for(long t = 0; t < sv[p].size(); t++){
long u = sv[p][t];
if(w[u] <= ww){f[ww] = std::max(f[ww], f[ww - w[u]] + b[u]);}
}
}
}
printf("%ld\n", f[W]);
return 0;
}
开发者ID:DionysiosB,项目名称:CodeForces,代码行数:36,代码来源:741B-ArpasWeakAmphitheaterAndMehrdadsValuableHoses.cpp
注:本文中的sb函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论