PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::ScriptString Class Reference

#include <script_string.hpp>

Data Structures

struct  Handle
 

Public Types

using size_type = std::uint64_t
 

Public Member Functions

 ScriptString () noexcept=default
 
 ScriptString (detail::o1::Store &, std::string_view bytes={}, size_type proven_byte_bound=0)
 
 ScriptString (const char *)
 
 ScriptString (const std::string &)
 
 ScriptString (std::string_view)
 
 ScriptString (const ScriptString &)
 
 ScriptString (ScriptString &&) noexcept
 
ScriptString & operator= (const ScriptString &)
 
ScriptString & operator= (ScriptString &&)
 
 ~ScriptString ()
 
void swap (ScriptString &) noexcept
 
size_type size () const noexcept
 
size_type length () const noexcept
 
bool empty () const noexcept
 
detail::o1::Store * store () const noexcept
 
void keep_store_alive (std::shared_ptr< void > owner) noexcept
 
void reserve (size_type proven_byte_bound)
 
ScriptString & append (const ScriptString &)
 
ScriptString & append (std::string_view)
 
ScriptString & append (const char *value)
 
ScriptString & append (const std::string &value)
 
ScriptString & operator+= (const ScriptString &value)
 
ScriptString & operator+= (std::string_view value)
 
ScriptString & operator+= (const char *value)
 
ScriptString & operator+= (const std::string &value)
 
ScriptString & operator+= (char value)
 
void clear ()
 
char operator[] (size_type) const
 
char at (size_type) const
 
ScriptString substr (size_type pos=0, size_type count=npos) const
 
std::size_t read (size_type offset, void *destination, std::size_t bytes) const
 
int compare (const ScriptString &) const
 
int compare (std::string_view) const
 
int compare (const char *value) const
 
int compare (const std::string &value) const
 
int compare (size_type pos, size_type count, const ScriptString &) const
 
size_type find (const ScriptString &, size_type pos=0) const
 
size_type find (std::string_view, size_type pos=0) const
 
size_type find (const char *value, size_type pos=0) const
 
size_type find (const std::string &value, size_type pos=0) const
 
size_type find (char, size_type pos=0) const
 
std::size_t hash () const
 
template<class Sink>
void hash_into (Sink &sink) const
 
Handle pin () const
 
std::string to_std_string () const
 
template<class Function>
void with_std_string (Function &&function)
 

Static Public Member Functions

static ScriptString from_handle (detail::o1::Store &, Handle)
 
static void unpin (detail::o1::Store &, Handle)
 

Static Public Attributes

static constexpr size_type npos = UINT64_MAX
 
static constexpr std::size_t chunk_bytes = 4096
 

Detailed Description

Definition at line 40 of file script_string.hpp.

Member Typedef Documentation

◆ size_type

using pineforge::ScriptString::size_type = std::uint64_t

Definition at line 42 of file script_string.hpp.

Constructor & Destructor Documentation

◆ ScriptString() [1/7]

◆ ScriptString() [2/7]

pineforge::ScriptString::ScriptString ( detail::o1::Store & ,
std::string_view bytes = {},
size_type proven_byte_bound = 0 )
explicit

References ScriptString().

◆ ScriptString() [3/7]

pineforge::ScriptString::ScriptString ( const char * )

◆ ScriptString() [4/7]

pineforge::ScriptString::ScriptString ( const std::string & )

◆ ScriptString() [5/7]

pineforge::ScriptString::ScriptString ( std::string_view )

◆ ScriptString() [6/7]

pineforge::ScriptString::ScriptString ( const ScriptString & )

References ScriptString().

◆ ScriptString() [7/7]

pineforge::ScriptString::ScriptString ( ScriptString && )
noexcept

References ScriptString().

◆ ~ScriptString()

pineforge::ScriptString::~ScriptString ( )

References ScriptString().

Member Function Documentation

◆ operator=() [1/2]

ScriptString & pineforge::ScriptString::operator= ( const ScriptString & )

References ScriptString().

◆ operator=() [2/2]

ScriptString & pineforge::ScriptString::operator= ( ScriptString && )

References ScriptString().

◆ swap()

void pineforge::ScriptString::swap ( ScriptString & )
noexcept

References ScriptString(), and swap().

Referenced by swap(), and with_std_string().

◆ size()

size_type pineforge::ScriptString::size ( ) const
inlinenoexcept

Definition at line 67 of file script_string.hpp.

References size().

Referenced by empty(), hash_into(), length(), and size().

◆ length()

size_type pineforge::ScriptString::length ( ) const
inlinenoexcept

Definition at line 68 of file script_string.hpp.

References size().

◆ empty()

bool pineforge::ScriptString::empty ( ) const
inlinenoexcept

Definition at line 69 of file script_string.hpp.

References size().

◆ store()

detail::o1::Store * pineforge::ScriptString::store ( ) const
inlinenoexcept

Definition at line 70 of file script_string.hpp.

