#ifndef __MARKLIST_HPP #define __MARKLIST_HPP #include "chain.hpp" #include "buffer.hpp" #include "newstrdup.hpp" class NamedBufferMark : public BufferMark { Buffer *buffer; char *name; public: NamedBufferMark(Buffer *buf, const char *n) : BufferMark(), buffer(buf), name(newstrdup(n)) { buffer->addMark(this); } NamedBufferMark(Buffer *buf, const char *n, unsigned l, unsigned c, stickto s) : BufferMark(l,c,s), buffer(buf), name(newstrdup(n)) { buffer->addMark(this); } NamedBufferMark(const NamedBufferMark &bm) : BufferMark(bm), buffer(bm.buffer), name(newstrdup(bm.name)) { buffer->addMark(this); } ~NamedBufferMark(); const char *queryName() const { return name; } }; class MarkList : public Chain { public: MarkList(); ~MarkList(); NamedBufferMark *find(const char *name); }; #endif