llvm/clang/include/clang/Basic/FileEntry.h

//===- clang/Basic/FileEntry.h - File references ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Defines interfaces for clang::FileEntry and clang::FileEntryRef.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_BASIC_FILEENTRY_H
#define LLVM_CLANG_BASIC_FILEENTRY_H

#include "clang/Basic/CustomizableOptional.h"
#include "clang/Basic/DirectoryEntry.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem/UniqueID.h"

#include <optional>
#include <utility>

namespace llvm {

class MemoryBuffer;

namespace vfs {

class File;

} // namespace vfs
} // namespace llvm

namespace clang {

class FileEntryRef;

namespace optional_detail {

/// Forward declare a template specialization for OptionalStorage.
template <> class OptionalStorage<clang::FileEntryRef>;

} // namespace optional_detail

class FileEntry;

/// A reference to a \c FileEntry that includes the name of the file as it was
/// accessed by the FileManager's client.
class FileEntryRef {};

static_assert;

static_assert;

OptionalFileEntryRef;

namespace optional_detail {

/// Customize OptionalStorage<FileEntryRef> to use FileEntryRef and its
/// optional_none_tag to keep it the size of a single pointer.
template <>
class OptionalStorage<clang::FileEntryRef>
    : public clang::FileMgr::MapEntryOptionalStorage<clang::FileEntryRef> {};

static_assert;

static_assert;

} // end namespace optional_detail
} // namespace clang

namespace llvm {

/// Specialisation of DenseMapInfo for FileEntryRef.
template <> struct DenseMapInfo<clang::FileEntryRef> {};

} // end namespace llvm

namespace clang {

inline bool operator==(const FileEntry *LHS, const OptionalFileEntryRef &RHS) {}
inline bool operator==(const OptionalFileEntryRef &LHS, const FileEntry *RHS) {}
inline bool operator!=(const FileEntry *LHS, const OptionalFileEntryRef &RHS) {}
inline bool operator!=(const OptionalFileEntryRef &LHS, const FileEntry *RHS) {}

/// Cached information about one file (either on disk
/// or in the virtual file system).
///
/// If the 'File' member is valid, then this FileEntry has an open file
/// descriptor for the file.
class FileEntry {};

off_t FileEntryRef::getSize() const {}

unsigned FileEntryRef::getUID() const {}

const llvm::sys::fs::UniqueID &FileEntryRef::getUniqueID() const {}

time_t FileEntryRef::getModificationTime() const {}

bool FileEntryRef::isNamedPipe() const {}

void FileEntryRef::closeFile() const {}

} // end namespace clang

#endif // LLVM_CLANG_BASIC_FILEENTRY_H