// -*- C++ -*- /* * File: array.h * Purpose: A general purpose resizable array. * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx> * Created: January 1996 * * Dependencies: None (almost) * * Copyright: (c) 1996, Alejandro Aguilar Sierra * 1997 The LyX Team! * * You are free to use and modify this code under the terms of * the GNU General Public Licence version 2 or later.
*/
#include <string.h>
#ifndef byte #define byte unsignedchar #endif
/*@Doc: A resizable array Why is it called "LyXArrayBase" if it is generic? (Lgb) Initially I thought it could be the base class for both mathed's and LyX' kernels data buffer. (Ale)
*/ class LyxArrayBase { public: /// enum { ///
ARRAY_SIZE = 256, ///
ARRAY_STEP = 16, ///
ARRAY_MIN_SIZE = 4
};
inline void LyxArrayBase::Insert(int pos, byte c)
{ if (pos<0) pos = last; if (pos>=maxsize)
Resize(maxsize+ARRAY_STEP);
bf[pos] = c; if (pos>=last)
last = pos+1;
}
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.