本文整理汇总了C++中Import类的典型用法代码示例。如果您正苦于以下问题:C++ Import类的具体用法?C++ Import怎么用?C++ Import使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Import类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QString
QString Formatting::importMetaData( const Import & import ) {
if ( import.isNull() )
return QString();
if ( import.error().isCanceled() )
return i18n( "The import of this certificate was canceled." );
if ( import.error() )
return i18n( "An error occurred importing this certificate: %1",
QString::fromLocal8Bit( import.error().asString() ) );
const unsigned int status = import.status();
if ( status & Import::NewKey )
return ( status & Import::ContainedSecretKey )
? i18n( "This certificate was new to your keystore. The secret key is available." )
: i18n( "This certificate is new to your keystore." ) ;
QStringList results;
if ( status & Import::NewUserIDs )
results.push_back( i18n( "New user-ids were added to this certificate by the import." ) );
if ( status & Import::NewSignatures )
results.push_back( i18n( "New signatures were added to this certificate by the import." ) );
if ( status & Import::NewSubkeys )
results.push_back( i18n( "New subkeys were added to this certificate by the import." ) );
return results.empty()
? i18n( "The import contained no new data for this certificate. It is unchanged.")
: results.join( "\n" );
}
示例2: main
int main(){
dTable table;
vector<dTable> A;
vector<dTable> M;
std::string filename = "test1";
Import data;
table = data.tabulate(filename);
RawMeasurementTables records;
records.setMagnetometerData(data.getMagnet(table,5,6));
records.setAccelerometerData(data.getAccel(table,5,7));
A = records.getAccelerometerData();
M = records.getMagnetometerData();
for(int i = 0; i<A.size();i++){
for(int j = 0;j<A[i].size();j++){
for(int k = 0; k < A[i][j].size();k++){
cout << A[i][j][k];
cout << ",";
}
cout << endl;
}
cout << "------" << endl;
}
};
示例3: Import
void Manager::on_pushButton_import_clicked()
{
Import *import = new Import(0, currentUser);
import->setup(newCatNum);
import->sendManager(this);
import->show();
}
示例4:
void
ImportsList::remove( long i )
{
Import* import = this->imports->remove( this->imports->atRank( i ) );
import->removeFromCU();
delete import;
}
示例5: setDidRewriting
bool ChangeImportsVisitor::add(QmlJS::AST::UiProgram *ast, const Import &import)
{
setDidRewriting(false);
if (!ast)
return false;
if (ast->headers && ast->headers->headerItem) {
int insertionPoint = 0;
if (ast->members && ast->members->member)
insertionPoint = ast->members->member->firstSourceLocation().begin();
else
insertionPoint = m_source.length();
while (insertionPoint > 0) {
--insertionPoint;
const QChar c = m_source.at(insertionPoint);
if (!c.isSpace() && c != QLatin1Char(';'))
break;
}
replace(insertionPoint+1, 0, QStringLiteral("\n") + import.toImportString());
} else {
replace(0, 0, import.toImportString() + QStringLiteral("\n\n"));
}
setDidRewriting(true);
return true;
}
示例6: new
Statement* Expand::operator()(Import* imp)
{
Import* result = new (ctx.mem) Import(imp->path(), imp->position());
for ( size_t i = 0, S = imp->urls().size(); i < S; ++i) {
result->urls().push_back(imp->urls()[i]->perform(eval->with(env, backtrace)));
}
return result;
}
示例7: toString
bool ChangeImportsVisitor::equals(QmlJS::AST::UiImport *ast, const Import &import)
{
if (import.isLibraryImport())
return toString(ast->importUri) == import.url();
else if (import.isFileImport())
return ast->fileName == import.file();
else
return false;
}
示例8: flatten
bool ChangeImportsVisitor::equals(QmlJS::AST::UiImport *ast, const Import &import)
{
if (import.isLibraryImport()) {
return flatten(ast->importUri) == import.url();
} else if (import.isFileImport()) {
return ast->fileName->asString() == import.file();
} else {
return false;
}
}
示例9: imageImport
void Import::imageImport( const KUrl& url )
{
Import* import = new Import;
import->m_kimFileUrl = url;
if ( !url.isLocalFile() )
import->downloadUrl(url);
else
import->exec(url.path());
// This instance will delete itself when done.
}
示例10: assert
Dsymbol *Import::syntaxCopy(Dsymbol *s)
{
assert(!s);
Import *si = new Import(loc, packages, id, aliasId, isstatic);
for (size_t i = 0; i < names.dim; i++)
{
si->addAlias(names[i], aliases[i]);
}
return si;
}
示例11: process_import
static void
process_import(cxx::Backend& be, std::ofstream& os, const Import& imp) {
// Print a header
os << "// ---------------------------------------------------------\n"
<< "// -- from: `" << imp.load_unit()->path() << "`\n"
<< "// ---------------------------------------------------------\n\n";
for (auto elab: imp.load_unit()->statements()) {
auto tl = be.translate_top_level(elab.code());
format_toplevel(tl, os);
os << "\n\n";
}
os << "// -- end: `" << imp.load_unit()->path() << "`\n\n";
}
示例12: doExport
void
DistObjectKA<Packet,LocalOrdinal,GlobalOrdinal,Node>::
doExport (const SrcDistObject& source,
const Import<LocalOrdinal,GlobalOrdinal,Node> & importer,
CombineMode CM)
{
TEUCHOS_TEST_FOR_EXCEPTION(
*getMap() != *importer.getSourceMap(), std::invalid_argument,
"doExport (reverse mode): The target object's Map "
"is not identical to the Import's source Map.");
#ifdef HAVE_TPETRA_DEBUG
{
typedef DistObjectKA<Packet,LocalOrdinal,GlobalOrdinal,Node> this_type;
const this_type* srcDistObj = dynamic_cast<const this_type*> (&source);
TEUCHOS_TEST_FOR_EXCEPTION(
srcDistObj != NULL && * (srcDistObj->getMap ()) != *importer.getTargetMap(),
std::invalid_argument,
"doExport (reverse mode): The source is a DistObject, yet its "
"Map is not identical to the Import's target Map.");
}
#endif // HAVE_TPETRA_DEBUG
size_t numSameIDs = importer.getNumSameIDs();
typedef ArrayView<const LocalOrdinal> view_type;
view_type exportLIDs = importer.getRemoteLIDs();
view_type remoteLIDs = importer.getExportLIDs();
view_type permuteToLIDs = importer.getPermuteFromLIDs();
view_type permuteFromLIDs = importer.getPermuteToLIDs();
doTransfer (source, CM, numSameIDs, permuteToLIDs, permuteFromLIDs, remoteLIDs,
exportLIDs, importer.getDistributor (), DoReverse);
}
示例13: if
void ConditionalDeclaration::parsepragmas(Module *m)
{
// we only know how to disclude the right version
bool doinclude = true;
if (dynamic_cast<VersionCondition*>(condition)) {
VersionCondition *vc = (VersionCondition *) condition;
if (!(vc->include(NULL, NULL))) {
doinclude = false;
}
} else if (dynamic_cast<DebugCondition*>(condition)) {
DebugCondition *dc = (DebugCondition *) condition;
if (!(dc->include(NULL, NULL))) {
doinclude = false;
}
}
if (doinclude) {
AttribDeclaration::parsepragmas(m);
} else if (elsedecl) {
for (int i = 0; i < elsedecl->dim; i++) {
Dsymbol *ds = (Dsymbol *) elsedecl->data[i];
if (ds->isAttribDeclaration()) {
AttribDeclaration *ad = (AttribDeclaration *) ds;
ad->parsepragmas(m);
} else if (ds->isImport()) {
Import *im = (Import *) ds;
im->load(m, NULL);
im->mod->parsepragmas();
} else if (dynamic_cast<VersionSymbol*>(ds)) {
VersionSymbol *vs = (VersionSymbol *) ds;
vs->addMember(NULL, m, 0);
}
}
}
}
示例14: QFileInfo
void SubComponentManager::removeImport(int pos)
{
const Import import = m_imports.takeAt(pos);
if (import.isFileImport()) {
const QFileInfo dirInfo = QFileInfo(m_filePath.resolved(import.file()).toLocalFile());
const QString canonicalDirPath = dirInfo.canonicalFilePath();
//m_dirToQualifier.remove(canonicalDirPath, import.qualifier()); ### todo: proper support for import as
if (!m_dirToQualifier.contains(canonicalDirPath))
m_watcher.removePath(canonicalDirPath);
// foreach (const QFileInfo &monitoredFile, watchedFiles(canonicalDirPath)) { ### todo: proper support for import as
// if (!m_dirToQualifier.contains(canonicalDirPath))
// unregisterQmlFile(monitoredFile, import.qualifier());
// }
} else {
// TODO: QDeclarativeDomImport::Library
}
}
示例15: MOZ_ALWAYS_TRUE
// Generate a stub that is called via the internal ABI derived from the
// signature of the import and calls into an appropriate InvokeImport C++
// function, having boxed all the ABI arguments into a homogeneous Value array.
ProfilingOffsets
wasm::GenerateInterpExit(MacroAssembler& masm, const Import& import, uint32_t importIndex)
{
const Sig& sig = import.sig();
masm.setFramePushed(0);
// Argument types for InvokeImport_*:
static const MIRType typeArray[] = { MIRType_Pointer, // ImportExit
MIRType_Int32, // argc
MIRType_Pointer }; // argv
MIRTypeVector invokeArgTypes;
MOZ_ALWAYS_TRUE(invokeArgTypes.append(typeArray, ArrayLength(typeArray)));
// At the point of the call, the stack layout shall be (sp grows to the left):
// | stack args | padding | Value argv[] | padding | retaddr | caller stack args |
// The padding between stack args and argv ensures that argv is aligned. The
// padding between argv and retaddr ensures that sp is aligned.
unsigned argOffset = AlignBytes(StackArgBytes(invokeArgTypes), sizeof(double));
unsigned argBytes = Max<size_t>(1, sig.args().length()) * sizeof(Value);
unsigned framePushed = StackDecrementForCall(masm, ABIStackAlignment, argOffset + argBytes);
ProfilingOffsets offsets;
GenerateExitPrologue(masm, framePushed, ExitReason::ImportInterp, &offsets);
// Fill the argument array.
unsigned offsetToCallerStackArgs = sizeof(AsmJSFrame) + masm.framePushed();
Register scratch = ABIArgGenerator::NonArgReturnReg0;
FillArgumentArray(masm, sig.args(), argOffset, offsetToCallerStackArgs, scratch);
// Prepare the arguments for the call to InvokeImport_*.
ABIArgMIRTypeIter i(invokeArgTypes);
// argument 0: importIndex
if (i->kind() == ABIArg::GPR)
masm.mov(ImmWord(importIndex), i->gpr());
else
masm.store32(Imm32(importIndex), Address(masm.getStackPointer(), i->offsetFromArgBase()));
i++;
// argument 1: argc
unsigned argc = sig.args().length();
if (i->kind() == ABIArg::GPR)
masm.mov(ImmWord(argc), i->gpr());
else
masm.store32(Imm32(argc), Address(masm.getStackPointer(), i->offsetFromArgBase()));
i++;
// argument 2: argv
Address argv(masm.getStackPointer(), argOffset);
if (i->kind() == ABIArg::GPR) {
masm.computeEffectiveAddress(argv, i->gpr());
} else {
masm.computeEffectiveAddress(argv, scratch);
masm.storePtr(scratch, Address(masm.getStackPointer(), i->offsetFromArgBase()));
}
i++;
MOZ_ASSERT(i.done());
// Make the call, test whether it succeeded, and extract the return value.
AssertStackAlignment(masm, ABIStackAlignment);
switch (sig.ret()) {
case ExprType::Void:
masm.call(SymbolicAddress::InvokeImport_Void);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, JumpTarget::Throw);
break;
case ExprType::I32:
masm.call(SymbolicAddress::InvokeImport_I32);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, JumpTarget::Throw);
masm.unboxInt32(argv, ReturnReg);
break;
case ExprType::I64:
MOZ_CRASH("no int64 in asm.js");
case ExprType::F32:
masm.call(SymbolicAddress::InvokeImport_F64);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, JumpTarget::Throw);
masm.loadDouble(argv, ReturnDoubleReg);
masm.convertDoubleToFloat32(ReturnDoubleReg, ReturnFloat32Reg);
break;
case ExprType::F64:
masm.call(SymbolicAddress::InvokeImport_F64);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, JumpTarget::Throw);
masm.loadDouble(argv, ReturnDoubleReg);
break;
case ExprType::I32x4:
case ExprType::F32x4:
case ExprType::B32x4:
MOZ_CRASH("SIMD types shouldn't be returned from a FFI");
case ExprType::Limit:
MOZ_CRASH("Limit");
}
GenerateExitEpilogue(masm, framePushed, ExitReason::ImportInterp, &offsets);
offsets.end = masm.currentOffset();
return offsets;
}