This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
neofx-zoomedit/IdManager.h

27 lines
535 B
C
Raw Normal View History

2007-09-28 21:41:00 +00:00
#ifndef IDMANAGER_H_
#define IDMANAGER_H_
#include <string>
#include <set>
#include <map>
class IdManager {
private:
std::set<std::string> usedIds;
std::map<std::string, unsigned long> prefixMap;
bool isValid(const std::string &id) const;
bool unique(const std::string &id) const;
2007-09-28 21:41:00 +00:00
public:
bool add(const std::string &id);
bool remove(const std::string &id);
bool valid(const std::string &id) const;
std::string generate(const std::string &prefix);
};
#endif /*IDMANAGER_H_*/