本文整理汇总了C++中RDEscapeString函数的典型用法代码示例。如果您正苦于以下问题:C++ RDEscapeString函数的具体用法?C++ RDEscapeString怎么用?C++ RDEscapeString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RDEscapeString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void EditJack::okData()
{
QString sql;
RDSqlQuery *q;
RDListViewItem *item=NULL;
edit_station->setStartJack(edit_start_jack_box->isChecked());
if(edit_jack_server_name_edit->text()==EDITJACK_DEFAULT_SERVERNAME) {
edit_station->setJackServerName("");
}
else {
edit_station->setJackServerName(edit_jack_server_name_edit->text());
}
edit_station->setJackCommandLine(edit_jack_command_line_edit->text());
item=(RDListViewItem *)edit_jack_client_view->firstChild();
while(item!=NULL) {
sql=QString("update JACK_CLIENTS set DESCRIPTION=\"")+
RDEscapeString(item->text(0))+"\",COMMAND_LINE=\""+
RDEscapeString(item->text(1))+"\" where ID="+
QString().sprintf("%d",item->id());
q=new RDSqlQuery(sql);
delete q;
item=(RDListViewItem *)item->nextSibling();
}
done(0);
}
示例2: QString
//
// Global Classes
//
RDDeck::RDDeck(QString station,unsigned channel,bool create)
{
RDSqlQuery *q;
QString sql;
deck_station=station;
deck_channel=channel;
if(create) {
sql=QString("select ID from DECKS where ")+
"(STATION_NAME=\""+RDEscapeString(deck_station)+"\")&&"+
QString().sprintf("(CHANNEL=%d)",deck_channel);
q=new RDSqlQuery(sql);
if(q->size()!=1) {
delete q;
sql=QString().
sprintf("insert into DECKS set ")+
"STATION_NAME=\""+RDEscapeString(deck_station)+"\","+
QString().sprintf("CHANNEL=%d",deck_channel);
q=new RDSqlQuery(sql);
delete q;
}
else {
delete q;
}
}
}
示例3: switch
QString ListVguestResources::ModelSql(RDMatrix::VguestType type) const
{
QString sql;
switch(type) {
case RDMatrix::VguestTypeRelay:
sql=QString("select ")+
"NUMBER,"+
"ENGINE_NUM,"+
"DEVICE_NUM,"+
"SURFACE_NUM,"+
"RELAY_NUM "+
"from VGUEST_RESOURCES where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(VGUEST_TYPE=%d) ",list_type)+
"order by NUMBER";
break;
case RDMatrix::VguestTypeDisplay:
sql=QString("select ")+
"NUMBER,"+
"ENGINE_NUM,"+
"DEVICE_NUM,"+
"SURFACE_NUM "+
"from VGUEST_RESOURCES where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(VGUEST_TYPE=%d) ",list_type)+
"order by NUMBER";
break;
}
return sql;
}
示例4: char
void MainObject::Revert259() const
{
QString sql;
QSqlQuery *q;
QSqlQuery *q1;
for(int i=0;i<168;i++) {
sql=QString().sprintf("alter table SERVICES add column CLOCK%d char(64)",i);
q=new QSqlQuery(sql);
delete q;
}
sql=QString("select SERVICE_NAME,HOUR,CLOCK_NAME from SERVICE_CLOCKS");
q=new QSqlQuery(sql);
while(q->next()) {
sql=QString("update SERVICES set ")+
QString().sprintf("CLOCK%d=",q->value(1).toInt());
if(q->value(2).isNull()) {
sql+="null ";
}
else {
sql+="\""+RDEscapeString(q->value(2).toString())+"\" ";
}
sql+="where NAME=\""+RDEscapeString(q->value(0).toString())+"\"";
q1=new QSqlQuery(sql);
delete q1;
}
delete q;
sql=QString("drop table SERVICE_CLOCKS");
q=new QSqlQuery(sql);
delete q;
SetVersion(258);
}
示例5: QString
//
// Global Classes
//
RDTty::RDTty(const QString &station,unsigned port_id,bool create)
{
RDSqlQuery *q;
QString sql;
tty_station=station;
tty_id=port_id;
if(create) {
sql=QString("select ID from TTYS where ")+
"(STATION_NAME=\""+RDEscapeString(tty_station)+"\")&&"+
QString().sprintf("(PORT_ID=%d)",tty_id);
q=new RDSqlQuery(sql);
if(q->size()!=1) {
delete q;
sql=QString().sprintf("insert into TTYS set ")+
"STATION_NAME=\""+RDEscapeString(tty_station)+"\","+
QString().sprintf("PORT_ID=%d",tty_id);
q=new RDSqlQuery(sql);
delete q;
}
else {
delete q;
}
}
}
示例6: switch
void RDLog::updateLinkQuantity(RDLog::Source src) const
{
QString sql;
RDSqlQuery *q;
switch(src) {
case RDLog::SourceMusic:
sql=QString("select ID from `")+RDLog::tableName(log_name)+
"` where "+QString().sprintf("TYPE=%d",RDLogLine::MusicLink);
q=new RDSqlQuery(sql);
sql=QString("update LOGS set ")+
QString().sprintf("MUSIC_LINKS=%d ",q->size())+
"where NAME=\""+RDEscapeString(log_name)+"\"";
break;
case RDLog::SourceTraffic:
sql=QString("select ID from `")+RDLog::tableName(log_name)+
"` where "+QString().sprintf("TYPE=%d",RDLogLine::TrafficLink);
q=new RDSqlQuery(sql);
sql=QString("update LOGS set ")+
QString().sprintf("TRAFFIC_LINKS=%d ",q->size())+
"where NAME=\""+RDEscapeString(log_name)+"\"";
break;
default:
return;
}
delete q;
q=new RDSqlQuery(sql);
delete q;
}
示例7: QSqlQuery
void MainObject::Revert251() const
{
QString sql;
QSqlQuery *q;
QSqlQuery *q1;
QSqlQuery *q2;
if(rev_use_deadzone) {
sql=QString("select NAME from CLOCKS");
q=new QSqlQuery(sql);
while(q->next()) {
sql=RDCreateClockTableSql(RDClock::tableName(q->value(0).toString()));
q1=new QSqlQuery(sql);
delete q1;
sql=QString("select EVENT_NAME,START_TIME,LENGTH from CLOCK_METADATA ")+
"where CLOCK_NAME=\""+RDEscapeString(q->value(0).toString())+"\" "+
"order by START_TIME";
q1=new QSqlQuery(sql);
while(q1->next()) {
sql=QString("insert into `")+
RDClock::tableName(q->value(0).toString())+"` set "+
"EVENT_NAME=\""+RDEscapeString(q1->value(0).toString())+"\","+
QString().sprintf("START_TIME=%d,",q1->value(1).toInt())+
QString().sprintf("LENGTH=%d",q1->value(2).toInt());
q2=new QSqlQuery(sql);
delete q2;
}
delete q1;
}
delete q;
}
SetVersion(250);
}
示例8: RDLog
void MainObject::Saveas(const QString &logname)
{
QString sql;
RDSqlQuery *q;
RDLog *log=new RDLog(logname);
if(!log->exists()) {
sql=QString("insert into LOGS set ")+
"NAME=\""+RDEscapeString(logname)+"\","+
"TYPE=0,"+
"DESCRIPTION=\""+RDEscapeString(edit_description)+"\","+
"ORIGIN_USER=\""+RDEscapeString(rda->user()->name())+"\","+
"ORIGIN_DATETIME=now(),"+
"LINK_DATETIME=now(),"+
"MODIFIED_DATETIME=now(),"+
"START_DATE="+RDCheckDateTime(edit_start_date,"yyyy-MM-dd")+","+
"END_DATE="+RDCheckDateTime(edit_end_date,"yyyy-MM-dd")+","+
"PURGE_DATE="+RDCheckDateTime(edit_purge_date,"yyyy-MM-dd")+","+
"AUTO_REFRESH=\""+RDYesNo(edit_auto_refresh)+"\","+
"SERVICE=\""+RDEscapeString(edit_service)+"\"";
q=new RDSqlQuery(sql);
delete q;
RDCreateLogTable(RDLog::tableName(logname));
edit_log_event->setLogName(RDLog::tableName(logname));
edit_log_event->save();
delete edit_log;
edit_log=log;
edit_modified=false;
edit_new_log=false;
}
else {
fprintf(stderr,"saveas: log already exists\n");
delete log;
}
}
示例9: RDGetSqlValue
QVariant RDGetSqlValue(const QString &table,
const QString &name1,const QString &test1,
const QString &name2,const QString &test2,
const QString &name3,const QString &test3,
const QString ¶m,QSqlDatabase *db,bool *valid)
{
RDSqlQuery *q;
QString sql;
QVariant v;
sql="select `"+param+"` from `"+table+"` where "+
"(`"+name1+"`=\""+RDEscapeString(test1)+"\")&&"+
"(`"+name2+"`=\""+RDEscapeString(test1)+"\")&&"+
"(`"+name3+"`=\""+RDEscapeString(test1)+"\")";
q=new RDSqlQuery(sql,db);
if(q->isActive()) {
q->first();
v=q->value(0);
if(valid!=NULL) {
*valid=!q->isNull(0);
}
delete q;
return v;
}
delete q;
return QVariant();
}
示例10: RefreshList
void MainWidget::RefreshList()
{
RDSqlQuery *q;
QString sql;
ListListViewItem *item;
log_log_list->clear(); // Note: clear here, in case user has no perms.
sql=QString("select NAME from LOGS where ")+
"(TYPE=0)&&"+
"(LOG_EXISTS=\"Y\")";
if(log_service_box->currentItem()!=0) {
sql+="&&(SERVICE=\""+RDEscapeString(log_service_box->currentText())+"\")";
}
QString filter=log_filter_edit->text();
if(!filter.isEmpty()) {
sql+="&&((NAME like \"%%"+RDEscapeString(filter)+"%%\")||";
sql+="(DESCRIPTION like \"%%"+RDEscapeString(filter)+"%%\")||";
sql+="(SERVICE like \"%%"+RDEscapeString(filter)+"%%\"))";
}
if(log_recent_check->isChecked()) {
sql+=QString().sprintf("order by ORIGIN_DATETIME desc limit %d",
RDLOGEDIT_LIMIT_QUAN);
}
q=new RDSqlQuery(sql);
while(q->next()) {
item=new ListListViewItem(log_log_list);
item->setText(1,q->value(0).toString());
RefreshItem(item);
}
delete q;
}
示例11: where
void AddEncoder::okData()
{
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("select NAME from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(encoder_name_edit->text()),
(const char *)RDEscapeString(encoder_stationname));
q=new RDSqlQuery(sql);
if(q->first()) {
QMessageBox::warning(this,tr("Add Encoder Error"),
tr("A encoder with that name already exists!"));
delete q;
return;
}
delete q;
//
// Create Encoder
//
sql=QString().sprintf("insert into ENCODERS set NAME=\"%s\",\
STATION_NAME=\"%s\"",
(const char *)RDEscapeString(encoder_name_edit->text()),
(const char *)RDEscapeString(encoder_stationname));
q=new RDSqlQuery(sql);
delete q;
*encoder_name=encoder_name_edit->text();
done(0);
}
示例12: AddEncoder
void ListEncoders::addData()
{
QString name;
QString sql;
RDSqlQuery *q;
RDSqlQuery *q1;
AddEncoder *ad=new AddEncoder(&name,list_stationname,this);
if(ad->exec()==0) {
sql=QString().sprintf("select ID from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(name),
(const char *)RDEscapeString(list_stationname));
q=new RDSqlQuery(sql);
if(q->first()) {
EditEncoder *ee=new EditEncoder(q->value(0).toInt());
if(ee->exec()==0) {
RDListViewItem *item=new RDListViewItem(list_list_view);
item->setId(q->value(0).toInt());
item->setText(0,name);
RefreshItem(item);
list_list_view->ensureItemVisible(item);
}
else {
sql=QString().sprintf("delete from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(name),
(const char *)RDEscapeString(list_stationname));
q1=new RDSqlQuery(sql);
delete q1;
}
delete ee;
}
示例13: RDSqlQuery
QString RDCartDialog::GetSearchFilter(const QString &filter,
const QString &group,
const QString &schedcode)
{
QString sql;
RDSqlQuery *q;
QString sched="";
if(schedcode!=tr("ALL")) {
sched=schedcode;
}
QString search=RDCartSearchText(filter,group,sched,false).utf8();
//
// Excluded Groups
//
sql=QString().sprintf("select NAME from GROUPS where ");
for(int i=1;i<cart_group_box->count();i++) {
sql+=QString("(NAME!=\"")+RDEscapeString(cart_group_box->text(i))+"\")&&";
}
sql=sql.left(sql.length()-2);
q=new RDSqlQuery(sql);
while(q->next()) {
search+=QString("&&(GROUP_NAME!=\"")+
RDEscapeString(q->value(0).toString())+"\")";
}
delete q;
return search;
}
示例14: SetRow
void RDStation::SetRow(const QString ¶m,const QString &value) const
{
RDSqlQuery *q;
QString sql;
sql=QString("update STATIONS set ")+
param+"=\""+RDEscapeString(value)+"\" where "+
"NAME=\""+RDEscapeString(station_name)+"\"";
q=new RDSqlQuery(sql);
delete q;
}
示例15: QString
void EditNode::okData()
{
QString sql;
RDSqlQuery *q;
if(edit_password_changed) {
edit_password=edit_password_edit->text();
}
if((*edit_id)<0) {
sql=QString("select ID from SWITCHER_NODES where ")+
"(STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\") && "+
QString().sprintf("(MATRIX=%d) && ",edit_matrix->matrix())+
"(HOSTNAME=\""+RDEscapeString(edit_hostname_edit->text())+"\") && "+
QString().sprintf("(TCP_PORT=%d)",edit_tcpport_spin->value());
q=new RDSqlQuery(sql);
if(q->first()) {
delete q;
QMessageBox::warning(this,tr("Duplicate Node"),
tr("That node is already listed for this matrix!"));
return;
}
delete q;
sql="select ID from SWITCHER_NODES order by ID desc";
q=new RDSqlQuery(sql);
if(q->first()) {
*edit_id=q->value(0).toInt()+1;
}
else {
*edit_id=1;
}
delete q;
sql=QString("insert into SWITCHER_NODES set ")+
QString().sprintf("ID=%d,",*edit_id)+
"STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\","+
QString().sprintf("MATRIX=%d,",edit_matrix->matrix())+
"HOSTNAME=\""+RDEscapeString(edit_hostname_edit->text())+"\","+
QString().sprintf("TCP_PORT=%d,",edit_tcpport_spin->value())+
"DESCRIPTION=\""+RDEscapeString(edit_description_edit->text())+"\""+
QString().sprintf("BASE_OUTPUT=%d,",edit_output_spin->value())+
"PASSWORD=\""+RDEscapeString(edit_password)+"\"";
q=new RDSqlQuery(sql);
delete q;
}
else {
sql=QString("update SWITCHER_NODES set ")+
"HOSTNAME=\""+RDEscapeString(edit_hostname_edit->text())+"\","+
QString().sprintf("TCP_PORT=%d,",edit_tcpport_spin->value())+
"DESCRIPTION=\""+RDEscapeString(edit_description_edit->text())+"\","+
QString().sprintf("BASE_OUTPUT=%d,",edit_output_spin->value())+
"PASSWORD=\""+RDEscapeString(edit_password)+"\" where "+
QString().sprintf("ID=%d",*edit_id);
q=new RDSqlQuery(sql);
delete q;
}
done(0);
}