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 void MathArray::substitute(MathMacro const & m)
29 for (iterator it = begin(); it != end(); ++it)
30 it->nucleus()->substitute(m);
34 MathAtom & MathArray::at(size_type pos)
36 lyx::Assert(pos < size());
41 MathAtom const & MathArray::at(size_type pos) const
43 lyx::Assert(pos < size());
48 void MathArray::insert(size_type pos, MathAtom const & t)
50 bf_.insert(begin() + pos, t);
54 void MathArray::insert(size_type pos, MathArray const & ar)
56 bf_.insert(begin() + pos, ar.begin(), ar.end());
60 void MathArray::push_back(MathAtom const & t)
66 void MathArray::push_back(MathArray const & ar)
72 void MathArray::clear()
78 void MathArray::swap(MathArray & ar)
85 bool MathArray::empty() const
91 MathArray::size_type MathArray::size() const
97 void MathArray::erase()
103 void MathArray::erase(size_type pos)
110 void MathArray::erase(size_type pos1, size_type pos2)
112 bf_.erase(begin() + pos1, begin() + pos2);
116 MathAtom & MathArray::back()
122 void MathArray::dump2() const
124 NormalStream ns(lyxerr);
125 for (const_iterator it = begin(); it != end(); ++it)
126 ns << it->nucleus() << ' ';
130 void MathArray::dump() const
132 NormalStream ns(lyxerr);
133 for (const_iterator it = begin(); it != end(); ++it)
134 ns << "<" << it->nucleus() << ">";
138 void MathArray::validate(LaTeXFeatures & features) const
140 for (const_iterator it = begin(); it != end(); ++it)
142 it->nucleus()->validate(features);
146 void MathArray::pop_back()
149 lyxerr << "pop_back from empty array!\n";
156 MathArray::const_iterator MathArray::begin() const
162 MathArray::const_iterator MathArray::end() const
168 MathArray::iterator MathArray::begin()
174 MathArray::iterator MathArray::end()