本文整理汇总了C++中TraceData::file方法的典型用法代码示例。如果您正苦于以下问题:C++ TraceData::file方法的具体用法?C++ TraceData::file怎么用?C++ TraceData::file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TraceData
的用法示例。
在下文中一共展示了TraceData::file方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ensureFile
// make sure that a valid file is set, at least dummy with empty name
void CachegrindLoader::ensureFile()
{
if (currentFile) return;
currentFile = _data->file(_emptyString);
currentPartFile = currentFile->partFile(_part);
}
示例2: compressedFile
// Note: Callgrind sometimes gives different IDs for same file
// (when references to same source file come from different ELF objects)
TraceFile* CachegrindLoader::compressedFile(const QString& name)
{
if ((name[0] != '(') || !name[1].isDigit()) return _data->file(checkUnknown(name));
// compressed format using _fileVector
int p = name.indexOf(')');
if (p<2) {
error(QStringLiteral("Invalid compressed file ('%1')").arg(name));
return 0;
}
int index = name.midRef(1, p-1).toUInt();
TraceFile* f = 0;
p++;
while((name.length()>p) && name.at(p).isSpace()) p++;
if (name.length()>p) {
if (_fileVector.size() <= index) {
int newSize = index * 2;
#if TRACE_LOADER
qDebug() << " CachegrindLoader::fileVector enlarged to "
<< newSize;
#endif
_fileVector.resize(newSize);
}
QString realName = checkUnknown(name.mid(p));
f = (TraceFile*) _fileVector.at(index);
if (f && (f->name() != realName)) {
error(QStringLiteral("Redefinition of compressed file index %1 (was '%2') to %3")
.arg(index).arg(f->name()).arg(realName));
}
f = _data->file(realName);
_fileVector.replace(index, f);
}
else {
if ((_fileVector.size() <= index) ||
( (f=(TraceFile*)_fileVector.at(index)) == 0)) {
error(QStringLiteral("Undefined compressed file index %1").arg(index));
return 0;
}
}
return f;
}
示例3: setCalledFile
void CachegrindLoader::setCalledFile(const QString& name)
{
currentCalledFile = compressedFile(name);
if (!currentCalledFile) {
error(QStringLiteral("Invalid specification of called file, setting to unknown"));
currentCalledFile = _data->file(_emptyString);
}
currentCalledPartFile = currentCalledFile->partFile(_part);
}
示例4: setFile
void CachegrindLoader::setFile(const QString& name)
{
currentFile = compressedFile(name);
if (!currentFile) {
error(QString("Invalid file specification, setting to unknown"));
currentFile = _data->file(_emptyString);
}
currentPartFile = currentFile->partFile(_part);
currentLine = 0;
currentPartLine = 0;
}