llvm/clang/lib/InstallAPI/FileList.cpp

//===- FileList.cpp ---------------------------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "clang/InstallAPI/FileList.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/InstallAPI/FileList.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/JSON.h"
#include "llvm/TextAPI/TextAPIError.h"
#include <optional>

// clang-format off
/*
InstallAPI JSON Input Format specification.

{
  "headers" : [                              # Required: Key must exist.
    {                                        # Optional: May contain 0 or more header inputs.
      "path" : "/usr/include/mach-o/dlfn.h", # Required: Path should point to destination
                                             #           location where applicable.
      "type" : "public",                     # Required: Maps to HeaderType for header.
      "language": "c++"                      # Optional: Language mode for header.
    }
  ],
  "version" : "3"                            # Required: Version 3 supports language mode
                                                         & project header input.
}
*/
// clang-format on

usingnamespacellvm;
usingnamespacellvm::json;
usingnamespacellvm::MachO;
usingnamespaceclang::installapi;

namespace {
class Implementation {};

Expected<StringRef>
Implementation::parseString(const Object *Obj, StringRef Key, StringRef Error) {}

Expected<HeaderType> Implementation::parseType(const Object *Obj) {}

Expected<StringRef> Implementation::parsePath(const Object *Obj) {}

std::optional<clang::Language>
Implementation::parseLanguage(const Object *Obj) {}

Error Implementation::parseHeaders(Array &Headers) {}

Error Implementation::parse(StringRef Input) {}
} // namespace

llvm::Error
FileListReader::loadHeaders(std::unique_ptr<MemoryBuffer> InputBuffer,
                            HeaderSeq &Destination, clang::FileManager *FM) {}