From 3b98f3439e33b15bba2036c402f9925340fdb2b9 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 29 Jun 2013 23:23:43 -0700 Subject: Poison std::string and use the various string classes --- src/common/intern-pool.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/common/intern-pool.hpp') diff --git a/src/common/intern-pool.hpp b/src/common/intern-pool.hpp index caa54e4..db840a2 100644 --- a/src/common/intern-pool.hpp +++ b/src/common/intern-pool.hpp @@ -4,16 +4,19 @@ #include #include -#include #include +#include "strings.hpp" + class InternPool { - std::map known; - std::vector names; + std::map known; + std::vector names; public: - size_t intern(const std::string& name) + size_t intern(XString name_) { + FString name = name_; + // hm, I could change this to do aliases auto pair = known.insert({name, known.size()}); if (pair.second) names.push_back(name); @@ -21,7 +24,7 @@ public: return pair.first->second; } - const std::string& outtern(size_t sz) const + ZString outtern(size_t sz) const { return names[sz]; } -- cgit v1.2.3-70-g09d2