My Project
Loading...
Searching...
No Matches
vspace::VString Class Reference

#include <vspace.h>

Public Member Functions

 VString (const char *s)
 
 VString (const char *s, size_t len)
 
 VString (size_t len)
 
 ~VString ()
 
size_t len () const
 
VRef< VStringclone () const
 
const char * str () const
 

Private Attributes

VRef< char > _buffer
 
size_t _len
 

Detailed Description

Definition at line 2064 of file vspace.h.

Constructor & Destructor Documentation

◆ VString() [1/3]

vspace::VString::VString ( const char * s)
inline

Definition at line 2070 of file vspace.h.

2070 {
2071 _len = std::strlen(s);
2073 std::strcpy(_buffer.as_ptr(), s);
2074 }
VRef< char > _buffer
Definition vspace.h:2066
const CanonicalForm int s
Definition facAbsFact.cc:51
VRef< T > vnew_uninitialized_array(size_t n)
Definition vspace.h:1895

◆ VString() [2/3]

vspace::VString::VString ( const char * s,
size_t len )
inline

Definition at line 2075 of file vspace.h.

2075 {
2076 _len = len;
2078 char *buffer = _buffer.as_ptr();
2079 std::memcpy(buffer, s, len);
2080 buffer[len] = '\0';
2081 }
size_t len() const
Definition vspace.h:2090

◆ VString() [3/3]

vspace::VString::VString ( size_t len)
inline

Definition at line 2082 of file vspace.h.

2082 {
2083 _len = len;
2085 _buffer[len] = '\0';
2086 }

◆ ~VString()

vspace::VString::~VString ( )
inline

Definition at line 2087 of file vspace.h.

2087 {
2088 _buffer.free();
2089 }

Member Function Documentation

◆ clone()

VRef< VString > vspace::VString::clone ( ) const
inline

Definition at line 2093 of file vspace.h.

2093 {
2094 return vnew<VString>(_buffer.as_ptr(), _len);
2095 }
VRef< T > vnew()
Definition vspace.h:1872

◆ len()

size_t vspace::VString::len ( ) const
inline

Definition at line 2090 of file vspace.h.

2090 {
2091 return _len;
2092 }

◆ str()

const char * vspace::VString::str ( ) const
inline

Definition at line 2096 of file vspace.h.

2096 {
2097 return _buffer.as_ptr();
2098 }

Field Documentation

◆ _buffer

VRef<char> vspace::VString::_buffer
private

Definition at line 2066 of file vspace.h.

◆ _len

size_t vspace::VString::_len
private

Definition at line 2067 of file vspace.h.


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