5 #include "math_inset.h"
6 #include "math_deliminset.h"
7 #include "math_charinset.h"
8 #include "math_scriptinset.h"
9 #include "math_stringinset.h"
10 #include "math_matrixinset.h"
11 #include "math_mathmlstream.h"
12 #include "math_support.h"
13 #include "math_data.h"
15 #include "support/LAssert.h"
18 MathArray::MathArray()
22 MathArray::MathArray(MathArray const & ar, size_type from, size_type to)
23 : bf_(ar.begin() + from, ar.begin() + to)
27 MathArray::MathArray(iterator from, iterator to)
32 void MathArray::substitute(MathMacro const & m)
34 for (iterator it = begin(); it != end(); ++it)
35 it->nucleus()->substitute(m);
39 MathAtom & MathArray::at(size_type pos)
41 lyx::Assert(pos < size());
46 MathAtom const & MathArray::at(size_type pos) const
48 lyx::Assert(pos < size());
53 void MathArray::insert(size_type pos, MathAtom const & t)
55 bf_.insert(begin() + pos, t);
59 void MathArray::insert(size_type pos, MathArray const & ar)
61 bf_.insert(begin() + pos, ar.begin(), ar.end());
65 void MathArray::push_back(MathAtom const & t)
71 void MathArray::push_back(MathArray const & ar)
77 void MathArray::clear()
83 void MathArray::swap(MathArray & ar)
90 bool MathArray::empty() const
96 MathArray::size_type MathArray::size() const
102 void MathArray::erase()
104 bf_.erase(begin(), end());
108 void MathArray::erase(size_type pos)
115 void MathArray::erase(iterator pos1, iterator pos2)
117 bf_.erase(pos1, pos2);
121 void MathArray::erase(iterator pos)
127 void MathArray::erase(size_type pos1, size_type pos2)
129 bf_.erase(begin() + pos1, begin() + pos2);
133 MathAtom & MathArray::back()
139 void MathArray::dump2() const
141 NormalStream ns(lyxerr);
142 for (const_iterator it = begin(); it != end(); ++it)
143 ns << it->nucleus() << ' ';
147 void MathArray::dump() const
149 NormalStream ns(lyxerr);
150 for (const_iterator it = begin(); it != end(); ++it)
151 ns << "<" << it->nucleus() << ">";
155 void MathArray::validate(LaTeXFeatures & features) const
157 for (const_iterator it = begin(); it != end(); ++it)
159 it->nucleus()->validate(features);
163 void MathArray::pop_back()
166 lyxerr << "pop_back from empty array!\n";
173 MathArray::const_iterator MathArray::begin() const
179 MathArray::const_iterator MathArray::end() const
185 MathArray::iterator MathArray::begin()
191 MathArray::iterator MathArray::end()