The List class represents a Scratch list.
More...
#include <scratchcpp/list.h>
The List class represents a Scratch list.
Due to the high optimization of the methods, indices out of range will result in undefined behavior!
◆ List() [1/2]
| List::List |
( |
const std::string & | id, |
|
|
const std::string & | name ) |
◆ List() [2/2]
| libscratchcpp::List::List |
( |
const List & | | ) |
|
|
delete |
◆ ~List()
◆ allocatedSizePtr()
| const size_t * libscratchcpp::List::allocatedSizePtr |
( |
| ) |
const |
|
inline |
Returns a pointer to the allocated list size.
- Note
- This is used internally by compiled code for various optimizations.
◆ append() [1/2]
| void libscratchcpp::List::append |
( |
const Value & | value | ) |
|
|
inline |
◆ append() [2/2]
| void libscratchcpp::List::append |
( |
const ValueData & | value | ) |
|
|
inline |
◆ appendEmpty()
| ValueData & libscratchcpp::List::appendEmpty |
( |
| ) |
|
|
inline |
Appends an empty item and returns the reference to it. Can be used for custom initialization.
◆ clear()
| void libscratchcpp::List::clear |
( |
| ) |
|
|
inline |
◆ clone()
| std::shared_ptr< List > List::clone |
( |
| ) |
|
Creates a copy of the list.
◆ contains() [1/2]
| bool libscratchcpp::List::contains |
( |
const Value & | value | ) |
const |
|
inline |
Returns true if the list contains the given item.
◆ contains() [2/2]
| bool libscratchcpp::List::contains |
( |
const ValueData & | value | ) |
const |
|
inline |
Returns true if the list contains the given item.
◆ data()
| ValueData * libscratchcpp::List::data |
( |
| ) |
const |
|
inline |
Returns a pointer to the raw list data.
◆ dataPtr()
| ValueData *const * libscratchcpp::List::dataPtr |
( |
| ) |
const |
|
inline |
Returns a pointer to pointer to the raw list data.
- Note
- This is used internally by compiled code for various optimizations.
◆ empty()
| bool libscratchcpp::List::empty |
( |
| ) |
const |
|
inline |
Returns true if the list is empty.
◆ id()
| const std::string & Entity::id |
( |
| ) |
const |
|
inherited |
◆ indexOf() [1/2]
| size_t libscratchcpp::List::indexOf |
( |
const Value & | value | ) |
const |
|
inline |
Returns the index of the given item.
◆ indexOf() [2/2]
| size_t libscratchcpp::List::indexOf |
( |
const ValueData & | value | ) |
const |
|
inline |
Returns the index of the given item.
◆ insert() [1/2]
| void libscratchcpp::List::insert |
( |
size_t | index, |
|
|
const Value & | value ) |
|
inline |
Inserts an item at index.
◆ insert() [2/2]
| void libscratchcpp::List::insert |
( |
size_t | index, |
|
|
const ValueData & | value ) |
|
inline |
Inserts an item at index.
◆ insertEmpty()
| ValueData & libscratchcpp::List::insertEmpty |
( |
size_t | index | ) |
|
|
inline |
Inserts an empty item at index and returns the reference to it. Can be used for custom initialization.
◆ monitor()
Returns the monitor of this list.
◆ name()
| const std::string & List::name |
( |
| ) |
|
Returns the name of the list.
◆ operator[]()
| ValueData & libscratchcpp::List::operator[] |
( |
size_t | index | ) |
|
|
inline |
◆ removeAt()
| void libscratchcpp::List::removeAt |
( |
size_t | index | ) |
|
|
inline |
Removes the item at index.
◆ replace() [1/2]
| void libscratchcpp::List::replace |
( |
size_t | index, |
|
|
const Value & | value ) |
|
inline |
Replaces the item at index.
◆ replace() [2/2]
| void libscratchcpp::List::replace |
( |
size_t | index, |
|
|
const ValueData & | value ) |
|
inline |
Replaces the item at index.
◆ setId()
| void Entity::setId |
( |
const std::string & | newId | ) |
|
|
inherited |
◆ setMonitor()
| void List::setMonitor |
( |
Monitor * | monitor | ) |
|
Sets the monitor of this list.
◆ setName()
| void List::setName |
( |
const std::string & | name | ) |
|
Sets the name of the list.
◆ setTarget()
| void List::setTarget |
( |
Target * | target | ) |
|
Sets the sprite or stage this list belongs to.
◆ size()
| size_t libscratchcpp::List::size |
( |
| ) |
const |
|
inline |
◆ sizePtr()
| size_t * libscratchcpp::List::sizePtr |
( |
| ) |
|
|
inline |
Returns a pointer to the list size.
- Note
- This is used internally by compiled code for various optimizations.
◆ target()
| Target * List::target |
( |
| ) |
const |
Returns the sprite or stage this list belongs to.
◆ toString()
| std::string List::toString |
( |
| ) |
const |
Same as the other method, but returns the result as std::string.
◆ toStringPtr()
| void libscratchcpp::List::toStringPtr |
( |
StringPtr * | dst | ) |
const |
|
inline |
Joins the list items with spaces or without any separator if there are only digits and returns the result as StringPtr.
The documentation for this class was generated from the following files: