2016-07-09 02:18:40 +00:00
|
|
|
#ifndef STRINGBANK_H
|
|
|
|
#define STRINGBANK_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
class StringBank
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StringBank();
|
2018-01-02 14:31:47 +00:00
|
|
|
bool load(const std::string &file);
|
|
|
|
void clear();
|
|
|
|
bool empty() const;
|
2018-01-02 14:31:47 +00:00
|
|
|
void set(int idx, const char *str);
|
2018-01-02 14:31:47 +00:00
|
|
|
const std::string& get(int idx) const;
|
2016-07-09 02:18:40 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
typedef std::map<int, std::string> StringMap;
|
|
|
|
StringMap stringMap;
|
|
|
|
};
|
|
|
|
|
2018-01-02 14:31:47 +00:00
|
|
|
extern StringBank stringbank;
|
|
|
|
|
2016-07-09 02:18:40 +00:00
|
|
|
#endif
|