My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
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);
2072 _buffer = vnew_uninitialized_array<char>(_len + 1);
2073 std::strcpy(_buffer.as_ptr(), s);
2074 }
VRef< char > _buffer
Definition: vspace.h:2066
size_t _len
Definition: vspace.h:2067
const CanonicalForm int s
Definition: facAbsFact.cc:51
T * as_ptr() const
Definition: vspace.h:1779

◆ 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;
2077 _buffer = vnew_uninitialized_array<char>(len + 1);
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;
2084 _buffer = vnew_uninitialized_array<char>(len + 1);
2085 _buffer[len] = '\0';
2086 }

◆ ~VString()

vspace::VString::~VString ( )
inline

Definition at line 2087 of file vspace.h.

2087 {
2088 _buffer.free();
2089 }
void free()
Definition: vspace.h:1805

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 }

◆ 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: