本文整理汇总了C++中done函数的典型用法代码示例。如果您正苦于以下问题:C++ done函数的具体用法?C++ done怎么用?C++ done使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了done函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: done
void EditContact::cancelData()
{
done(-1);
}
示例2: fatal
void
fatal(const char *msg)
{
fprintf(stderr, "%s: f - %s\n", myname, msg);
done(2);
}
示例3: main
void
main (void)
{
char_lt_char ();
char_gt_char ();
achar0++;
char_lt_char ();
char_gt_char ();
char_gte_char ();
char_lte_char ();
achar1 = 0x10;
char_lt_lit ();
char_gt_lit ();
char_lte_lit ();
char_gte_lit ();
achar0 = 0;
achar1 = 0;
char_lt_char_else ();
char_gt_char_else ();
achar0++;
char_lt_char_else ();
char_gt_char_else ();
char_gte_char_else ();
char_lte_char_else ();
achar1 = 0x10;
char_lt_lit_else ();
char_gt_lit_else ();
char_lte_lit_else ();
char_gte_lit_else ();
int_lt_int ();
int_gt_int ();
aint0++;
int_lt_int ();
int_gt_int ();
int_gte_int ();
int_lte_int ();
aint1 = 0x10;
int_lt_lit ();
int_gt_lit ();
int_lte_lit ();
int_gte_lit ();
aint0=0;
aint1=0;
int_lt_int_else ();
int_gt_int_else ();
aint0++;
int_lt_int_else ();
int_gt_int_else ();
int_gte_int_else ();
int_lte_int_else ();
aint1 = 0x10;
int_lt_lit_else ();
int_gt_lit_else ();
int_lte_lit_else ();
int_gte_lit_else ();
success = failures;
done ();
}
示例4: no_space
void
no_space(void)
{
fprintf(stderr, "%s: f - out of space\n", myname);
done(2);
}
示例5: done
void QQuickShapeFillRunnable::run()
{
QQuickShapeGenericRenderer::triangulateFill(path, fillColor, &fillVertices, &fillIndices, &indexType, supportsElementIndexUint);
emit done(this);
}
示例6: done
// ok button
void CoinControlDialog::buttonBoxClicked(QAbstractButton* button)
{
if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole)
done(QDialog::Accepted); // closes the dialog
}
示例7: TORRENT_ASSERT
void traversal_algorithm::add_entry(node_id const& id, udp::endpoint addr, unsigned char flags)
{
TORRENT_ASSERT(m_node.m_rpc.allocation_size() >= sizeof(find_data_observer));
void* ptr = m_node.m_rpc.allocate_observer();
if (ptr == 0)
{
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(traversal) << "[" << this << "] failed to allocate memory for observer. aborting!";
#endif
done();
return;
}
observer_ptr o = new_observer(ptr, addr, id);
if (id.is_all_zeros())
{
o->set_id(generate_random_id());
o->flags |= observer::flag_no_id;
}
o->flags |= flags;
TORRENT_ASSERT(boost::algorithm::is_sorted(m_results.begin(), m_results.end()
, boost::bind(
compare_ref
, boost::bind(&observer::id, _1)
, boost::bind(&observer::id, _2)
, m_target)
));
std::vector<observer_ptr>::iterator i = std::lower_bound(
m_results.begin()
, m_results.end()
, o
, boost::bind(
compare_ref
, boost::bind(&observer::id, _1)
, boost::bind(&observer::id, _2)
, m_target
)
);
if (i == m_results.end() || (*i)->id() != id)
{
if (m_node.settings().restrict_search_ips
&& !(flags & observer::flag_initial))
{
// don't allow multiple entries from IPs very close to each other
std::vector<observer_ptr>::iterator j = std::find_if(
m_results.begin(), m_results.end(), boost::bind(&compare_ip_cidr, _1, o));
if (j != m_results.end())
{
// we already have a node in this search with an IP very
// close to this one. We know that it's not the same, because
// it claims a different node-ID. Ignore this to avoid attacks
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(traversal) << "[" << this << "] IGNORING result "
<< "id: " << o->id()
<< " address: " << o->target_addr()
<< " existing node: "
<< (*j)->id() << " " << (*j)->target_addr()
<< " distance: " << distance_exp(m_target, o->id())
<< " type: " << name()
;
#endif
return;
}
}
TORRENT_ASSERT(std::find_if(m_results.begin(), m_results.end()
, boost::bind(&observer::id, _1) == id) == m_results.end());
#ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_LOG(traversal) << "[" << this << "] ADD id: " << id
<< " address: " << addr
<< " distance: " << distance_exp(m_target, id)
<< " invoke-count: " << m_invoke_count
<< " type: " << name()
;
#endif
i = m_results.insert(i, o);
TORRENT_ASSERT(boost::algorithm::is_sorted(m_results.begin(), m_results.end()
, boost::bind(
compare_ref
, boost::bind(&observer::id, _1)
, boost::bind(&observer::id, _2)
, m_target)
));
}
if (m_results.size() > 100)
{
#if TORRENT_USE_ASSERTS
for (int i = 100; i < m_results.size(); ++i)
m_results[i]->m_was_abandoned = true;
#endif
m_results.resize(100);
}
}
示例8: done
void returnAuthCheck::sClose()
{
done(-1);
}
示例9: done
void failed (void) { m_failed = true; done(); }
示例10: tr
void returnAuthCheck::sSave()
{
XSqlQuery returnSave;
if (!_date->isValid())
{
QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"),
tr("<p>You must enter a date for this check.") );
_date->setFocus();
return;
}
else if (_amount->isZero())
{
QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"),
tr("<p>You must enter an amount for this check.") );
return;
}
else if (!_bankaccnt->isValid())
{
QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"),
tr("<p>You must select a bank account for this check.") );
_date->setFocus();
return;
}
else
{
returnSave.prepare("SELECT createCheck(:bankaccnt_id, 'C', :recipid,"
" :checkDate, :amount, :curr_id, NULL,"
" NULL, :for, :notes, true, :aropen_id) AS result; ");
returnSave.bindValue(":bankaccnt_id", _bankaccnt->id());
returnSave.bindValue(":recipid", _custid);
returnSave.bindValue(":checkDate", _date->date());
returnSave.bindValue(":amount", _amount->localValue());
returnSave.bindValue(":curr_id", _amount->id());
returnSave.bindValue(":for", _for->text().trimmed());
returnSave.bindValue(":notes", _notes->toPlainText().trimmed());
returnSave.bindValue(":aropen_id", _aropenid);
returnSave.exec();
if (returnSave.first())
{
_checkid = returnSave.value("result").toInt();
if (_checkid < 0)
{
ErrorReporter::error(QtCriticalMsg, this, tr("Error Retrieving Check Information"),
storedProcErrorLookup("createCheck", _checkid),
__FILE__, __LINE__);
return;
}
returnSave.prepare( "SELECT checkhead_number "
"FROM checkhead "
"WHERE (checkhead_id=:check_id);" );
returnSave.bindValue(":check_id", _checkid);
returnSave.exec();
if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Retrieving Check Information"),
returnSave, __FILE__, __LINE__))
{
return;
}
done(true);
}
else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Retrieving Check Information"),
returnSave, __FILE__, __LINE__))
{
return;
}
}
}
示例11: QDialog
TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_type graph_type) :
QDialog(NULL, Qt::Window),
ui(new Ui::TCPStreamDialog),
cap_file_(cf),
ts_offset_(0),
ts_origin_conn_(true),
seq_offset_(0),
seq_origin_zero_(true),
title_(NULL),
base_graph_(NULL),
tput_graph_(NULL),
seg_graph_(NULL),
ack_graph_(NULL),
rwin_graph_(NULL),
tracer_(NULL),
packet_num_(0),
mouse_drags_(true),
rubber_band_(NULL),
num_dsegs_(-1),
num_acks_(-1),
num_sack_ranges_(-1)
{
struct segment current;
int graph_idx = -1;
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
graph_.type = GRAPH_UNDEFINED;
set_address(&graph_.src_address, AT_NONE, 0, NULL);
graph_.src_port = 0;
set_address(&graph_.dst_address, AT_NONE, 0, NULL);
graph_.dst_port = 0;
graph_.stream = 0;
graph_.segments = NULL;
struct tcpheader *header = select_tcpip_session(cap_file_, ¤t);
if (!header) {
done(QDialog::Rejected);
return;
}
//#ifdef Q_OS_MAC
// ui->hintLabel->setAttribute(Qt::WA_MacSmallSize, true);
//#endif
QComboBox *gtcb = ui->graphTypeComboBox;
gtcb->setUpdatesEnabled(false);
gtcb->addItem(ui->actionRoundTripTime->text(), GRAPH_RTT);
if (graph_type == GRAPH_RTT) graph_idx = gtcb->count() - 1;
gtcb->addItem(ui->actionThroughput->text(), GRAPH_THROUGHPUT);
if (graph_type == GRAPH_THROUGHPUT) graph_idx = gtcb->count() - 1;
gtcb->addItem(ui->actionStevens->text(), GRAPH_TSEQ_STEVENS);
if (graph_type == GRAPH_TSEQ_STEVENS) graph_idx = gtcb->count() - 1;
gtcb->addItem(ui->actionTcptrace->text(), GRAPH_TSEQ_TCPTRACE);
if (graph_type == GRAPH_TSEQ_TCPTRACE) graph_idx = gtcb->count() - 1;
gtcb->addItem(ui->actionWindowScaling->text(), GRAPH_WSCALE);
if (graph_type == GRAPH_WSCALE) graph_idx = gtcb->count() - 1;
gtcb->setUpdatesEnabled(true);
ui->dragRadioButton->setChecked(mouse_drags_);
ctx_menu_.addAction(ui->actionZoomIn);
ctx_menu_.addAction(ui->actionZoomInX);
ctx_menu_.addAction(ui->actionZoomInY);
ctx_menu_.addAction(ui->actionZoomOut);
ctx_menu_.addAction(ui->actionZoomOutX);
ctx_menu_.addAction(ui->actionZoomOutY);
ctx_menu_.addAction(ui->actionReset);
ctx_menu_.addSeparator();
ctx_menu_.addAction(ui->actionMoveRight10);
ctx_menu_.addAction(ui->actionMoveLeft10);
ctx_menu_.addAction(ui->actionMoveUp10);
ctx_menu_.addAction(ui->actionMoveDown10);
ctx_menu_.addAction(ui->actionMoveRight1);
ctx_menu_.addAction(ui->actionMoveLeft1);
ctx_menu_.addAction(ui->actionMoveUp1);
ctx_menu_.addAction(ui->actionMoveDown1);
ctx_menu_.addSeparator();
ctx_menu_.addAction(ui->actionNextStream);
ctx_menu_.addAction(ui->actionPreviousStream);
ctx_menu_.addAction(ui->actionSwitchDirection);
ctx_menu_.addAction(ui->actionGoToPacket);
ctx_menu_.addSeparator();
ctx_menu_.addAction(ui->actionDragZoom);
ctx_menu_.addAction(ui->actionToggleSequenceNumbers);
ctx_menu_.addAction(ui->actionToggleTimeOrigin);
ctx_menu_.addAction(ui->actionCrosshairs);
ctx_menu_.addSeparator();
ctx_menu_.addAction(ui->actionRoundTripTime);
ctx_menu_.addAction(ui->actionThroughput);
ctx_menu_.addAction(ui->actionStevens);
ctx_menu_.addAction(ui->actionTcptrace);
ctx_menu_.addAction(ui->actionWindowScaling);
memset (&graph_, 0, sizeof(graph_));
graph_.type = graph_type;
copy_address(&graph_.src_address, ¤t.ip_src);
graph_.src_port = current.th_sport;
copy_address(&graph_.dst_address, ¤t.ip_dst);
//.........这里部分代码省略.........
示例12: QObject
DosageSenderTester::DosageSenderTester(QObject *parent) :
QObject(parent)
{
connect(mfDrugsIO::instance(), SIGNAL(transmissionDone()), this, SLOT(done()));
}
示例13: tr
void subaccount::sSave()
{
XSqlQuery subaccountSave;
if (_number->text().length() == 0)
{
QMessageBox::warning( this, tr("Cannot Save Sub Account"),
tr("You must enter a valid Number.") );
return;
}
subaccountSave.prepare("SELECT subaccnt_id"
" FROM subaccnt"
" WHERE((subaccnt_id != :subaccnt_id)"
" AND (subaccnt_number=:subaccnt_number))");
subaccountSave.bindValue(":subaccnt_id", _subaccntid);
subaccountSave.bindValue(":subaccnt_number", _number->text());
subaccountSave.exec();
if(subaccountSave.first())
{
QMessageBox::critical(this, tr("Duplicate Sub Account Number"),
tr("A Sub Account Number already exists for the one specified.") );
return;
}
if (_mode == cNew)
{
subaccountSave.exec("SELECT NEXTVAL('subaccnt_subaccnt_id_seq') AS subaccnt_id;");
if (subaccountSave.first())
_subaccntid = subaccountSave.value("subaccnt_id").toInt();
else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Retrieving Sub Account Information"),
subaccountSave, __FILE__, __LINE__))
{
return;
}
subaccountSave.prepare( "INSERT INTO subaccnt "
"( subaccnt_id, subaccnt_number, subaccnt_descrip ) "
"VALUES "
"( :subaccnt_id, :subaccnt_number, :subaccnt_descrip );" );
}
else if (_mode == cEdit)
{
if (_number->text() != _cachedNumber &&
QMessageBox::question(this, tr("Change All Accounts?"),
tr("<p>The old Subaccount Number %1 might be "
"used by existing Accounts. Would you like to "
"change all accounts that use it to Subaccount"
" Number %2?<p>If you answer 'No' then change "
"the Number back to %3 and Save again.")
.arg(_cachedNumber)
.arg(_number->text())
.arg(_cachedNumber),
QMessageBox::Yes,
QMessageBox::No | QMessageBox::Default) == QMessageBox::No)
return;
subaccountSave.prepare( "UPDATE subaccnt "
"SET subaccnt_number=:subaccnt_number,"
" subaccnt_descrip=:subaccnt_descrip "
"WHERE (subaccnt_id=:subaccnt_id);" );
}
subaccountSave.bindValue(":subaccnt_id", _subaccntid);
subaccountSave.bindValue(":subaccnt_number", _number->text());
subaccountSave.bindValue(":subaccnt_descrip", _descrip->toPlainText());
subaccountSave.exec();
if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Sub Account Information"),
subaccountSave, __FILE__, __LINE__))
{
return;
}
done(_subaccntid);
}
示例14: main
int
main (int argc, char **argv)
{
int msgp = 0, distsw = 0, vecp;
int isdf = 0, mime = 0;
int msgnum, status;
char *cp, *dfolder = NULL, *maildir = NULL;
char buf[BUFSIZ], **ap, **argp, **arguments, *program;
char *msgs[MAXARGS], **vec;
struct msgs *mp;
struct stat st;
if (nmh_init(argv[0], 1)) { return 1; }
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
vec = argsplit(postproc, &program, &vecp);
vec[vecp++] = "-library";
vec[vecp++] = getcpy (m_maildir (""));
if ((cp = context_find ("fileproc"))) {
vec[vecp++] = "-fileproc";
vec[vecp++] = cp;
}
if ((cp = context_find ("mhlproc"))) {
vec[vecp++] = "-mhlproc";
vec[vecp++] = cp;
}
if ((cp = context_find ("credentials"))) {
/* post doesn't read context so need to pass credentials. */
vec[vecp++] = "-credentials";
vec[vecp++] = cp;
}
while ((cp = *argp++)) {
if (*cp == '-') {
switch (smatch (++cp, switches)) {
case AMBIGSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
adios (NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [file] [switches]", invo_name);
print_help (buf, switches, 1);
done (0);
case VERSIONSW:
print_version(invo_name);
done (0);
case DRAFTSW:
msgs[msgp++] = draft;
continue;
case DFOLDSW:
if (dfolder)
adios (NULL, "only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
msgs[msgp++] = cp;
continue;
case NDFLDSW:
dfolder = NULL;
isdf = NOTOK;
continue;
case PUSHSW:
pushsw++;
continue;
case NPUSHSW:
pushsw = 0;
continue;
case SPLITSW:
if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1)
adios (NULL, "missing argument to %s", argp[-2]);
continue;
case UNIQSW:
unique++;
continue;
case NUNIQSW:
unique = 0;
continue;
case FORWSW:
forwsw++;
continue;
case NFORWSW:
//.........这里部分代码省略.........
示例15: tr
void taxZone::sSave()
{
XSqlQuery taxSave;
if (_taxZone->text().length() == 0)
{
QMessageBox::warning( this, tr("Cannot Save Tax Zone"),
tr("You must enter a valid Code.") );
return;
}
if (_mode == cEdit)
{
taxSave.prepare( "SELECT taxzone_id "
"FROM taxzone "
"WHERE ( (taxzone_id<>:taxzone_id)"
" AND (UPPER(taxzone_code)=UPPER(:taxzone_code)) );");
taxSave.bindValue(":taxzone_id", _taxzoneid);
}
else
{
taxSave.prepare( "SELECT taxzone_id "
"FROM taxzone "
"WHERE (taxzone_code=:taxzone_code);");
}
taxSave.bindValue(":taxzone_code", _taxZone->text().trimmed());
taxSave.exec();
if (taxSave.first())
{
QMessageBox::critical( this, tr("Cannot Create Tax Zone"),
tr( "A Tax Zone with the entered code already exists."
"You may not create a Tax Zone with this code." ) );
_taxZone->setFocus();
return;
}
else if (taxSave.lastError().type() != QSqlError::NoError)
{
systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__);
return;
}
XSqlQuery rollback;
rollback.prepare("ROLLBACK;");
taxSave.exec("BEGIN;");
if (_mode == cEdit)
{
taxSave.prepare( "UPDATE taxzone "
"SET taxzone_code=:taxzone_code,"
" taxzone_descrip=:taxzone_descrip "
"WHERE (taxzone_id=:taxzone_id);" );
}
else if (_mode == cNew)
{
taxSave.exec("SELECT NEXTVAL('taxzone_taxzone_id_seq') AS taxzone_id;");
if (taxSave.first())
_taxzoneid = taxSave.value("taxzone_id").toInt();
else if (taxSave.lastError().type() != QSqlError::NoError)
{
rollback.exec();
systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__);
return;
}
taxSave.prepare( "INSERT INTO taxzone "
"(taxzone_id, taxzone_code, taxzone_descrip)"
"VALUES "
"(:taxzone_id, :taxzone_code, :taxzone_descrip);" );
}
taxSave.bindValue(":taxzone_id", _taxzoneid);
taxSave.bindValue(":taxzone_code", _taxZone->text().trimmed());
taxSave.bindValue(":taxzone_descrip", _description->text());
taxSave.exec();
if (taxSave.lastError().type() != QSqlError::NoError)
{
rollback.exec();
systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__);
return;
}
taxSave.exec("COMMIT;");
done(_taxzoneid);
}