MLIR  21.0.0git
Public Member Functions | List of all members
mlir::lsp::JSONTransportInputOverFile Class Reference

Concrete implementation of the JSONTransportInput that reads from a file. More...

#include "mlir/Tools/lsp-server-support/Transport.h"

+ Inheritance diagram for mlir::lsp::JSONTransportInputOverFile:

Public Member Functions

 JSONTransportInputOverFile (std::FILE *in, JSONStreamStyle style=JSONStreamStyle::Standard)
 
bool hasError () const final
 
bool isEndOfInput () const final
 
LogicalResult readDelimitedMessage (std::string &json) final
 For lit tests we support a simplified syntax: More...
 
LogicalResult readStandardMessage (std::string &json) final
 
- Public Member Functions inherited from mlir::lsp::JSONTransportInput
 JSONTransportInput (JSONStreamStyle style=JSONStreamStyle::Standard)
 
virtual ~JSONTransportInput ()=default
 
LogicalResult readMessage (std::string &json)
 Read in a message from the input stream. More...
 

Detailed Description

Concrete implementation of the JSONTransportInput that reads from a file.

Definition at line 70 of file Transport.h.

Constructor & Destructor Documentation

◆ JSONTransportInputOverFile()

mlir::lsp::JSONTransportInputOverFile::JSONTransportInputOverFile ( std::FILE *  in,
JSONStreamStyle  style = JSONStreamStyle::Standard 
)
inlineexplicit

Definition at line 72 of file Transport.h.

Member Function Documentation

◆ hasError()

bool mlir::lsp::JSONTransportInputOverFile::hasError ( ) const
inlinefinalvirtual

Implements mlir::lsp::JSONTransportInput.

Definition at line 76 of file Transport.h.

Referenced by readStandardMessage().

◆ isEndOfInput()

bool mlir::lsp::JSONTransportInputOverFile::isEndOfInput ( ) const
inlinefinalvirtual

Implements mlir::lsp::JSONTransportInput.

Definition at line 77 of file Transport.h.

◆ readDelimitedMessage()

LogicalResult JSONTransportInputOverFile::readDelimitedMessage ( std::string &  json)
finalvirtual

For lit tests we support a simplified syntax:

  • messages are delimited by '// --—' on a line by itself
  • lines starting with // are ignored. This is a testing path, so favor simplicity over performance here. When returning failure: feof(), ferror(), or shutdownRequested() will be set.

Implements mlir::lsp::JSONTransportInput.

Definition at line 354 of file Transport.cpp.

References mlir::kDefaultSplitMarker, and readLine().

◆ readStandardMessage()

LogicalResult JSONTransportInputOverFile::readStandardMessage ( std::string &  json)
finalvirtual

Implements mlir::lsp::JSONTransportInput.

Definition at line 307 of file Transport.cpp.

References hasError(), and readLine().


The documentation for this class was generated from the following files: