10 // Is this still needed? (Lgb)
12 void * my_memcpy(void * ps_in, void const * pt_in, size_t n)
14 char * ps = static_cast<char *>(ps_in);
15 char const * pt = static_cast<char const *>(pt_in);
16 while (n--) *ps++ = *pt++;
21 MathedArray::MathedArray()
26 MathedArray::iterator MathedArray::begin()
32 MathedArray::iterator MathedArray::end()
38 MathedArray::const_iterator MathedArray::begin() const
44 MathedArray::const_iterator MathedArray::end() const
50 int MathedArray::empty() const
56 int MathedArray::last() const
62 void MathedArray::last(int l)
68 void MathedArray::need_size(int needed)
70 if (needed >= static_cast<int>(bf_.size()))
75 void MathedArray::resize(int newsize)
77 // still a bit smelly...
79 bf_.resize(newsize + 1);
86 void MathedArray::move(int p, int shift)
89 need_size(last_ + shift);
90 memmove(&bf_[p + shift], &bf_[p], last_ - p);
98 void MathedArray::insert(MathedArray::iterator pos,
99 MathedArray::const_iterator beg,
100 MathedArray::const_iterator end)
102 bf_.insert(pos, beg, end);
103 last_ = bf_.size() - 1;
106 void MathedArray::mergeF(MathedArray * a, int p, int dx)
108 my_memcpy(&bf_[p], &a->bf_[0], dx);
113 void MathedArray::raw_pointer_copy(MathedInset ** p, int pos) const
115 my_memcpy(p, &bf_[pos], sizeof(MathedInset*));
120 void MathedArray::insertInset(int pos, MathedInset * p, int type)
122 //bf_.insert(pos, type);
123 InsetTable tmp(pos, p);
124 insetList_.push_back(tmp);
128 MathedInset * MathedArray::getInset(int pos)
130 InsetList::const_iterator cit = insetList_.begin();
131 InsetList::const_iterator end = insetList_.end();
132 for (; cit != end; ++cit) {
133 if ((*cit).pos == pos)
138 // We would really like to throw an exception instead... (Lgb)
139 // throw inset_not_found();
143 void MathedArray::raw_pointer_insert(void * p, int pos, int len)
145 my_memcpy(&bf_[pos], &p, len);
150 void MathedArray::strange_copy(MathedArray * dest, int dpos,
153 my_memcpy(&dest->bf_[dpos], &bf_[spos], len);
157 byte MathedArray::operator[](int i) const
163 byte & MathedArray::operator[](int i)