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"
26 class MathScriptInset;
35 \brief A resizable array.
37 A general purpose resizable array.
39 \author Alejandro Aguilar Sierra
41 \author Lars Gullik Bjønnes
42 \version February 2001
49 MathArray(MathArray const &);
51 MathArray & operator=(MathArray const &);
62 void swap(MathArray &);
65 void insert(int pos, MathInset * inset);
67 void insert(int pos, byte, MathTextCodes);
69 void insert(int pos, MathArray const &);
72 void erase(int pos1, int pos2);
76 void replace(int pos, MathInset * inset);
78 bool prev(int & pos) const;
80 bool next(int & pos) const;
82 bool last(int & pos) const;
86 void push_back(MathInset * inset);
88 void push_back(byte, MathTextCodes);
90 void push_back(MathArray const &);
92 MathInset * back_inset() const;
95 void dump(std::ostream &) const;
97 void dump2(std::ostream &) const;
99 void substitute(MathMacro const &);
103 MathInset * GetInset(int pos) const;
105 MathScriptInset * prevScriptInset(int pos) const;
107 MathScriptInset * nextScriptInset(int pos) const;
109 byte GetChar(int pos) const;
111 MathTextCodes GetCode(int pos) const;
113 void setCode(int pos, MathTextCodes t);
115 bool isInset(int pos) const;
117 void Write(std::ostream &, bool) const;
119 void WriteNormal(std::ostream &) const;
122 typedef std::vector<byte> buffer_type;
124 typedef byte value_type;
127 int item_size(int pos) const;
133 std::ostream & operator<<(std::ostream & os, MathArray const & ar);