#include <Dict.hpp>
|
| Dict ()=default |
|
void | set (const Value &key, const Value &value) |
| Assign a key to a value inside the dict.
|
|
const Value & | get (const Value &key) |
| Try to get a value from a given key. If no value is found, return Nil.
|
|
bool | contains (const Value &key) const |
| Check that a key exists.
|
|
void | remove (const Value &key) |
| Remove an entry from the dict via its key.
|
|
std::vector< Value > | keys () |
| Get a list of the dict keys.
|
|
std::size_t | size () const |
| Compute the number of (key, value) pairs in the dict.
|
|
std::string | toString (VM &vm) const |
| Convert the dictionary to a string for pretty printing.
|
|
Definition at line 28 of file Dict.hpp.
◆ Dict()
Ark::internal::Dict::Dict |
( |
| ) |
|
|
default |
◆ contains()
bool Ark::internal::Dict::contains |
( |
const Value & | key | ) |
const |
|
nodiscard |
Check that a key exists.
- Parameters
-
- Returns
- true if the dict has the key
-
false otherwise
Definition at line 21 of file Dict.cpp.
References m_dict.
◆ get()
const Value & Ark::internal::Dict::get |
( |
const Value & | key | ) |
|
Try to get a value from a given key. If no value is found, return Nil.
- Parameters
-
- Returns
- const Value&
Definition at line 14 of file Dict.cpp.
References m_dict, and Ark::Nil.
◆ keys()
std::vector< Value > Ark::internal::Dict::keys |
( |
| ) |
|
Get a list of the dict keys.
- Returns
- std::vector<Value>
Definition at line 31 of file Dict.cpp.
References keys(), and m_dict.
Referenced by keys().
◆ remove()
void Ark::internal::Dict::remove |
( |
const Value & | key | ) |
|
Remove an entry from the dict via its key.
- Parameters
-
Definition at line 26 of file Dict.cpp.
References m_dict.
◆ set()
void Ark::internal::Dict::set |
( |
const Value & | key, |
|
|
const Value & | value ) |
Assign a key to a value inside the dict.
- Parameters
-
Definition at line 9 of file Dict.cpp.
References m_dict.
◆ size()
std::size_t Ark::internal::Dict::size |
( |
| ) |
const |
|
nodiscard |
Compute the number of (key, value) pairs in the dict.
- Returns
- std::size_t
Definition at line 40 of file Dict.cpp.
References m_dict.
◆ toString()
std::string Ark::internal::Dict::toString |
( |
VM & | vm | ) |
const |
Convert the dictionary to a string for pretty printing.
- Parameters
-
- Returns
- std::string
Definition at line 45 of file Dict.cpp.
References m_dict.
◆ operator==
bool operator== |
( |
const Dict & | A, |
|
|
const Dict & | B ) |
|
friend |
◆ m_dict
ankerl::unordered_dense::map<Value, Value> Ark::internal::Dict::m_dict |
|
private |
The documentation for this class was generated from the following files:
- /Users/fola/Documents/ArkScript/Ark/include/Ark/VM/Value/Dict.hpp
- /Users/fola/Documents/ArkScript/Ark/src/arkreactor/VM/Value/Dict.cpp