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

Classes

struct  Static

Public Types

using size_type = std::size_t

Public Member Functions

 StringData (StringData &&)=delete
StringData & operator= (StringData &&)=delete
 StringData (const StringData &)=delete
StringData & operator= (const StringData &)=delete
size_t size () const
char * data () noexcept
const char * data () const noexcept
const char * c_str () const noexcept
constexpr std::string_view view () const noexcept

Static Public Member Functions

static const StringData & make (EvalMemory &mem, std::string_view s)
static StringData & alloc (EvalMemory &mem, size_t size)
static StringData & make (std::pmr::memory_resource &resource, std::string_view s)

Public Attributes

size_type size_
char data_ []

Member Function Documentation

◆ alloc()

StringData & nix::StringData::alloc ( EvalMemory & mem,
size_t size )
static

Allocate StringData on the (possibly) GC-managed heap.

Parameters
sizeLength of the string (without the NUL terminator).

◆ make()

const StringData & nix::StringData::make ( EvalMemory & mem,
std::string_view s )
static

Allocate StringData on the (possibly) GC-managed heap and copy the contents of s to it.


The documentation for this class was generated from the following files:
  • libexpr/include/nix/expr/value.hh
  • libexpr/eval.cc