The Vish Visualization Shell 0.3
Vish
Public Member Functions | List of all members
MemCore::simplestring Class Reference

#include <elementary/memcore/simplestring.hpp>

Public Member Functions

char * allocate_buffer (size_t howmany_bytes) noexcept
 Allocate internal storage space, but don't initialize it.
 
char * buffer () noexcept
 Get pointer to internal storage space.
 
const char * data () const noexcept
 Get const pointer to internal storage space.
 
 operator std::string () const
 Convert to std::string. This could throw an exception...
 
std::string operator* () const
 Convert to std::string. This could throw an exception...
 
simplestringoperator= (const simplestring &ss) noexcept
 Assignment operator (copies!)
 
 simplestring (const char *s=0, size_t length=0) noexcept
 Constructor.
 
 simplestring (const simplestring &ss) noexcept
 Copy constructor (copies!)
 
 simplestring (const std::string &s) noexcept
 Construct from std::string.
 
 ~simplestring () noexcept
 Destructor.
 

Detailed Description

Author
Werner Benger

A simple, slow but exception-free class to store a string within exceptions. The standard std::string class must not be used in exception classes because it might throw exceptions itself, leading to program termination. This class should not be used in normal code, only within template classes. It is convertible to std::strings.

This class does NOT do reference counting. All strings are copied.

Member Function Documentation

◆ allocate_buffer()

char * MemCore::simplestring::allocate_buffer ( size_t  howmany_bytes)
noexcept

Allocate internal storage space, but don't initialize it.

Removes anything stored here so far.