2000-07-24 13:53:19 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 2000 Jean-Marc Lasgouttes
|
|
|
|
*
|
|
|
|
* ======================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef STRPOOL_H
|
|
|
|
#define STRPOOL_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include <vector>
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
class StrPool {
|
|
|
|
public:
|
2000-08-07 20:58:24 +00:00
|
|
|
/// delete all the strings that have been allocated by add()
|
2000-07-24 13:53:19 +00:00
|
|
|
~StrPool();
|
2000-08-07 20:58:24 +00:00
|
|
|
/// Make a copy of the string, and remember it in the pool
|
2000-07-24 13:53:19 +00:00
|
|
|
char const * add(string const & str);
|
|
|
|
|
|
|
|
private:
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
typedef std::vector<char const *> Pool;
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
Pool pool_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|