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"
35 \brief Low level container for math insets
37 \author Alejandro Aguilar Sierra
39 \author Lars Gullik Bjønnes
40 \version February 2001
47 MathArray(MathArray const &);
49 MathArray & operator=(MathArray const &);
60 void swap(MathArray &);
63 void insert(int pos, MathInset * inset);
65 void insert(int pos, byte, MathTextCodes);
67 void insert(int pos, MathArray const &);
70 void erase(int pos1, int pos2);
74 void replace(int pos, MathInset * inset);
76 bool prev(int & pos) const;
78 bool next(int & pos) const;
80 bool last(int & pos) const;
84 void push_back(MathInset * inset);
86 void push_back(byte, MathTextCodes);
88 void push_back(MathArray const &);
90 MathInset * back_inset() const;
93 void dump(std::ostream &) const;
95 void dump2(std::ostream &) const;
97 void substitute(MathMacro const &);
101 MathInset * nextInset(int pos) const;
103 MathInset * prevInset(int pos) const;
105 byte GetChar(int pos) const;
106 /// read subsequent chars of the same kind.
107 // pos is afterwards one behind the last char belonging to the string
108 string GetString(int & pos) const;
110 MathTextCodes GetCode(int pos) const;
112 void setCode(int pos, MathTextCodes t);
114 bool isInset(int pos) const;
116 void Write(std::ostream &, bool) const;
118 void WriteNormal(std::ostream &) const;
121 typedef std::vector<byte> buffer_type;
123 typedef byte value_type;
126 int item_size(int pos) const;
132 std::ostream & operator<<(std::ostream & os, MathArray const & ar);