EDocBFD::Section Class Reference

#include <include/EDocBFD/Section.h>


Detailed Description

Used to simplify writing/reading to/from bfd sections.

Definition at line 35 of file Section.h.

Public Member Functions

 Section (bfd *abfd_in, asection *asect_in)
 Create an instance for the given section of the bfd.
ssize_t Write (unsigned char data)
 Write a char of data to the section.
ssize_t Write (const void *data, size_t len)
 Write data to the given section.
std::string Read (size_t max_size=0xFFFFFFFF)
 Read data from the section.
std::string ReadEx (size_t max_size=0xFFFFFFFF)
 Read data from the section.
ssize_t Read (void *sectbuf, size_t max_size)
 Read data from the section.
ssize_t ReadEx (void *sectbuf, size_t max_size)
 Read data from the section.
bool IsEof () const
 Return true if at the end of the sections data.

Private Attributes

bfd * abfd
 The bfd.
asection * asect
 The bfds section object.
size_t file_pos
 The location of the file pointer in the sections data.
size_t sectsize
 The total size of the section.


Constructor & Destructor Documentation

EDocBFD::Section::Section ( bfd *  abfd_in,
asection *  asect_in 
)

Create an instance for the given section of the bfd.

Note:
EDoc++ data included.

Definition at line 36 of file Section.cpp.

References asect, and sectsize.


Member Function Documentation

EDocBFD::Section::Write ( unsigned char  data  ) 

Write a char of data to the section.

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDocBFD::BFDException 

Definition at line 46 of file Section.cpp.

EDocBFD::Section::Write ( const void *  data,
size_t  len 
)

Write data to the given section.

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDocBFD::BFDException 

Definition at line 51 of file Section.cpp.

References abfd, asect, EDOC_THROW_EXCEPTION, file_pos, and sectsize.

EDocBFD::Section::Read ( size_t  max_size = 0xFFFFFFFF  ) 

Read data from the section.

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDocBFD::BFDException 

Definition at line 75 of file Section.cpp.

References file_pos, and sectsize.

Referenced by ReadEx().

EDocBFD::Section::ReadEx ( size_t  max_size = 0xFFFFFFFF  ) 

Read data from the section.

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDocBFD::BFDException 

Definition at line 147 of file Section.cpp.

References asect, EDOC_THROW_EXCEPTION, file_pos, Read(), and sectsize.

Referenced by EDocBFD::HandleEDocSection().

EDocBFD::Section::Read ( void *  sectbuf,
size_t  max_size 
)

Read data from the section.

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDocBFD::BFDException 

Definition at line 112 of file Section.cpp.

References abfd, asect, EDOC_THROW_EXCEPTION, file_pos, and sectsize.

EDocBFD::Section::ReadEx ( void *  sectbuf,
size_t  max_size 
)

Read data from the section.

Note:
EDoc++ data included.
Exceptions:
EDoc::EOFException 
EDocBFD::BFDException 

Definition at line 163 of file Section.cpp.

References asect, EDOC_THROW_EXCEPTION, file_pos, Read(), and sectsize.

EDocBFD::Section::IsEof (  )  const [inline]

Return true if at the end of the sections data.

Note:
EDoc++ data included.

Definition at line 77 of file Section.h.

References file_pos, and sectsize.

Referenced by EDocBFD::HandleEDocSection().


Field Documentation

bfd* EDocBFD::Section::abfd [private]

The bfd.

Definition at line 89 of file Section.h.

Referenced by Read(), and Write().

asection* EDocBFD::Section::asect [private]

The bfds section object.

Definition at line 94 of file Section.h.

Referenced by Read(), ReadEx(), Section(), and Write().

size_t EDocBFD::Section::file_pos [private]

The location of the file pointer in the sections data.

Definition at line 99 of file Section.h.

Referenced by IsEof(), Read(), ReadEx(), and Write().

size_t EDocBFD::Section::sectsize [private]

The total size of the section.

Definition at line 104 of file Section.h.

Referenced by IsEof(), Read(), ReadEx(), Section(), and Write().


The documentation for this class was generated from the following files:
Generated on Tue Jan 20 18:26:10 2009 for EDoc-0.2.1 by  doxygen 1.5.1