#include <array.h>

Public Types | |
| enum | SortFlags { fCaseInsensitive = (1<<0), fDescending = (1<<1), fUniqueSort = (1<<2), fReturnIndexedArray = (1<<3), fNumeric = (1<<4) } |
| Sort flags. More... | |
| typedef std::deque< as_value > | container |
| typedef container::const_iterator | const_iterator |
| typedef container::iterator | iterator |
Public Member Functions | |
| template<class V> | |
| void | visitAll (V &v) |
| Visit all elements. | |
| as_array_object () | |
| as_array_object (const as_array_object &other) | |
| ~as_array_object () | |
| std::deque< indexed_as_value > | get_indexed_elements () |
| const_iterator | begin () |
| const_iterator | end () |
| void | push (const as_value &val) |
| Push an element to the end of the array. | |
| void | unshift (const as_value &val) |
| as_value | shift () |
| as_value | pop () |
| as_value | at (unsigned int index) |
| as_array_object * | get_indices (std::deque< indexed_as_value > origElems) |
| void | reverse () |
| void | set_indexed (unsigned int index, const as_value &v) |
| std::string | join (const std::string &separator, as_environment *env) const |
| std::string | toString (as_environment *env=NULL) const |
| std::string | get_text_value () const |
| Return a text representation for this object. | |
| unsigned int | size () const |
| void | resize (unsigned int) |
| void | concat (const as_array_object &other) |
| std::auto_ptr< as_array_object > | slice (unsigned int start, unsigned int one_past_end) |
| Return a newly created array containing elements from 'start' up to but not including 'end'. | |
| bool | removeFirst (const as_value &v) |
| Remove first element matching the given value. | |
| std::auto_ptr< as_array_object > | splice (unsigned start, unsigned len, const std::vector< as_value > &replacement) |
| Substitute 'len' elements from 'start' with elements from the given array. | |
| template<class AVCMP> | |
| void | sort (AVCMP avc) |
| Sort the array, using given values comparator. | |
| template<class AVCMP, class AVEQ> | |
| as_value | sort (AVCMP avc, AVEQ ave) |
| Attempt to sort the array using given values comparator, avc. If two or more elements in the array are equal, as determined by the equality comparator ave, then the array is not sorted and 0 is returned. Otherwise the array is sorted and returned. | |
| template<class AVCMP> | |
| as_array_object * | sort_indexed (AVCMP avc) |
| Return a new array containing sorted index of this array. | |
| template<class AVCMP, class AVEQ> | |
| as_value | sort_indexed (AVCMP avc, AVEQ ave) |
| Return a new array containing sorted index of this array. If two or more elements in the array are equal, as determined by the equality comparator ave, then 0 is returned instead. | |
| virtual bool | get_member (string_table::key name, as_value *val, string_table::key nsname=0) |
| Overridden to provide 'length' member. | |
| virtual void | set_member (string_table::key name, const as_value &val, string_table::key nsname=0) |
| Overridden to provide array[#]=x semantic. | |
| virtual void | enumerateNonProperties (as_environment &) const |
| Enumerate elements. | |
| typedef std::deque<as_value> gnash::as_array_object::container |
Sort flags.
| gnash::as_array_object::as_array_object | ( | ) |
| gnash::as_array_object::as_array_object | ( | const as_array_object & | other | ) |
| gnash::as_array_object::~as_array_object | ( | ) |
| void gnash::as_array_object::visitAll | ( | V & | v | ) | [inline] |
Visit all elements.
The visitor class will have to expose a visit(as_value&) method
| std::deque< indexed_as_value > gnash::as_array_object::get_indexed_elements | ( | ) |
| std::deque< as_value >::const_iterator gnash::as_array_object::begin | ( | ) |
| std::deque< as_value >::const_iterator gnash::as_array_object::end | ( | ) |
| void gnash::as_array_object::push | ( | const as_value & | val | ) |
Push an element to the end of the array.
| val | The element to add |
| void gnash::as_array_object::unshift | ( | const as_value & | val | ) |
| as_value gnash::as_array_object::shift | ( | ) |
| as_value gnash::as_array_object::pop | ( | ) |
| as_value gnash::as_array_object::at | ( | unsigned int | index | ) |
| as_array_object * gnash::as_array_object::get_indices | ( | std::deque< indexed_as_value > | origElems | ) |
| void gnash::as_array_object::reverse | ( | ) |
| void gnash::as_array_object::set_indexed | ( | unsigned int | index, | |
| const as_value & | v | |||
| ) |
| std::string gnash::as_array_object::join | ( | const std::string & | separator, | |
| as_environment * | env | |||
| ) | const |
| env | If not-null will be used to properl invoke the toString() method against member values. |
| std::string gnash::as_array_object::toString | ( | as_environment * | env = NULL |
) | const |
| env | If not-null will be used to properly invoke the toString() method against member values. |
| std::string gnash::as_array_object::get_text_value | ( | ) | const [inline, virtual] |
| unsigned int gnash::as_array_object::size | ( | ) | const |
| void gnash::as_array_object::resize | ( | unsigned int | newsize | ) |
| void gnash::as_array_object::concat | ( | const as_array_object & | other | ) |
| std::auto_ptr< as_array_object > gnash::as_array_object::slice | ( | unsigned int | start, | |
| unsigned int | one_past_end | |||
| ) |
Return a newly created array containing elements from 'start' up to but not including 'end'.
NOTE: assertions are:
assert(one_past_end >= start); assert(one_past_end <= size()); assert(start <= size());
| start | index to first element to include in result 0-based index. | |
| one_past_end | index to one-past element to include in result 0-based index. |
Remove first element matching the given value.
Return true if any element was removed, false otherwise
| v | The value to compare elements against | |
| env | The environment to use when comparing (needed by as_value::equals) |
| std::auto_ptr< as_array_object > gnash::as_array_object::splice | ( | unsigned | start, | |
| unsigned | len, | |||
| const std::vector< as_value > & | replacement | |||
| ) |
Substitute 'len' elements from 'start' with elements from the given array.
NOTE: assertions are:
assert(len <= size()-start); assert(start <= size());
| start | 0-index based offset of first element to replace. | |
| len | Number of elements to replace. | |
| replacement | The element to use as replacement |
| void gnash::as_array_object::sort | ( | AVCMP | avc | ) | [inline] |
Sort the array, using given values comparator.
| avc | boolean functor or function comparing two as_value& objects |
| as_value gnash::as_array_object::sort | ( | AVCMP | avc, | |
| AVEQ | ave | |||
| ) | [inline] |
Attempt to sort the array using given values comparator, avc. If two or more elements in the array are equal, as determined by the equality comparator ave, then the array is not sorted and 0 is returned. Otherwise the array is sorted and returned.
| as_array_object* gnash::as_array_object::sort_indexed | ( | AVCMP | avc | ) | [inline] |
Return a new array containing sorted index of this array.
| avc | boolean functor or function comparing two as_value& objects |
| as_value gnash::as_array_object::sort_indexed | ( | AVCMP | avc, | |
| AVEQ | ave | |||
| ) | [inline] |
Return a new array containing sorted index of this array. If two or more elements in the array are equal, as determined by the equality comparator ave, then 0 is returned instead.
| bool gnash::as_array_object::get_member | ( | string_table::key | name, | |
| as_value * | val, | |||
| string_table::key | nsname = 0 | |||
| ) | [virtual] |
Overridden to provide 'length' member.
TODO: use a property for handling 'length'
Reimplemented from gnash::as_object.
| void gnash::as_array_object::set_member | ( | string_table::key | name, | |
| const as_value & | val, | |||
| string_table::key | nsname = 0 | |||
| ) | [virtual] |
| void gnash::as_array_object::enumerateNonProperties | ( | as_environment & | env | ) | const [virtual] |
Enumerate elements.
See as_object::enumerateNonProperties(as_environment&) for more info.
Reimplemented from gnash::as_object.
1.5.4