Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

ClassEncoder::Class Class Reference

This class represents one class file. More...

#include <class.hpp>

Inheritance diagram for ClassEncoder::Class:

Inheritance graph
[legend]
Collaboration diagram for ClassEncoder::Class:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Class (const std::string &className="output")
 Default constructor.

 ~Class ()
 Default destructor.

const std::string & getClassName () const
void write ()
 Write classfile to disk.

method_infoaddMethod (const std::string &name)
 Add a new method to this class.


Private Attributes

ConstantPool ConstantPoolEntries
std::vector< method_info * > Methods
std::string ClassName

Detailed Description

This class represents one class file.

This class represents one class file and thus one java class object. For all classes at least the special function must be declared.

Definition at line 28 of file class.hpp.


Constructor & Destructor Documentation

ClassEncoder::Class::Class const std::string &  className = "output"  ) 
 

Default constructor.

Parameters:
className Name of the class. Output file is named this with .class added.

Definition at line 24 of file class.cpp.

ClassEncoder::Class::~Class  ) 
 

Default destructor.

Empty

Definition at line 33 of file class.cpp.


Member Function Documentation

method_info * ClassEncoder::Class::addMethod const std::string &  name  ) 
 

Add a new method to this class.

Adds a new method_info object containing a method to this class.

Parameters:
name the name of the method. Note that the constructor always has the specialname
Returns:
A pointer to the method_info object. The method_info object will be deleted when this object is deleted or goes out of scope.

Definition at line 109 of file class.cpp.

void ClassEncoder::Class::write  ) 
 

Write classfile to disk.

Writes this classfile to disk going through all the constant pool and attribute entries.

Parameters:
file the filename to use when writing.

Definition at line 42 of file class.cpp.

References ClassEncoder::ConstantPool::add(), ClassEncoder::ConstantPool::count(), ClassEncoder::ConstantPool::write(), ClassEncoder::ClassWriterBase::writeu2(), and ClassEncoder::ClassWriterBase::writeu4().


The documentation for this class was generated from the following files:
Generated on Mon Dec 1 14:26:29 2003 for Ck by doxygen 1.3.3