| 37 | } |
| 38 | |
| 39 | size_t |
| 40 | CElfStringTable::AddString( |
| 41 | const std::string& str) |
| 42 | { |
| 43 | size_t location = m_Data.size(); |
| 44 | // Plus 1 for the NUL. |
| 45 | m_Data.resize(location + str.size() + 1); |
| 46 | memcpy(&m_Data[location], str.data(), str.size()); |
| 47 | m_Data[location + str.size()] = '\0'; |
| 48 | |
| 49 | return location; |
| 50 | } |