本文整理汇总了C++中confirm函数的典型用法代码示例。如果您正苦于以下问题:C++ confirm函数的具体用法?C++ confirm怎么用?C++ confirm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了confirm函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: while
void kd_tree::check_tree(int where){
int i,ancestor,j;
//printf("checking %d of %d\n",where,data.get_rows());
if(where<0)where=masterparent;
/*first make sure that all nodes are somehow descended from the masterparent*/
if(where!=masterparent){
j=where;
ancestor=tree.get_data(j,3);
while(ancestor>=0){
j=ancestor;
ancestor=tree.get_data(j,3);
//printf("%d %d %d\n",j,ancestor,masterparent);
}
if(j!=masterparent){
printf("WARNING tree is not properly constructed\n");
printf("could not reach the master parent\n");
exit(1);
}
}
/*make sure that the left hand branch is properly constructed*/
if(tree.get_data(where,1)>-1)confirm(tree.get_data(where,0),where,1,tree.get_data(where,1));
/*make sure that the right hand branch is properly constructed*/
if(tree.get_data(where,2)>-1)confirm(tree.get_data(where,0),where,2,tree.get_data(where,2));
}
开发者ID:uwssg,项目名称:ModifiedAPS,代码行数:33,代码来源:kd.cpp
示例2: rmfile
static int
rmfile(const char *base, const struct stat *sp)
{
if (iflag) {
msg(sysv3 ? "%s ? " : "remove %s: (y/n)? ", path);
if (confirm() == 0)
return 0;
} else if ((sp->st_mode&S_IFMT) != S_IFDIR &&
(sp->st_mode&S_IFMT) != S_IFLNK &&
ontty && !fflag &&
access(base, W_OK) < 0) {
msg("%s: %o mode ? ", path, (int)(sp->st_mode & 0777));
if (confirm() == 0)
return 0;
}
if (((sp->st_mode&S_IFMT) == S_IFDIR ? rmdir : unlink)(base) < 0) {
#ifndef SUS
if ((sp->st_mode&S_IFMT) == S_IFDIR || !fflag || iflag)
#endif
fprintf(stderr, (sp->st_mode&S_IFMT) == S_IFDIR ?
"%s: Unable to remove directory %s\n%s\n" :
"%s: %s not removed.\n%s\n",
progname, path, strerror(errno));
errcnt |= 1;
return -1;
}
return 0;
}
开发者ID:Sunshine-OS,项目名称:svr4-userland,代码行数:28,代码来源:rm.c
示例3: ed_direct_prompt
static void ed_direct_prompt(void **args)
{
ed_data *data = args[0];
if (get_opt_int("askrename")) {
bool ans = 0;
if (data->src.argc > 1)
ans = confirm("Rename %d items to %s ?", data->src.argc, data->dst);
else
ans = confirm("Rename %s to %s ?", data->src.argv[0], data->dst);
if (!ans)
goto cleanup;
}
char from[PATH_MAX];
char to[PATH_MAX];
char *curdir = fs_pwd();
//NOTE: multiargs rename all to same dest
for (int i = 0; i < data->src.argc; i++) {
log_err("ED", "[%s] [%s]", data->src.argv[i], data->dst);
conspath_buf(from, curdir, data->src.argv[i]);
conspath_buf(to, curdir, data->dst);
file_move_str(from, to, NULL);
}
cleanup:
del_param_list(data->src.argv, data->src.argc);
free(data->dst);
free(data);
}
开发者ID:jollywho,项目名称:nav,代码行数:32,代码来源:ed.c
示例4: message
void Chatbox::parseString(QString str) {
if (str[0] != '!') {
emit message(str);
return;
}
str[0] = ' ';
str = str.trimmed().toLower();
QStringList list = str.split(QRegExp("\\s+"));
QStringList::const_iterator it = list.begin();
if (it->contains(rgxPos)) {
emit playStone(Position(*it));
} else if (*it == "pass" || *it == "p") {
emit pass();
} else if (*it == "undo" || *it == "u") {
emit undo();
} else if (*it == "kill" || *it == "k") {
if (++it == list.end() || !it->contains(rgxPos))
display("Expected position as second argument.");
else
emit kill(Position(*it));
} else if (*it == "exit" || *it == "e") {
emit exit();
} else if (*it == "connect" || *it == "c") {
if (++it != list.end()) {
emit setHost(*it);
if (++it != list.end()) {
emit setPort(it->toInt());
}
}
emit cl_connect();
} else if (*it == "disconnect" || *it == "dc") {
emit cl_disconnect();
} else if (*it == "yes" || *it == "y") {
emit confirm(true);
} else if (*it == "no" || *it == "n") {
emit confirm(false);
} else if (*it == "save" || *it == "s") {
if (++it == list.end())
display("Expected filename as second argument.");
else
emit writeLogToDisk(*it);
} else if (*it == "help" || *it == "h" ) {
display("4DGo -- A four-dimensional goban for online play.");
display("All commands start with a '!'. Any input that does not is treated as a chat message. All comands are case-insensitive.");
display(" Commands:");
display("!connect [hostname] [port]: connect to the game server. By default, localhost:15493 will be used.");
display("!disconnect: break connection to server and clear the goban.");
display("!A4d4: on slice A4 (top-left), on intersection d4 (top-right).");
display("!pass: end your turn without playing a stone.");
display("!undo: request that your last move be undone.");
display("!yes: allow the action your opponent requested (usually an undo or kill).");
display("!yes: refuse to allow the action your opponent requested (usually an undo or kill).");
display("!kill: request a certain group to be immediately taken off the board. Useful in endgame, to not need to play out all captures.");
display("!save filename: save the current history to file filename.");
display("!exit: disconnect and close the window.");
} else {
tbCBox_->append(QString("Unknown command: ")+*it);
}
}
开发者ID:jesyspa,项目名称:4DGo,代码行数:59,代码来源:chatbox.cpp
示例5: fsm_msgChangePin
void fsm_msgChangePin(ChangePin *msg)
{
bool removal = msg->has_remove && msg->remove;
bool confirmed = false;
if(removal)
{
if(storage_has_pin())
{
confirmed = confirm(ButtonRequestType_ButtonRequest_RemovePin,
"Remove PIN", "Do you want to remove PIN protection?");
}
else
{
fsm_sendSuccess("PIN removed");
return;
}
}
else
{
if(storage_has_pin())
confirmed = confirm(ButtonRequestType_ButtonRequest_ChangePin,
"Change PIN", "Do you want to change your PIN?");
else
confirmed = confirm(ButtonRequestType_ButtonRequest_CreatePin,
"Create PIN", "Do you want to add PIN protection?");
}
if(!confirmed)
{
fsm_sendFailure(FailureType_Failure_ActionCancelled,
removal ? "PIN removal cancelled" : "PIN change cancelled");
go_home();
return;
}
if(!pin_protect("Enter Current PIN"))
{
go_home();
return;
}
if(removal)
{
storage_set_pin(0);
storage_commit();
fsm_sendSuccess("PIN removed");
}
else
{
if(change_pin())
{
storage_commit();
fsm_sendSuccess("PIN changed");
}
}
go_home();
}
开发者ID:dashpay,项目名称:keepkey-firmware,代码行数:59,代码来源:fsm.c
示例6: addStudents
/* addStudents
function with loop to add students one at a time
in: none
out: none
*/
void addStudents()
{
// declarations
char firstName[32]; // store input first name
char lastName[32]; // store input last name
int completedCredits; // store input completed credits
struct DATE enrollmentDate; // store input enrollment date
struct STUDENT *s; // pointer to a student record
// print header
printf("Add Students\n============\n\n"
"Start entering students. Leave first name blank to stop.\n\n");
// outer loop for entering another student
do {
// inner loop for repeating incorrect entry
do {
// print # entering
printf("Student #%d\n", numStudents + 1);
// get input from user
strcpy(firstName, inputString("First name: ", 32));
if (strcmp(firstName, "") == 0) return;
strcpy(lastName, inputString("Last name: ", 32));
if (strcmp(lastName, "") == 0) return;
completedCredits = inputInteger("Completed credits: ");
enrollmentDate = inputDate("Enrollment date (mm/dd/yyyy): ");
// display input info back to user
printf("\nFirst name: %s\n"
"Last name: %s\n"
"Completed credits: %d\n"
"Enrollment date: %s\n",
firstName,
lastName,
completedCredits,
formatDate(enrollmentDate));
// repeat if info incorrect
} while (!confirm("Info correct (y/n) ?"));
// get pointer to new student
s = &students[numStudents];
// put info into array at pointer
strcpy(s->firstName, firstName);
strcpy(s->lastName, lastName);
s->completedCredits = completedCredits;
s->enrollmentDate = enrollmentDate;
// increment # of students
numStudents ++;
// loop if user wants to input another student
} while (confirm("Add another student (y/n) ?"));
}
开发者ID:railsfanatic,项目名称:SSE290E,代码行数:63,代码来源:students.c
示例7: HistogramMatchDialog
QDialog *HistogramMatchProcessor::getOptionDialog(Area area, const MyImage& image)
{
HistogramMatchDialog *result = new HistogramMatchDialog(image.getImage());
connect(result,
SIGNAL(confirm(QString)),
this,
SLOT(confirm(QString)));
return result;
}
开发者ID:SidneyTTW,项目名称:ImageProcessor,代码行数:9,代码来源:histogrammatchprocessor.cpp
示例8: main
int main (int argc, char *argv[]) {
int test1 = addOneToTen();
if(confirm(test1)) {
printTenPlusOneEqualsEleven();
}
int test2 = addOneToTen();
if (confirm(test2)) {
printTenPlusOneEqualsEleven();
}
}
开发者ID:stephenscottsmith,项目名称:CMSI_386_Programming_Languages,代码行数:10,代码来源:staticVariableProgram.c
示例9: HistogramEqualizationOptionWidget
QWidget *HistogramEqualizationProcessor::optionWidget()
{
if (_optionWidget == NULL)
{
_optionWidget = new HistogramEqualizationOptionWidget(_tunel);
connect(_optionWidget,
SIGNAL(changeToTunel(ImageAlgorithm::RGBAField)),
this,
SLOT(changeToTunel(ImageAlgorithm::RGBAField)));
connect(_optionWidget, SIGNAL(confirm()), this, SLOT(confirm()));
}
return _optionWidget;
}
开发者ID:SidneyTTW,项目名称:ImageProcessor,代码行数:13,代码来源:histogramequalizationprocessor.cpp
示例10: ToGrayOptionWidget
QWidget *ToGrayProcessor::optionWidget()
{
if (_optionWidget == NULL)
{
_optionWidget = new ToGrayOptionWidget(_type);
connect(_optionWidget,
SIGNAL(optionChanged(ImageAlgorithm::ImageToGrayAlgorithmType)),
this,
SLOT(changeToType(ImageAlgorithm::ImageToGrayAlgorithmType)));
connect(_optionWidget, SIGNAL(confirm()), this, SLOT(confirm()));
}
return _optionWidget;
}
开发者ID:SidneyTTW,项目名称:ImageProcessor,代码行数:13,代码来源:tograyprocessor.cpp
示例11: showStatusMessage
bool StaticPage::validateQuickSettings() {
if(!(ui->quickConfigSlot1Radio->isChecked() ||
ui->quickConfigSlot2Radio->isChecked())) {
emit showStatusMessage(ERR_CONF_SLOT_NOT_SELECTED, 1);
return false;
}
//Check if configuration slot 1 is being programmed
if (ui->quickStaticLenTxt->text().toInt() == 0) {
QMessageBox::critical(this, ERR, WARN_EMPTY_PASS);
return false;
}
QSettings settings;
//Check if configuration slot 1 is being programmed
if (!settings.value(SG_OVERWRITE_CONF_SLOT1).toBool() &&
ui->quickConfigSlot1Radio->isChecked() &&
m_keysProgrammedCtr == 0) {
//Confirm from client
ConfirmBox confirm(this);
confirm.setConfirmIndex(ConfirmBox::Confirm_ConfigurationSlot);
int ret = confirm.exec();
switch (ret) {
case 1: //Yes
break;
default: //No
return false;
}
}
//Check if logging is disabled and
//configuration protection is being enabled
if(!settings.value(SG_ENABLE_CONF_PROTECTION).toBool() &&
!YubiKeyLogger::isLogging() &&
ui->quickConfigProtectionCombo->currentIndex() == CONFIG_PROTECTION_ENABLE) {
//Confirm from client
ConfirmBox confirm(this);
confirm.setConfirmIndex(ConfirmBox::Confirm_ConfigurationProtection);
int ret = confirm.exec();
switch (ret) {
case 1: //Yes
break;
default: //No
return false;
}
}
return true;
}
开发者ID:wzzrd,项目名称:yubikey-personalization-gui,代码行数:51,代码来源:staticpage.cpp
示例12: cmdReview
int cmdReview (const std::vector <std::string>& args, bool autoClear)
{
// Is there a specified limit?
unsigned int limit = 0;
if (args.size () == 2)
limit = strtol (args[1].c_str (), NULL, 10);
// Configure 'reviewed' UDA, but only if necessary.
std::string input;
std::string output;
auto status = execute ("task", {"_get", "rc.uda.reviewed.type"}, input, output);
if (status || output != "date\n")
{
if (confirm ("Tasksh needs to define a 'reviewed' UDA of type 'date' for all tasks. Ok to proceed?"))
{
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "uda.reviewed.type", "date"}, input, output);
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "uda.reviewed.label", "Reviewed"}, input, output);
}
}
// Configure '_reviewed' report, but only if necessary.
status = execute ("task", {"_get", "rc.report._reviewed.columns"}, input, output);
if (status || output != "uuid\n")
{
if (confirm ("Tasksh needs to define a '_reviewed' report to identify tasks needing review. Ok to proceed?"))
{
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.description",
"Tasksh review report. Adjust the filter to your needs." }, input, output);
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.columns", "uuid" }, input, output);
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.sort", "reviewed+,modified+"}, input, output);
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.filter",
"( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING or +WAITING )" }, input, output);
}
}
// Obtain a list of UUIDs to review.
status = execute ("task",
{
"rc.color=off",
"rc.detection=off",
"rc._forcecolor=off",
"rc.verbose=nothing",
"_reviewed"
},
input, output);
// Review the set of UUIDs.
auto uuids = split (Lexer::trimRight (output, "\n"), '\n');
reviewLoop (uuids, limit, autoClear);
return 0;
}
开发者ID:GothenburgBitFactory,项目名称:taskshell,代码行数:51,代码来源:review.cpp
示例13: confirm_cipher
/*
* confirm_cipher() - Show cipher confirmation
*
* INPUT
* - encrypt: true/false whether we are encrypting
* - key: string of key value
* OUTPUT
* true/false of confirmation
*/
bool confirm_cipher(bool encrypt, const char *key)
{
bool ret_stat;
if(encrypt) {
ret_stat = confirm(ButtonRequestType_ButtonRequest_Other,
"Encrypt Key Value", key);
} else {
ret_stat = confirm(ButtonRequestType_ButtonRequest_Other,
"Decrypt Key Value", key);
}
return(ret_stat);
}
开发者ID:jmaurice,项目名称:keepkey-firmware,代码行数:23,代码来源:app_confirm.c
示例14: confirm_encrypt_msg
/*
* confirm_encrypt_msg() - Show encrypt message confirmation
*
* INPUT
* - msg: message to encrypt
* - signing: true/false whether we are signing along with encryption
* OUTPUT
* true/false of confirmation
*/
bool confirm_encrypt_msg(const char *msg, bool signing)
{
bool ret_stat;
if(signing) {
ret_stat = confirm(ButtonRequestType_ButtonRequest_ProtectCall,
"Encrypt and Sign Message", msg);
} else {
ret_stat = confirm(ButtonRequestType_ButtonRequest_ProtectCall,
"Encrypt Message", msg);
}
return(ret_stat);
}
开发者ID:jmaurice,项目名称:keepkey-firmware,代码行数:23,代码来源:app_confirm.c
示例15: confirm_load_device
/*
* confirm_load_device() - Show load device confirmation
*
* INPUT
* - is_node: true/false whether this is an hdnode
* OUTPUT
* true/false of confirmation
*
*/
bool confirm_load_device(bool is_node)
{
bool ret_stat;
if(is_node) {
ret_stat = confirm(ButtonRequestType_ButtonRequest_ProtectCall,
"Import Private Key", "Importing is not recommended unless you understand the risks. Do you want to import private key?");
} else {
ret_stat = confirm(ButtonRequestType_ButtonRequest_ProtectCall,
"Import Recovery Sentence", "Importing is not recommended unless you understand the risks. Do you want to import recovery sentence?");
}
return(ret_stat);
}
开发者ID:jmaurice,项目名称:keepkey-firmware,代码行数:23,代码来源:app_confirm.c
示例16: QDialog
AddManagerDialog::AddManagerDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AddManagerDialog)
{
ui->setupUi(this);
ui->passwordLineEdit->setEchoMode(QLineEdit::Password);
ui->confirmPasswordLineEdit->setEchoMode(QLineEdit::Password);
connect(ui->nameLineEdit,SIGNAL(textChanged(QString)),this,SLOT(confirm()));
connect(ui->passwordLineEdit,SIGNAL(textChanged(QString)),this,SLOT(confirm()));
connect(ui->confirmPasswordLineEdit,SIGNAL(textChanged(QString)),this,SLOT(confirm()));
connect(this,SIGNAL(isConfirmed(bool)),ui->okButton,SLOT(setEnabled(bool)));
}
开发者ID:qwertylevel3,项目名称:bookManagement,代码行数:14,代码来源:addmanagerdialog.cpp
示例17: confirm_decrypt_msg
/*
* confirm_decrypt_msg() - Show decrypt message confirmation
*
* INPUT
* - msg: decrypted message
* - address: address used to sign message
* OUTPUT
* true/false of confirmation
*
*/
bool confirm_decrypt_msg(const char *msg, const char *address)
{
bool ret_stat;
if(address) {
ret_stat = confirm(ButtonRequestType_ButtonRequest_Other,
"Decrypted Signed Message", msg);
} else {
ret_stat = confirm(ButtonRequestType_ButtonRequest_Other,
"Decrypted Message", msg);
}
return(ret_stat);
}
开发者ID:jmaurice,项目名称:keepkey-firmware,代码行数:24,代码来源:app_confirm.c
示例18: confirm
bool CmdConfig::setConfigVariable (std::string name, std::string value, bool confirmation /* = false */)
{
// Read .taskrc (or equivalent)
std::vector <std::string> contents;
File::read (context.config._original_file, contents);
bool found = false;
bool change = false;
std::vector <std::string>::iterator line;
for (line = contents.begin (); line != contents.end (); ++line)
{
// If there is a comment on the line, it must follow the pattern.
std::string::size_type comment = line->find ("#");
std::string::size_type pos = line->find (name + "=");
if (pos != std::string::npos &&
(comment == std::string::npos ||
comment > pos))
{
found = true;
if (!confirmation ||
confirm (format (STRING_CMD_CONFIG_CONFIRM, name, context.config.get (name), value)))
{
if (comment != std::string::npos)
*line = name + "=" + json::encode (value) + " " + line->substr (comment);
else
*line = name + "=" + json::encode (value);
change = true;
}
}
}
// Not found, so append instead.
if (!found &&
(!confirmation ||
confirm (format (STRING_CMD_CONFIG_CONFIRM2, name, value))))
{
contents.push_back (name + "=" + json::encode (value));
change = true;
}
if (change)
File::write (context.config._original_file, contents);
return change;
}
开发者ID:JensErat,项目名称:task,代码行数:48,代码来源:CmdConfig.cpp
示例19: delete_click
static void
delete_click(GtkWidget * w, gpointer p)
{
BkPtDlgData *bpd = p;
if (! bpd->bpi)
{
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(gdbui_setup.main_window),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
_("No %s selected"), is_watchlist ? _("watchpoint") : _("breakpoint"));
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
return;
}
if (confirm(is_watchlist ? _("Delete selected watchpoint?") : _("Delete selected breakpoint?")))
{
gdbui_enable(FALSE);
gdbio_delete_break(break_dlg, bpd->bpi->number);
prev_resp = dlgRespDeleteConfirmed;
gtk_dialog_response(GTK_DIALOG(bpd->dlg), dlgRespDeleteConfirmed);
}
else
{
gtk_dialog_response(GTK_DIALOG(bpd->dlg), dlgRespDeleteCancelled);
}
}
开发者ID:Enrix835,项目名称:geany-plugins,代码行数:27,代码来源:gdb-ui-break.c
示例20: giveControlTo
void ResetWidget::dealReleased(QPointF mousePos, Qt::MouseButton button)
{
if (itemAtPressPos == confirmItem &&
confirmItem->in(mousePos, LOGICAL_WIDTH, LOGICAL_HEIGHT))
{
// Exit
emit giveControlTo(NULL, true);
// Emit correct signal
emit confirm();
delete this;
return;
}
else if (itemAtPressPos == cancelItem &&
cancelItem->in(mousePos, LOGICAL_WIDTH, LOGICAL_HEIGHT))
{
// Exit
emit giveControlTo(NULL, true);
// Emit correct signal
emit cancel();
delete this;
return;
}
itemAtPressPos = NULL;
}
开发者ID:tecton,项目名称:HexGame,代码行数:27,代码来源:resetwidget.cpp
注:本文中的confirm函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论