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 "mathed/support.h"
23 #include "math_defs.h"
36 \brief Low level container for math insets
38 \author Alejandro Aguilar Sierra
40 \author Lars Gullik Bjønnes
41 \version February 2001
48 MathArray(MathArray const &);
50 MathArray(MathArray const &, int from, int to);
52 MathArray & operator=(MathArray const &);
63 void swap(MathArray &);
66 void insert(int pos, MathInset * inset);
68 void insert(int pos, unsigned char, MathTextCodes);
70 void insert(int pos, MathArray const &);
73 void erase(int pos1, int pos2);
79 void replace(int pos, MathInset * inset);
81 bool prev(int & pos) const;
83 bool next(int & pos) const;
85 bool last(int & pos) const;
89 void push_back(MathInset * inset);
91 void push_back(unsigned char, MathTextCodes);
93 void push_back(MathArray const &);
97 MathInset * back_inset() const;
100 void dump(std::ostream &) const;
102 void dump2(std::ostream &) const;
104 void substitute(MathMacro const &);
108 MathInset * nextInset(int pos) const;
110 MathInset * prevInset(int pos) const;
112 unsigned char GetChar(int pos) const;
113 /// read subsequent chars of the same kind.
114 // pos is afterwards one behind the last char belonging to the string
115 string GetString(int & pos) const;
117 MathTextCodes GetCode(int pos) const;
119 void setCode(int pos, MathTextCodes t);
121 bool isInset(int pos) const;
123 void write(std::ostream &, bool) const;
125 void writeNormal(std::ostream &) const;
127 void validate(LaTeXFeatures &) const;
130 typedef std::vector<unsigned char> buffer_type;
132 typedef unsigned char value_type;
135 int item_size(int pos) const;
141 std::ostream & operator<<(std::ostream & os, MathArray const & ar);