Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:38

0001 //===--- TextAPIWriter.h - Text API Writer ----------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_TEXTAPI_TEXTAPIWRITER_H
0010 #define LLVM_TEXTAPI_TEXTAPIWRITER_H
0011 
0012 #include "llvm/ADT/StringSwitch.h"
0013 #include "llvm/TextAPI/InterfaceFile.h"
0014 
0015 namespace llvm {
0016 
0017 class Error;
0018 class raw_ostream;
0019 
0020 namespace MachO {
0021 
0022 class TextAPIWriter {
0023 public:
0024   TextAPIWriter() = delete;
0025 
0026   /// Write TAPI text file contents into stream.
0027   ///
0028   /// \param OS Stream to write to.
0029   /// \param File Library attributes to write as text file.
0030   /// \param FileKind File format to write text file as. If not specified, it
0031   /// will read from File.
0032   /// \param Compact Whether to limit whitespace in text file.
0033   static Error writeToStream(raw_ostream &OS, const InterfaceFile &File,
0034                              const FileType FileKind = FileType::Invalid,
0035                              bool Compact = false);
0036 
0037   /// Get TAPI FileType from the input string.
0038   ///
0039   /// \param FT String of input to map to FileType.
0040   static FileType parseFileType(const StringRef FT) {
0041     return StringSwitch<FileType>(FT)
0042         .Case("tbd-v1", FileType::TBD_V1)
0043         .Case("tbd-v2", FileType::TBD_V2)
0044         .Case("tbd-v3", FileType::TBD_V3)
0045         .Case("tbd-v4", FileType::TBD_V4)
0046         .Case("tbd-v5", FileType::TBD_V5)
0047         .Default(FileType::Invalid);
0048   }
0049 };
0050 
0051 } // end namespace MachO.
0052 } // end namespace llvm.
0053 
0054 #endif // LLVM_TEXTAPI_TEXTAPIWRITER_H