# opp_string Class Reference
[Internal classes]

`#include <opp_string.h>`

List of all members.

## Detailed Description

Lightweight string class, used internally in some parts of OMNeT++.

In simulation models it is better to use std::string or const char * instead.

opp_string has only one data member, a char* pointer. Allocation and deallocation of the contents takes place via opp_strdup() and operator delete.

## Public Member Functions

| opp_string ()
| opp_string (const char *s)
| opp_string (const opp_string &s)
| ~opp_string ()
const char * | c_str () const
bool | empty () const
char * | buffer ()
char * | reserve (unsigned size)
const char * | operator= (const char *s)
opp_string & | operator= (const opp_string &s)

## Constructor & Destructor Documentation

opp_string::opp_string | ( |  | ) | `[inline]`

| Constructor.

opp_string::opp_string | ( | const char * | s | ) | `[inline]`

| Constructor.

opp_string::opp_string | ( | const opp_string & | s | ) | `[inline]`

| Copy constructor.

opp_string::~opp_string | ( |  | ) | `[inline]`

| Destructor.

## Member Function Documentation

char* opp_string::buffer | ( |  | ) | `[inline]`

| Returns pointer to the internal buffer where the string is stored. It is allowed to write into the string via this pointer, but the length of the string should not be exceeded.

const char* opp_string::c_str | ( |  | ) | const`[inline]`

| Return pointer to the string.

bool opp_string::empty | ( |  | ) | const`[inline]`

| Null (empty) string or not.

opp_string& opp_string::operator= | ( | const opp_string & | s | ) | `[inline]`

| Assignment.

const char* opp_string::operator= | ( | const char * | s | ) | `[inline]`

| Deletes the old value and opp_strdup()'s the new value to create the object's own copy.

char* opp_string::reserve | ( | unsigned | size | ) | `[inline]`

| Allocates a buffer of the given size.

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

- opp_string.h