diff options
author | John Hodge <tpg@mutabah.net> | 2019-10-29 20:37:51 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2019-10-29 20:37:51 +0800 |
commit | a1a03108029fa6bd092bc8f141acbc4cdb210e01 (patch) | |
tree | 2670dbc62fe4e3a09fc0818f3f9b966e2109367f /tools/minicargo/stringlist.h | |
parent | 2d807e6d573d58a7b5e49cf1642691b0b963a34e (diff) | |
download | mrust-a1a03108029fa6bd092bc8f141acbc4cdb210e01.tar.gz |
minicargo - Fixes to build script support for winapi
Diffstat (limited to 'tools/minicargo/stringlist.h')
-rw-r--r-- | tools/minicargo/stringlist.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/minicargo/stringlist.h b/tools/minicargo/stringlist.h index 4381121b..08b74c4b 100644 --- a/tools/minicargo/stringlist.h +++ b/tools/minicargo/stringlist.h @@ -78,7 +78,7 @@ public: }; class StringListKV: private StringList { - ::std::vector<const char*> m_keys; + StringList m_keys; public: StringListKV() { @@ -99,6 +99,16 @@ public: m_keys.push_back(k); StringList::push_back(v); } + void push_back(::std::string k, ::std::string v) + { + m_keys.push_back(k); + StringList::push_back(v); + } + void push_back(::std::string k, const char* v) + { + m_keys.push_back(k); + StringList::push_back(v); + } struct Iter { const StringListKV& v; @@ -108,7 +118,7 @@ public: this->i++; } ::std::pair<const char*,const char*> operator*() { - return ::std::make_pair(this->v.m_keys[this->i], this->v.get_vec()[this->i]); + return ::std::make_pair(this->v.m_keys.get_vec()[this->i], this->v.get_vec()[this->i]); } bool operator!=(const Iter& x) const { return this->i != x.i; @@ -118,7 +128,7 @@ public: return Iter { *this, 0 }; } Iter end() const { - return Iter { *this, m_keys.size() }; + return Iter { *this, m_keys.get_vec().size() }; } friend ::std::ostream& operator<<(::std::ostream& os, const StringListKV& x) { |