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< VString > | clone () 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.

{
_len = std::strlen(s);
_buffer = vnew_uninitialized_array<char>(_len + 1);
std::strcpy(_buffer.as_ptr(), s);
}
vspace::VString::_buffer
VRef< char > _buffer
Definition vspace.h:2066
vspace::VString::_len
size_t _len
Definition vspace.h:2067
s
const CanonicalForm int s
Definition facAbsFact.cc:51
vspace::vnew_uninitialized_array
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.

{
_len = len;
_buffer = vnew_uninitialized_array<char>(len + 1);
char *buffer = _buffer.as_ptr();
std::memcpy(buffer, s, len);
buffer[len] = '\0';
}
vspace::VString::len
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.

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

## ~VString()

vspace::VString::~VString | ( |  | ) |

inline

Definition at line 2087 of file vspace.h.

{
_buffer.free();
}

## Member Function Documentation

## clone()

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

inline

Definition at line 2093 of file vspace.h.

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

## len()

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

inline

Definition at line 2090 of file vspace.h.

{
return _len;
}

## str()

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

inline

Definition at line 2096 of file vspace.h.

{
return _buffer.as_ptr();
}

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

- kernel/oswrapper/vspace.h