3 * Purpose: A general purpose resizable array.
4 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
5 * Created: January 1996
7 * Dependencies: None (almost)
9 * Copyright: 1996, Alejandro Aguilar Sierra
12 * You are free to use and modify this code under the terms of
13 * the GNU General Public Licence version 2 or later.
22 #include "math_atom.h"
35 \brief Low level container for math insets
37 \author Alejandro Aguilar Sierra
39 \author Lars Gullik Bjønnes
40 \version February 2001
46 typedef std::vector<MathAtom> buffer_type;
48 typedef buffer_type::const_iterator const_iterator;
50 typedef buffer_type::iterator iterator;
52 typedef buffer_type::size_type size_type;
54 typedef buffer_type::size_type idx_type;
56 typedef buffer_type::size_type pos_type;
62 MathArray(MathArray const &, size_type from, size_type to);
64 MathArray(iterator from, iterator to);
67 size_type size() const;
73 void swap(MathArray &);
76 void insert(size_type pos, MathAtom const &);
78 void insert(size_type pos, MathArray const &);
81 void erase(iterator pos1, iterator pos2);
83 void erase(iterator pos);
85 void erase(size_type pos1, size_type pos2);
87 void erase(size_type pos);
92 void push_back(MathAtom const &);
94 void push_back(MathArray const &);
103 MathAtom const & front() const;
110 void substitute(MathMacro const &);
111 /// looks for exact match
112 bool match(MathArray const &) const;
113 /// looks for inclusion match starting at pos
114 bool matchpart(MathArray const &, pos_type pos) const;
115 /// looks for containment
116 const_iterator find(MathArray const &) const;
118 void replace(ReplaceData &);
121 MathAtom & at(size_type pos);
123 MathAtom const & at(size_type pos) const;
125 void validate(LaTeXFeatures &) const;
127 const_iterator begin() const;
129 const_iterator end() const;
141 std::ostream & operator<<(std::ostream & os, MathArray const & ar);