Make load/save functions of section/segment - private

This commit is contained in:
Serge Lamikhov-Center 2012-03-10 20:41:00 +02:00
parent 785a7767ea
commit 626ccc6cbd
2 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,7 @@ namespace ELFIO {
class section
{
friend class elfio;
public:
virtual ~section() {};
@ -65,6 +66,7 @@ class section
virtual void append_data( const char* pData, Elf_Word size ) = 0;
virtual void append_data( const std::string& data ) = 0;
protected:
virtual void load( std::ifstream& f,
std::streampos header_offset ) const = 0;
virtual void save( std::ofstream& f,
@ -190,6 +192,8 @@ class section_impl : public section
return append_data( str_data.c_str(), str_data.size() );
}
//------------------------------------------------------------------------------
protected:
//------------------------------------------------------------------------------
void
load( std::ifstream& stream,

View File

@ -32,6 +32,7 @@ namespace ELFIO {
class segment
{
friend class elfio;
public:
virtual ~segment() {};
@ -59,6 +60,7 @@ class segment
virtual Elf_Half get_sections_num() const = 0;
virtual Elf_Half get_section_index_at( Elf_Half num ) const = 0;
protected:
virtual void load( std::ifstream& stream, std::streampos header_offset ) const = 0;
virtual void save( std::ofstream& f, std::streampos header_offset,
std::streampos data_offset ) = 0;
@ -145,6 +147,8 @@ class segment_impl : public segment
return -1;
}
//------------------------------------------------------------------------------
protected:
//------------------------------------------------------------------------------
void
load( std::ifstream& stream,