mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
remove string_table
This commit is contained in:
parent
5e54200b4c
commit
65a30e710f
|
@ -1,31 +0,0 @@
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
#include <xlnt/common/string_table.hpp>
|
|
||||||
|
|
||||||
namespace xlnt {
|
|
||||||
|
|
||||||
int string_table::operator[](const std::string &key) const
|
|
||||||
{
|
|
||||||
for(std::size_t i = 0; i < strings_.size(); i++)
|
|
||||||
{
|
|
||||||
if(key == strings_[i])
|
|
||||||
{
|
|
||||||
return (int)i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw std::runtime_error("bad string");
|
|
||||||
}
|
|
||||||
|
|
||||||
void string_table_builder::add(const std::string &string)
|
|
||||||
{
|
|
||||||
for(std::size_t i = 0; i < table_.strings_.size(); i++)
|
|
||||||
{
|
|
||||||
if(string == table_.strings_[i])
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
table_.strings_.push_back(string);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace xlnt
|
|
Loading…
Reference in New Issue
Block a user