23 #ifndef ELFIO_STRINGS_HPP
24 #define ELFIO_STRINGS_HPP
40 const char* get_string(Elf_Word index)
const {
42 if (index < string_section->get_size()) {
43 const char* data = string_section->get_data();
55 Elf_Word add_string(
const char* str) {
56 Elf_Word current_position = 0;
60 current_position = (Elf_Word)string_section->get_size();
62 if (current_position == 0) {
63 char empty_string =
'\0';
64 string_section->append_data(&empty_string, 1);
67 string_section->append_data(str, (Elf_Word)std::strlen(str) + 1);
70 return current_position;
75 Elf_Word add_string(
const std::string& str) {
return add_string(str.c_str()); }
84 #endif // ELFIO_STRINGS_HPP