proxygen
folly::gen::detail::IStreamByLine Class Reference

#include <IStream.h>

Inheritance diagram for folly::gen::detail::IStreamByLine:
folly::gen::GenImpl< std::string &&, IStreamByLine > folly::gen::FBounded< Self >

Public Member Functions

 IStreamByLine (std::istream &in)
 
template<class Body >
bool apply (Body &&body) const
 
- Public Member Functions inherited from folly::gen::GenImpl< std::string &&, IStreamByLine >
bool apply (Handler &&handler) const
 
void foreach (Body &&body) const
 
- Public Member Functions inherited from folly::gen::FBounded< Self >
const Self & self () const
 
Self & self ()
 

Static Public Attributes

static constexpr bool infinite = false
 
- Static Public Attributes inherited from folly::gen::GenImpl< std::string &&, IStreamByLine >
static constexpr bool infinite
 

Private Attributes

std::istream & in_
 

Additional Inherited Members

- Public Types inherited from folly::gen::GenImpl< std::string &&, IStreamByLine >
typedef std::string && ValueType
 
typedef std::decay< std::string && >::type StorageType
 
- Protected Member Functions inherited from folly::gen::GenImpl< std::string &&, IStreamByLine >
 GenImpl ()=default
 
 GenImpl (GenImpl &&)=default
 
 GenImpl (const GenImpl &)=default
 
GenImploperator= (GenImpl &&)=default
 
GenImploperator= (const GenImpl &)=default
 

Detailed Description

Generates lines by calling std::getline() on a given istream.

Definition at line 30 of file IStream.h.

Constructor & Destructor Documentation

folly::gen::detail::IStreamByLine::IStreamByLine ( std::istream &  in)
inline

Definition at line 32 of file IStream.h.

32 : in_(in) {}

Member Function Documentation

template<class Body >
bool folly::gen::detail::IStreamByLine::apply ( Body &&  body) const
inline

Definition at line 35 of file IStream.h.

References getline(), in_, folly::gen::move, and string.

35  {
36  for (std::string line; std::getline(in_, line);) {
37  if (!body(std::move(line))) {
38  return false;
39  }
40  }
41  return true;
42  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void BENCHFUN() getline(size_t iters, size_t arg)
const char * string
Definition: Conv.cpp:212

Member Data Documentation

std::istream& folly::gen::detail::IStreamByLine::in_
private

Definition at line 49 of file IStream.h.

Referenced by apply().

constexpr bool folly::gen::detail::IStreamByLine::infinite = false
static

Definition at line 46 of file IStream.h.


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