◆ keep_store_alive()

void pineforge::ScriptString::keep_store_alive ( std::shared_ptr< void > owner)
inlinenoexcept

Definition at line 74 of file script_string.hpp.

◆ reserve()

void pineforge::ScriptString::reserve ( size_type proven_byte_bound)

◆ append() [1/4]

◆ append() [2/4]

ScriptString & pineforge::ScriptString::append ( std::string_view )

References ScriptString().

◆ append() [3/4]

ScriptString & pineforge::ScriptString::append ( const char * value)
inline

Definition at line 81 of file script_string.hpp.

References append(), and ScriptString().

Referenced by append().

◆ append() [4/4]

ScriptString & pineforge::ScriptString::append ( const std::string & value)
inline

Definition at line 82 of file script_string.hpp.

References append(), and ScriptString().

Referenced by append().

◆ operator+=() [1/5]

ScriptString & pineforge::ScriptString::operator+= ( const ScriptString & value)
inline

Definition at line 83 of file script_string.hpp.

References append(), and ScriptString().

◆ operator+=() [2/5]

ScriptString & pineforge::ScriptString::operator+= ( std::string_view value)
inline

Definition at line 84 of file script_string.hpp.

References append(), and ScriptString().

◆ operator+=() [3/5]

ScriptString & pineforge::ScriptString::operator+= ( const char * value)
inline

Definition at line 85 of file script_string.hpp.

References append(), and ScriptString().

◆ operator+=() [4/5]

ScriptString & pineforge::ScriptString::operator+= ( const std::string & value)
inline

Definition at line 86 of file script_string.hpp.

References append(), and ScriptString().

◆ operator+=() [5/5]

ScriptString & pineforge::ScriptString::operator+= ( char value)
inline

Definition at line 87 of file script_string.hpp.

References append(), and ScriptString().

◆ clear()

void pineforge::ScriptString::clear ( )

Referenced by pineforge::operator+().

◆ operator[]()

char pineforge::ScriptString::operator[] ( size_type ) const

◆ at()

char pineforge::ScriptString::at ( size_type ) const

◆ substr()

ScriptString pineforge::ScriptString::substr ( size_type pos = 0,
size_type count = npos ) const

References npos, and ScriptString().

◆ read()

std::size_t pineforge::ScriptString::read ( size_type offset,
void * destination,
std::size_t bytes ) const

Referenced by hash_into().

◆ compare() [1/5]

◆ compare() [2/5]

int pineforge::ScriptString::compare ( std::string_view ) const

◆ compare() [3/5]

int pineforge::ScriptString::compare ( const char * value) const
inline

Definition at line 99 of file script_string.hpp.

References compare().

Referenced by compare().

◆ compare() [4/5]

int pineforge::ScriptString::compare ( const std::string & value) const
inline

Definition at line 100 of file script_string.hpp.

References compare().

Referenced by compare().

◆ compare() [5/5]

int pineforge::ScriptString::compare ( size_type pos,
size_type count,
const ScriptString &  ) const

References ScriptString().

◆ find() [1/5]

size_type pineforge::ScriptString::find ( const ScriptString & ,
size_type pos = 0 ) const

References ScriptString().

◆ find() [2/5]

size_type pineforge::ScriptString::find ( std::string_view ,
size_type pos = 0 ) const

◆ find() [3/5]

size_type pineforge::ScriptString::find ( const char * value,
size_type pos = 0 ) const
inline

Definition at line 104 of file script_string.hpp.

References find().

Referenced by find().

◆ find() [4/5]

size_type pineforge::ScriptString::find ( const std::string & value,
size_type pos = 0 ) const
inline

Definition at line 105 of file script_string.hpp.

References find().

Referenced by find().

◆ find() [5/5]

size_type pineforge::ScriptString::find ( char ,
size_type pos = 0 ) const

◆ hash()

std::size_t pineforge::ScriptString::hash ( ) const

◆ hash_into()

template<class Sink>
void pineforge::ScriptString::hash_into ( Sink & sink) const
inline

Definition at line 113 of file script_string.hpp.

References read(), and size().

◆ pin()

Handle pineforge::ScriptString::pin ( ) const

◆ from_handle()

◆ unpin()

static void pineforge::ScriptString::unpin ( detail::o1::Store & ,
Handle  )
static

◆ to_std_string()

std::string pineforge::ScriptString::to_std_string ( ) const

Referenced by with_std_string().

◆ with_std_string()

template<class Function>
void pineforge::ScriptString::with_std_string ( Function && function)
inline

Definition at line 129 of file script_string.hpp.

References ScriptString(), swap(), and to_std_string().

Field Documentation

◆ npos

size_type pineforge::ScriptString::npos = UINT64_MAX
staticconstexpr

◆ chunk_bytes

std::size_t pineforge::ScriptString::chunk_bytes = 4096
staticconstexpr

Definition at line 44 of file script_string.hpp.


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