Exemplo n.º 1
0
void TranslationUnits::updateTranslationUnit(const FileContainer &fileContainer)
{
    const auto translationUnits = findAllTranslationUnitWithFilePath(fileContainer.filePath());

    for (auto translationUnit : translationUnits)
        translationUnit.setDocumentRevision(fileContainer.documentRevision());
}
Exemplo n.º 2
0
std::vector<Document> Documents::updateDocument(const FileContainer &fileContainer)
{
    const auto documents = findAllDocumentsWithFilePath(fileContainer.filePath());

    for (auto document : documents)
        document.setDocumentRevision(fileContainer.documentRevision());

    return documents;
}
Exemplo n.º 3
0
Document Documents::createDocument(const FileContainer &fileContainer)
{
    Document::FileExistsCheck checkIfFileExists = fileContainer.hasUnsavedFileContent() ? Document::DoNotCheckIfFileExists : Document::CheckIfFileExists;

    documents_.emplace_back(fileContainer.filePath(),
                                   projectParts.project(fileContainer.projectPartId()),
                                   fileContainer.fileArguments(),
                                   *this,
                                   checkIfFileExists);

    documents_.back().setDocumentRevision(fileContainer.documentRevision());

    return documents_.back();
}
Exemplo n.º 4
0
void PrintTo(const FileContainer &container, ::std::ostream* os)
{
    *os << "FileContainer("
        << container.filePath().constData() << ", "
        << container.projectPartId().constData() << ", "
        << container.fileArguments().constData() << ", "
        << container.documentRevision();

    if (container.hasUnsavedFileContent())
        *os << ", "
            << container.unsavedFileContent().constData();

    *os << ")";
}
Exemplo n.º 5
0
QDebug operator<<(QDebug debug, const FileContainer &container)
{
    debug.nospace() << "FileContainer("
                    << container.filePath() << ", "
                    << container.projectPartId() << ", "
                    << container.fileArguments() << ", "
                    << container.documentRevision();

    if (container.hasUnsavedFileContent()) {
        const Utf8String fileWithContent = debugWriteFileForInspection(
                    container.unsavedFileContent(),
                    debugId(container));
        debug.nospace() << ", "
                        << "<" << fileWithContent << ">";
    }

    debug.nospace() << ")";

    return debug;
}