mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Move ReadLine into raw_istream class as getline. (#20)
This commit is contained in:
@@ -23,15 +23,6 @@
|
||||
|
||||
namespace wpi {
|
||||
|
||||
// Read a line from an input stream (up to a maximum length).
|
||||
// The returned buffer will contain the trailing \n (unless the maximum length
|
||||
// was reached). \r's are stripped from the buffer.
|
||||
// @param buf Buffer for output
|
||||
// @param error Set to true if an error occurred
|
||||
// @return Line
|
||||
llvm::StringRef ReadLine(wpi::raw_istream& is, llvm::SmallVectorImpl<char>& buf,
|
||||
int maxLen, bool* error);
|
||||
|
||||
// Unescape a %xx-encoded URI.
|
||||
// @param buf Buffer for output
|
||||
// @param error Set to true if an error occurred
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
|
||||
namespace llvm {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
class StringRef;
|
||||
}
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class raw_istream {
|
||||
@@ -45,6 +51,14 @@ class raw_istream {
|
||||
return readlen;
|
||||
};
|
||||
|
||||
// Read a line from an input stream (up to a maximum length).
|
||||
// The returned buffer will contain the trailing \n (unless the maximum length
|
||||
// was reached). \r's are stripped from the buffer.
|
||||
// @param buf Buffer for output
|
||||
// @param maxLen Maximum length
|
||||
// @return Line
|
||||
llvm::StringRef getline(llvm::SmallVectorImpl<char>& buf, int maxLen);
|
||||
|
||||
virtual void close() = 0;
|
||||
virtual std::size_t in_avail() const = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user