Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::core::StringList Class Reference

Dynamic list of strings. More...

#include <string_list.h>

Inheritance diagram for roc::core::StringList:
roc::core::NonCopyable< T >

Public Member Functions

 StringList (IAllocator &allocator)
 Initialize empty string list.
 
size_t size () const
 Get number of elements.
 
const char * front () const
 Get first string.
 
const char * back () const
 Get last string.
 
const char * nextof (const char *str) const
 Get next string.
 
void clear ()
 Clear the list.
 
bool push_back (const char *str)
 Append string to the list.
 
bool push_back (const char *str_begin, const char *str_end)
 Append string from a range to the list.
 
bool push_unique (const char *str)
 Append string to the list if it's not in the list already.
 
bool push_unique (const char *str_begin, const char *str_end)
 Append string from a range to the list if it's not in the list already.
 

Detailed Description

Dynamic list of strings.

Definition at line 24 of file string_list.h.

Constructor & Destructor Documentation

◆ StringList()

roc::core::StringList::StringList ( IAllocator allocator)
explicit

Initialize empty string list.

Member Function Documentation

◆ back()

const char * roc::core::StringList::back ( ) const

Get last string.

Returns
the last string in the list or NULL if it is empty.

◆ clear()

void roc::core::StringList::clear ( )

Clear the list.

◆ front()

const char * roc::core::StringList::front ( ) const

Get first string.

Returns
the first string in the list or NULL if it is empty.

◆ nextof()

const char * roc::core::StringList::nextof ( const char *  str) const

Get next string.

Returns
the first string of the given string or NULL if it is the last string.
Remarks
str should be a pointer returned by front() or nextof(). These pointers are invalidated by methods that modify the list.

◆ push_back() [1/2]

bool roc::core::StringList::push_back ( const char *  str)

Append string to the list.

Remarks
Reallocates memory if necessary.
Returns
false if allocation failed.

◆ push_back() [2/2]

bool roc::core::StringList::push_back ( const char *  str_begin,
const char *  str_end 
)

Append string from a range to the list.

Remarks
Reallocates memory if necessary.
Returns
false if allocation failed.

◆ push_unique() [1/2]

bool roc::core::StringList::push_unique ( const char *  str)

Append string to the list if it's not in the list already.

Remarks
Reallocates memory if necessary.
Returns
false if allocation failed.

◆ push_unique() [2/2]

bool roc::core::StringList::push_unique ( const char *  str_begin,
const char *  str_end 
)

Append string from a range to the list if it's not in the list already.

Remarks
Reallocates memory if necessary.
Returns
false if allocation failed.

◆ size()

size_t roc::core::StringList::size ( ) const

Get number of elements.


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