本文整理汇总了C++中FLTableMetaData::fieldsNames方法的典型用法代码示例。如果您正苦于以下问题:C++ FLTableMetaData::fieldsNames方法的具体用法?C++ FLTableMetaData::fieldsNames怎么用?C++ FLTableMetaData::fieldsNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLTableMetaData
的用法示例。
在下文中一共展示了FLTableMetaData::fieldsNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nombreCampos
QStringList FLUtil::nombreCampos( const QString & tabla ) {
QStringList res;
if ( FLSqlConnections::database()->managerModules()->shaOfFile( tabla + ".mtd" ).isEmpty() )
return res;
FLSqlCursor c( tabla );
FLTableMetaData * tmd = c.metadata();
if ( !tmd )
return res;
res = QStringList::split( ",", tmd->fieldsNames() );
res.prepend( QString::number( res.size() ) );
return res;
}
示例2: recordInfo
QSqlRecordInfo SqliteDriver::recordInfo(const QString &tablename) const
{
QSqlRecordInfo info;
if (!isOpen() || !dataBase_)
return info;
QDomDocument doc(tablename);
QDomElement docElem;
QString stream = db_->managerModules()->contentCached(tablename + ".mtd");
if (!FLUtil::domDocumentSetContent(doc, stream)) {
#ifdef FL_DEBUG
qWarning("FLManager : " + QApplication::tr("Error al cargar los metadatos para la tabla %1").arg(tablename));
#endif
return recordInfo2(tablename);
}
docElem = doc.documentElement();
FLTableMetaData *mtd = db_->manager()->metadata(&docElem, true);
if (!mtd)
return recordInfo2(tablename);
FLTableMetaData::FLFieldMetaDataList *fl = mtd->fieldList();
if (!fl) {
delete mtd;
return recordInfo2(tablename);
}
if (fl->isEmpty()) {
delete mtd;
return recordInfo2(tablename);
}
QStringList fieldsNames = QStringList::split(",", mtd->fieldsNames());
for (QStringList::Iterator it = fieldsNames.begin(); it != fieldsNames.end(); ++it) {
FLFieldMetaData *field = mtd->field((*it));
info.append(QSqlFieldInfo(field->name(), FLFieldMetaData::flDecodeType(field->type())));
}
delete mtd;
return info;
}
示例3: while
//.........这里部分代码省略.........
no = no.nextSibling();
continue;
}
if (e.tagName() == "concurWarn") {
cw = (e.text() == "true");
no = no.nextSibling();
continue;
}
if (e.tagName() == "detectLocks") {
dl = (e.text() == "true");
no = no.nextSibling();
continue;
}
}
no = no.nextSibling();
}
FLTableMetaData *tmd = new FLTableMetaData(name, a, q);
FLCompoundKey *cK = 0;
QStringList assocs;
tmd->setConcurWarn(cw);
tmd->setDetectLocks(dl);
no = mtd->firstChild();
while (!no.isNull()) {
QDomElement e = no.toElement();
if (!e.isNull()) {
if (e.tagName() == "field") {
FLFieldMetaData *f = metadataField(&e, v, ed);
if (!tmd)
tmd = new FLTableMetaData(name, a, q);
tmd->addFieldMD(f);
if (f->isCompoundKey()) {
if (!cK)
cK = new FLCompoundKey();
cK->addFieldMD(f);
}
if (!f->associatedFieldName().isEmpty()) {
assocs.append(f->associatedFieldName());
assocs.append(f->associatedFieldFilterTo());
assocs.append(f->name());
}
no = no.nextSibling();
continue;
}
}
no = no.nextSibling();
}
tmd->setCompoundKey(cK);
QString aWith, aBy;
for (QStringList::Iterator it = assocs.begin(); it != assocs.end(); ++it) {
aWith = (*it);
++it;
aBy = (*it);
++it;
tmd->field((*it))->setAssociatedField(tmd->field(aWith), aBy);
}
if (!q.isEmpty() && !quick) {
FLSqlQuery *qry = query(q, tmd);
if (qry) {
QStringList fL = qry->fieldList();
QString table, field;
QString fields = tmd->fieldsNames();
for (QStringList::Iterator it = fL.begin(); it != fL.end(); ++it) {
table = (*it).section('.', 0, 0);
field = (*it).section('.', 1, 1);
if (table == name || fields.contains(field.lower()))
continue;
FLTableMetaData *mtdAux = metadata(table, true);
if (mtdAux) {
FLFieldMetaData *fmtdAux = mtdAux->field(field);
if (fmtdAux) {
int typeAux = fmtdAux->type();
if (typeAux == FLFieldMetaData::Serial)
typeAux = QVariant::UInt;
tmd->addFieldMD(new FLFieldMetaData(field, fmtdAux->alias(), true, false, typeAux, fmtdAux->length(),
false, fmtdAux->visible(), fmtdAux->editable(), fmtdAux->partInteger(),
fmtdAux->partDecimal(), false, false, false, QVariant(), false,
QString::null, fmtdAux->visibleGrid(), true, false));
}
}
}
qry->deleteLater();
}
}
FLAccessControlLists *acl = aqApp ->acl();
if (acl)
acl->process(tmd);
return tmd;
}