Re: Need some explanation about iterators

2005-01-25 Thread Alfredo Braunstein
Andreas Vox wrote: > So ParIterator defines ++ to forwardPar() and InsetIterator defines > ++ to forwardInset() ? Exactly. Have a look at insetiterator.[Ch] for instance, it's very small. Alfredo

Re: Need some explanation about iterators

2005-01-25 Thread Andreas Vox
Alfredo Braunstein <[EMAIL PROTECTED]> writes: > > Not quite: These two are mere wrappers arount DocIterator, basically > DocIterator is NOT a forward iterator (it doesn't have operator++, but > forward{Par,Pos,Inset} methods), and these two are. All three iterate in a > full subtree of the lyx d

Re: Need some explanation about iterators

2005-01-25 Thread Alfredo Braunstein
Angus Leeming wrote: > Alfredo Braunstein wrote: > >> All insets, not only top-level (but you probably meant that). > > Ahh yes, you're right. However, note that the code *use to* iterate over > all insets with the proviso that the entire contents of a math inset were > treated as a single whole

Re: Need some explanation about iterators

2005-01-25 Thread Angus Leeming
Alfredo Braunstein wrote: > All insets, not only top-level (but you probably meant that). Ahh yes, you're right. However, note that the code *use to* iterate over all insets with the proviso that the entire contents of a math inset were treated as a single whole. That is, all those bit-of-math

Re: Need some explanation about iterators

2005-01-25 Thread Alfredo Braunstein
Angus Leeming wrote: > Andreas Vox wrote: >> 3. Which iterator would I use to iterate all mathhull-insets >> for snippet collection? Insetiterator? > > See src/graphics/Previews.C > This iterates over all top level insets. > > void Previews::generateBufferPreviews(Buffer const & buffer) const >

Re: Need some explanation about iterators

2005-01-25 Thread Andreas Vox
Angus Leeming wrote: Andreas Vox wrote: 3. Which iterator would I use to iterate all mathhull-insets for snippet collection? Insetiterator? See src/graphics/Previews.C This iterates over all top level insets. void Previews::generateBufferPreviews(Buffer const & buffer) const { PreviewLoader &

Re: Need some explanation about iterators

2005-01-25 Thread Alfredo Braunstein
Andreas Vox wrote: > Hi! Hi Andreas, > As a newbie I'm still trying to figure out how to use > the various iterators. My current hypotheses are: > > DocIterator is used to iterate the whole document in a > preorder style. Ok. > ParagraphIterator is used to iterate over paragraphs local > to

Re: Need some explanation about iterators

2005-01-25 Thread Lars Gullik Bjønnes
Andreas Vox <[EMAIL PROTECTED]> writes: | 4. Are these iterators compatible with STL? Almost. not quite. -- Lgb

Re: Need some explanation about iterators

2005-01-25 Thread Angus Leeming
Andreas Vox wrote: > 3. Which iterator would I use to iterate all mathhull-insets > for snippet collection? Insetiterator? See src/graphics/Previews.C This iterates over all top level insets. void Previews::generateBufferPreviews(Buffer const & buffer) const { PreviewLoader & ploader = loade

Need some explanation about iterators

2005-01-25 Thread Andreas Vox
Hi! As a newbie I'm still trying to figure out how to use the various iterators. My current hypotheses are: DocIterator is used to iterate the whole document in a preorder style. ParagraphIterator is used to iterate over paragraphs local to one surrounding inset. InsetIterator iterates over the who