Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::StringSource Class Reference

#include <serialise.hh>

Inheritance diagram for nix::StringSource:
nix::RestartableSource nix::Source

Public Member Functions

 StringSource (std::string &&s)
 StringSource (std::string_view s)
 StringSource (const std::string &str)
size_t read (char *data, size_t len) override
void skip (size_t len) override
void restart () override
Public Member Functions inherited from nix::Source
void operator() (char *data, size_t len)
void operator() (std::string_view data)
virtual bool good ()
void drainInto (Sink &sink)
virtual void drainInto (Sink &sink, uint64_t len)
std::string drain ()

Public Attributes

std::string_view s
size_t pos

Detailed Description

A source that reads data from a string.

Member Function Documentation

◆ read()

size_t nix::StringSource::read ( char * data,
size_t len )
overridevirtual

Store up to ‘len’ in the buffer pointed to by ‘data’, and return the number of bytes stored. It blocks until at least one byte is available.

Implements nix::Source.

◆ restart()

void nix::StringSource::restart ( )
inlineoverridevirtual

◆ skip()

void nix::StringSource::skip ( size_t len)
overridevirtual

Reimplemented from nix::Source.


The documentation for this class was generated from the following files:
  • libutil/include/nix/util/serialise.hh
  • libutil/serialise.cc