Documentation update

This commit is contained in:
Serge Lamikhov-Center 2012-03-11 06:16:31 +02:00
parent 878f0c6dcb
commit 9705f1ac35
7 changed files with 106 additions and 191 deletions

View File

@ -2,8 +2,9 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY elfio_class_data_members_table SYSTEM "elfio_class_data_members_table.docbook">
<!ENTITY elfio_class_members_table SYSTEM "elfio_class_members_table.docbook">
<!ENTITY elfio_data_members_table SYSTEM "elfio_data_members_table.docbook">
<!ENTITY elfio_members_table SYSTEM "elfio_members_table.docbook">
<!ENTITY section_members_table SYSTEM "section_members_table.docbook">
]>
<book>
@ -293,7 +294,7 @@ int main( int argc, char** argv )
<title>ELFDump Utility</title>
<para>
The source code for the ELF Dumping Utility can be found in
the "Examples" directory; included there are more examples on how
the "examples" directory; there also located more examples on how
to use different ELFIO reader interfaces.
</para>
</sect1>
@ -301,17 +302,13 @@ int main( int argc, char** argv )
<sect1>
<title>ELF File Writer</title>
<para>
The ELFIO library is a header only library. No preparatory compilation
steps are required. To make your application be aware about the
ELFIO classes and types declarations, just include <filename>elfio.hpp</filename> header file.
All ELFIO library declarations reside in ELFIO namespace.
So, our tutorial code starts from this:
TODO
</para>
</sect1>
</chapter>
<chapter id="section-interface">
<chapter id="library-classes">
<title>ELFIO Library Classes</title>
<sect1>
@ -319,32 +316,46 @@ int main( int argc, char** argv )
<sect2>
<title>Data members</title>
<para>
The ELFIO library consists of two independent parts: ELF File Reader
The ELFIO library's main class is <classname>elfio</classname>. The class
contains the following two public data members: sections and segments:
</para>
<para>
&elfio_class_data_members_table;
&elfio_data_members_table;
</para>
</sect2>
<sect2>
<title>Member functions</title>
<para>
The ELFIO library consists of two independent parts: ELF File Reader
(<classname>IELFI</classname>)
and ELF Producer (<classname>IELFO</classname>).
Each is represented by its own set of interfaces.
The library does not contain any classes that need to be explicitly
instantiated. ELFIO itself provides the interfaces that
are used to access the library's functionality.
Here is the list of <classname>elfio</classname> public member functions.
Most of the functions permit to retrieve or set ELF file properties.
</para>
<para>
&elfio_class_members_table;
&elfio_members_table;
</para>
</sect2>
</sect1>
</chapter>
<chapter id="ielfo">
<sect1>
<title>Class <classname>section</classname></title>
<para>
Class <classname>section</classname> has no public data members.
</para>
<sect2>
<title>Member functions</title>
<para>
Here is the list of <classname>section</classname> public member functions.
These functions permit to retrieve or set ELF file section properties.
</para>
<para>
&section_members_table;
</para>
</sect2>
</sect1>
</chapter>
<!--chapter id="ielfo">
<title>
<classname>IELFO</classname> - ELF File Producer Interface
</title>
@ -466,6 +477,6 @@ int main( int argc, char** argv )
Also, in the "Examples" directory, two other programs "WriteObj"
and "WriteObj2" demonstrate the creation of ELF object files.
</para>
</chapter>
</chapter-->
</book>

View File

