vfs: check userland buffers before reading them.
[haiku.git] / src / apps / haikudepot / edits_generic / EditStack.cpp
blob9c903d6edc6378e2ae0f72591f287af0b70e8798
1 /*
2 * Copyright 2012, Stephan Aßmus <superstippi@gmx.de>
3 * Distributed under the terms of the MIT License.
4 */
6 #include "EditStack.h"
8 #include <stdio.h>
11 EditStack::EditStack()
12 : fEdits()
17 EditStack::~EditStack()
22 bool
23 EditStack::Push(const UndoableEditRef& edit)
25 return fEdits.Add(edit);
29 UndoableEditRef
30 EditStack::Pop()
32 UndoableEditRef edit(Top());
33 fEdits.Remove();
34 return edit;
38 const UndoableEditRef&
39 EditStack::Top() const
41 return fEdits.LastItem();
45 bool
46 EditStack::IsEmpty() const
48 return fEdits.CountItems() == 0;