My Project
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 729 of file vspace.h.

Constructor & Destructor Documentation

◆ VString() [1/3]

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

Definition at line 735 of file vspace.h.

735 {
736 _len = strlen(s);
737 _buffer = vnew_uninitialized_array<char>(_len + 1);
738 strcpy(_buffer.as_ptr(), s);
739 }
VRef< char > _buffer
Definition: vspace.h:731
size_t _len
Definition: vspace.h:732
const CanonicalForm int s
Definition: facAbsFact.cc:51

◆ VString() [2/3]

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

Definition at line 740 of file vspace.h.

740 {
741 _len = len;
742 _buffer = vnew_uninitialized_array<char>(len + 1);
743 char *buffer = _buffer.as_ptr();
744 memcpy(buffer, s, len);
745 buffer[len] = '\0';
746 }
size_t len() const
Definition: vspace.h:755

◆ VString() [3/3]

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

Definition at line 747 of file vspace.h.

747 {
748 _len = len;
749 _buffer = vnew_uninitialized_array<char>(len + 1);
750 _buffer[len] = '\0';
751 }

◆ ~VString()

vspace::VString::~VString ( )
inline

Definition at line 752 of file vspace.h.

752 {
753 _buffer.free();
754 }

Member Function Documentation

◆ clone()

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

Definition at line 758 of file vspace.h.

758 {
759 return vnew<VString>(_buffer.as_ptr(), _len);
760 }

◆ len()

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

Definition at line 755 of file vspace.h.

755 {
756 return _len;
757 }

◆ str()

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

Definition at line 761 of file vspace.h.

761 {
762 return _buffer.as_ptr();
763 }

Field Documentation

◆ _buffer

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

Definition at line 731 of file vspace.h.

◆ _len

size_t vspace::VString::_len
private

Definition at line 732 of file vspace.h.


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