@ -1,6 +1,4 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ELFIO</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="ELFIO"><div class="titlepage"><div><div><h1 class="title"><a name="id9258110"></a>ELFIO</h1></div><div><h2 class="subtitle">User's Guide</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Serge</span> <span class="surname">Lamikhov-Center</span></h3></div></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="#introduction">Introduction</a></span></dt><dt><span class="chapter"><a href="#get-started">1. Getting Started With ELFIO</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id9251769">ELF File Reader</a></span></dt><dt><span class="sect1"><a href="#id9263921">ELF Section Data Accessors</a></span></dt><dt><span class="sect1"><a href="#id9262695">ELFDump Utility</a></span></dt><dt><span class="sect1"><a href="#id9242659">ELF File Writer</a></span></dt></dl></dd><dt><span class="chapter"><a href="#section-interface">2. ELFIO Library Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id9260651">Class <code class="classname">elfio</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="#id9241419">Data members</a></span></dt><dt><span class="sect2"><a href="#id9255766">Member functions</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#ielfo">3.
<code class="classname">IELFO</code> - ELF File Producer Interface
</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>2.1. <a href="#id9262673">Class <code class="classname">elfio</code> member functions</a></dt><dt>2.2. <a href="#id9251883">Class <code class="classname">elfio</code> member functions</a></dt><dt>2.3. <a href="#id9246518">Class <code class="classname">elfio</code> member functions (continue)</a></dt></dl></div><div class="preface" title="Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="introduction"></a>Introduction</h2></div></div></div><p>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ELFIO</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="ELFIO"><div class="titlepage"><div><div><h1 class="title"><a name="id9258111"></a>ELFIO</h1></div><div><h2 class="subtitle">User's Guide</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Serge</span> <span class="surname">Lamikhov-Center</span></h3></div></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="#introduction">Introduction</a></span></dt><dt><span class="chapter"><a href="#get-started">1. Getting Started With ELFIO</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id9251769">ELF File Reader</a></span></dt><dt><span class="sect1"><a href="#id9263921">ELF Section Data Accessors</a></span></dt><dt><span class="sect1"><a href="#id9262695">ELFDump Utility</a></span></dt><dt><span class="sect1"><a href="#id9242659">ELF File Writer</a></span></dt></dl></dd><dt><span class="chapter"><a href="#section-interface">2. ELFIO Library Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id9264504">Class <code class="classname">elfio</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="#id9241422">Data members</a></span></dt><dt><span class="sect2"><a href="#id9234801">Member functions</a></span></dt></dl></dd></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>2.1. <a href="#id9244982">Class <code class="classname">elfio</code> member functions</a></dt><dt>2.2. <a href="#id9250449">Class <code class="classname">elfio</code> member functions</a></dt><dt>2.3. <a href="#id9260383">Class <code class="classname">elfio</code> member functions (continue)</a></dt></dl></div><div class="preface" title="Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="introduction"></a>Introduction</h2></div></div></div><p>
ELFIO is a C++ library for reading and generating files in ELF binary
format. This library is independent and does not require any other product.
It is also cross-platform - the library uses standard ANSI C++ constructions
@ -190,42 +188,33 @@ int main( int argc, char** argv )
in the symbol table.
</p></div><div class="sect1" title="ELFDump Utility"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id9262695"></a>ELFDump Utility</h2></div></div></div><p>
The source code for the ELF Dumping Utility can be found in
the "Examples" directory; included there are more examples on how
the "examples" directory; there also located more examples on how
to use different ELFIO reader interfaces.
</p></div><div class="sect1" title="ELF File Writer"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id9242659"></a>ELF File Writer</h2></div></div></div><p>
The ELFIO library is a header only library. No preparatory compilation
steps are required. To make your application be aware about the
ELFIO classes and types declarations, just include <code class="filename">elfio.hpp</code> header file.
All ELFIO library declarations reside in ELFIO namespace.
So, our tutorial code starts from this:
</p></div></div><div class="chapter" title="Chapter 2. ELFIO Library Classes"><div class="titlepage"><div><div><h2 class="title"><a name="section-interface"></a>Chapter 2. ELFIO Library Classes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id9260651">Class <code class="classname">elfio</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="#id9241419">Data members</a></span></dt><dt><span class="sect2"><a href="#id9255766">Member functions</a></span></dt></dl></dd></dl></div><div class="sect1" title="Class elfio"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id9260651"></a>Class <code class="classname">elfio</code></h2></div></div></div><div class="sect2" title="Data members"><div class="titlepage"><div><div><h3 class="title"><a name="id9241419"></a>Data members</h3></div></div></div><p>
The ELFIO library consists of two independent parts: ELF File Reader
TODO
</p></div></div><div class="chapter" title="Chapter 2. ELFIO Library Classes"><div class="titlepage"><div><div><h2 class="title"><a name="section-interface"></a>Chapter 2. ELFIO Library Classes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id9264504">Class <code class="classname">elfio</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="#id9241422">Data members</a></span></dt><dt><span class="sect2"><a href="#id9234801">Member functions</a></span></dt></dl></dd></dl></div><div class="sect1" title="Class elfio"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id9264504"></a>Class <code class="classname">elfio</code></h2></div></div></div><div class="sect2" title="Data members"><div class="titlepage"><div><div><h3 class="title"><a name="id9241422"></a>Data members</h3></div></div></div><p>
The ELFIO library's main class is <code class="classname">elfio</code>. The class
contains the following two public data members: sections and segments:
</p><p>
</p><div class="table"><a name="id9262673"></a><p class="title"><b>Table 2.1. Class <code class="classname">elfio</code> member functions</b></p><div class="table-contents"><table summary="Class elfio member functions" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="center">Function</th><th align="center">Description</th></tr></thead><tbody><tr><td align="left">
</p><div class="table"><a name="id9244982"></a><p class="title"><b>Table 2.1. Class <code class="classname">elfio</code> member functions</b></p><div class="table-contents"><table summary="Class elfio member functions" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="center">Data member</th><th align="center">Description</th></tr></thead><tbody><tr><td align="left">
sections
</td><td align="left">
A container that stores pointers to ELF file section instances.
implementing operator[] and size() f
The container stores ELFIO library section instances.
Implements operator[] and size(). operator[] permits access to
individual ELF file section according to its index.
</td></tr><tr><td align="left">
<div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">bool <b class="fsfunc">load</b>
(</code></td><td><var class="pdparam">file_name</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>const std::string&amp; <var class="pdparam">file_name</var>
</code>;</div><div class="funcprototype-spacer"> </div></div>
segments
</td><td align="left">
Initializes <code class="classname">elfio</code> object by loading data
from ELF binary file. File name provided in <em class="parameter"><code>file_name</code></em>.
Returns <span class="returnvalue">true</span> if the file was processed successfully.
The container stores ELFIO library segment instances.
Implements operator[] and size(). operator[] permits access to
individual ELF file segment according to its index.
</td></tr></tbody></table></div></div><p><br class="table-break">
</p></div><div class="sect2" title="Member functions"><div class="titlepage"><div><div><h3 class="title"><a name="id9255766"></a>Member functions</h3></div></div></div><p>
The ELFIO library consists of two independent parts: ELF File Reader
(<code class="classname">IELFI</code>)
and ELF Producer (<code class="classname">IELFO</code>).
Each is represented by its own set of interfaces.
The library does not contain any classes that need to be explicitly
instantiated. ELFIO itself provides the interfaces that
are used to access the library's functionality.
</p></div><div class="sect2" title="Member functions"><div class="titlepage"><div><div><h3 class="title"><a name="id9234801"></a>Member functions</h3></div></div></div><p>
Here is the list of <code class="classname">elfio</code> public member functions.
Most of the functions permit to retrieve or set ELF file properties.
</p><p>
</p><div class="table"><a name="id9251883"></a><p class="title"><b>Table 2.2. Class <code class="classname">elfio</code> member functions</b></p><div class="table-contents"><table summary="Class elfio member functions" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="center">Function</th><th align="center">Description</th></tr></thead><tbody><tr><td align="left">
</p><div class="table"><a name="id9250449"></a><p class="title"><b>Table 2.2. Class <code class="classname">elfio</code> member functions</b></p><div class="table-contents"><table summary="Class elfio member functions" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="center">Function</th><th align="center">Description</th></tr></thead><tbody><tr><td align="left">
<div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">
<b class="fsfunc">elfio</b>
(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div></div>
@ -355,7 +344,7 @@ int main( int argc, char** argv )
</td></tr></tbody></table></div></div><p><br class="table-break">
</p><div class="table"><a name="id9246518"></a><p class="title"><b>Table 2.3. Class <code class="classname">elfio</code> member functions (continue)</b></p><div class="table-contents"><table summary="Class elfio member functions (continue)" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="center">Function</th><th align="center">Description</th></tr></thead><tbody><tr><td align="left">
</p><div class="table"><a name="id9260383"></a><p class="title"><b>Table 2.3. Class <code class="classname">elfio</code> member functions (continue)</b></p><div class="table-contents"><table summary="Class elfio member functions (continue)" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="center">Function</th><th align="center">Description</th></tr></thead><tbody><tr><td align="left">
<div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">Elf64_Addr <b class="fsfunc">get_entry</b>
(</code></td><td><code>)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div></div>
</td><td align="left">
@ -409,113 +398,4 @@ int main( int argc, char** argv )
<code class="classname">elfio</code> object instance.
</td></tr></tbody></table></div></div><p><br class="table-break">
</p></div></div></div><div class="chapter" title="Chapter 3.  IELFO - ELF File Producer Interface"><div class="titlepage"><div><div><h2 class="title"><a name="ielfo"></a>Chapter 3. 
<code class="classname">IELFO</code> - ELF File Producer Interface
</h2></div></div></div><p>
The ELFIO library can help you build a very short ELF executable file.
This chapter shows how to build an executable file that will run on
x86 Linux machines and print "Hello World!" on your console.
</p><p>
Just as with the reader, the first step is to get
a pointer onto the ELF File Writer (Producer):
</p><pre class="programlisting">
IELFO* pELFO;
ELFIO::GetInstance()-&gt;CreateELFO( &amp;pELFO );
</pre><p>
</p><p>
Before continuing, the library must be informed about the main
attributes of the executable file to be built. To do this, declare
that the executable ELF file will run on a 32 bit x86 machine; has little
endian encoding and uses the current version of the ELF file format:
</p><pre class="programlisting">
// You can't proceed without this function call!
pELFO-&gt;SetAttr( ELFCLASS32, ELFDATA2LSB, EV_CURRENT,
ET_EXEC, EM_386, EV_CURRENT, 0 );
</pre><p>
</p><p>
Some sections of an ELF executable file should reside in the program
segments. To create this loadable segment call the
<code class="methodname">AddSegment()</code> function.
</p><pre class="programlisting">
// Create a loadable segment
IELFOSegment* pSegment = pELFO-&gt;AddSegment( PT_LOAD,
0x08040000,
0x08040000,
PF_X | PF_R,
0x1000 );
</pre><p>
</p><p>
The following segment serves as a placeholder for our code section.
To create this code section call the AddSection() function:
</p><pre class="programlisting">
// Create code section
IELFOSection* pTextSec = pELFO-&gt;AddSection( ".text",
SHT_PROGBITS,
SHF_ALLOC | SHF_EXECINSTR,
0,
0x10,
0 );
</pre><p>
</p><p>
Then, add the executable code for the section:
</p><pre class="programlisting">
char text[] =
{ '\xB8', '\x04', '\x00', '\x00', '\x00', // mov eax, 4
'\xBB', '\x01', '\x00', '\x00', '\x00', // mov ebx, 1
'\xB9', '\xFD', '\x00', '\x04', '\x08', // mov ecx, msg
'\xBA', '\x0E', '\x00', '\x00', '\x00', // mov edx, 14
'\xCD', '\x80', // int 0x80
'\xB8', '\x01', '\x00', '\x00', '\x00', // mov eax, 1
'\xCD', '\x80', // int 0x80
'\x48', '\x65', '\x6C', '\x6C', '\x6F', // db 'Hello'
'\x2C', '\x20', '\x57', '\x6F', '\x72', // db ', Wor'
'\x6C', '\x64', '\x21', '\x0A' // db 'ld!', 10
};
pTextSec-&gt;SetData( text, sizeof( text ) );
</pre><p>
</p><p>
Next, this code section is put into the loadable segment:
</p><pre class="programlisting">
// Add code section into program segment
pSegment-&gt;AddSection( pTextSec );
pTextSec-&gt;Release();
pSegment-&gt;Release();
</pre><p>
</p><p>
Finally, define the start address of the program
and create the result file:
</p><pre class="programlisting">
// Set program entry point
pELFO-&gt;SetEntry( 0x08040000 );
// Create ELF file
pELFO-&gt;Save( "test.elf" );
pELFO-&gt;Release();
</pre><p>
</p><p>
Please note: Call the <code class="methodname">Release()</code> functions
for each interface you have used.
This will free all resources the ELFIO library has created.
</p><p>
Now compile the program and run it. The result is a new ELF file
called "test.elf". The size of this working executable file is only
267 bytes! Run it on your Linux machine with the following commands:
</p><pre class="programlisting">
[Writer]$ ./Writer
[Writer]$ chmod +x test.elf
[Writer]$ ./test.elf
Hello, World!
</pre><p>
</p><p>
The full text for this program can be found in the "Writer" directory.
Also, in the "Examples" directory, two other programs "WriteObj"
and "WriteObj2" demonstrate the creation of ELF object files.
</p></div></div></body></html>
</p></div></div></div></div></body></html>

Binary file not shown.

View File

@ -5,7 +5,7 @@
<colspec colname='c2'/>
<thead>
<row>
<entry align="center">Function</entry>
<entry align="center">Data member</entry>
<entry align="center">Description</entry>
</row>
</thead>
@ -15,25 +15,19 @@
sections
</entry>
<entry>
A container that stores pointers to ELF file section instances.
implementing operator[] and size() f
The container stores ELFIO library section instances.
Implements operator[] and size(). operator[] permits access to
individual ELF file section according to its index.
</entry>
</row>
<row>
<entry>
<funcsynopsis>
<funcprototype>
<funcdef>bool <function>load</function>
</funcdef>
<paramdef>const std::string&amp; <parameter>file_name</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
segments
</entry>
<entry>
Initializes <classname>elfio</classname> object by loading data
from ELF binary file. File name provided in <parameter>file_name</parameter>.
Returns <returnvalue>true</returnvalue> if the file was processed successfully.
The container stores ELFIO library segment instances.
Implements operator[] and size(). operator[] permits access to
individual ELF file segment according to its index.
</entry>
</row>
</tbody>

View File

@ -0,0 +1,29 @@
<table frame='all'>
<title>Class <classname>section</classname> member functions</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'>
<colspec colname='c1'/>
<colspec colname='c2'/>
<thead>
<row>
<entry align="center">Function</entry>
<entry align="center">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<funcsynopsis>
<funcprototype>
<funcdef>Elf_Half <function>get_index</function>
</funcdef>
<void/>
</funcprototype>
</funcsynopsis>
</entry>
<entry>
Returns section index within ELF file.
</entry>
</row>
</tbody>
</tgroup>
</table>

View File

@ -48,7 +48,6 @@ class section
virtual Elf_Xword get_size() const = 0;
virtual Elf_Word get_name_string_offset() const = 0;
virtual void set_index( Elf_Half ) = 0;
virtual void set_name( std::string ) = 0;
virtual void set_type( Elf_Word value ) = 0;
virtual void set_flags( Elf_Xword ) = 0;
@ -67,6 +66,7 @@ class section
virtual void append_data( const std::string& data ) = 0;
protected:
virtual void set_index( Elf_Half ) = 0;
virtual void load( std::ifstream& f,
std::streampos header_offset ) const = 0;
virtual void save( std::ofstream& f,
@ -112,12 +112,6 @@ class section_impl : public section
return index;
}
//------------------------------------------------------------------------------
void
set_index( Elf_Half value )
{
index = value;
}
//------------------------------------------------------------------------------
std::string
@ -194,6 +188,13 @@ class section_impl : public section
//------------------------------------------------------------------------------
protected:
//------------------------------------------------------------------------------
void
set_index( Elf_Half value )
{
index = value;
}
//------------------------------------------------------------------------------
void
load( std::ifstream& stream,

View File

@ -45,7 +45,6 @@ class segment
virtual Elf_Xword get_file_size() const = 0;
virtual Elf_Xword get_memory_size() const = 0;
virtual void set_index( Elf_Half ) = 0;
virtual void set_type( Elf_Word ) = 0;
virtual void set_flags( Elf_Word ) = 0;
virtual void set_align( Elf_Xword ) = 0;
@ -61,6 +60,7 @@ class segment
virtual Elf_Half get_section_index_at( Elf_Half num ) const = 0;
protected:
virtual void set_index( Elf_Half ) = 0;
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;
@ -103,13 +103,6 @@ class segment_impl : public segment
return index;
}
//------------------------------------------------------------------------------
void
set_index( Elf_Half value )
{
index = value;
}
//------------------------------------------------------------------------------
const char*
get_data() const
@ -149,6 +142,13 @@ class segment_impl : public segment
//------------------------------------------------------------------------------
protected:
//------------------------------------------------------------------------------
void
set_index( Elf_Half value )
{
index = value;
}
//------------------------------------------------------------------------------
void
load( std::ifstream& stream,