#include <attribute_info.hpp>
Inheritance diagram for ClassEncoder::attribute_info:
Public Member Functions | |
attribute_info () | |
Default constructor. | |
virtual | ~attribute_info () |
Default destructor. | |
virtual void | write (std::ofstream &stream) |
Write contents to stream. | |
virtual unsigned int | size ()=0 |
Size of this attribute. | |
Protected Member Functions | |
void | setNameIndex (u2 index) |
Set the index to the name in the constant pool. | |
Private Attributes | |
u2 | attribute_name_index |
This class is the base class for all JVM class attributes. The JVM attributes are documented here http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#43817. All attributes must inherit from this class and they must all implement both the size and the write function.
Definition at line 30 of file attribute_info.hpp.
|
Default constructor. Empty Definition at line 20 of file attribute_info.cpp. |
|
Default destructor. Empty Definition at line 28 of file attribute_info.cpp. |
|
Set the index to the name in the constant pool. Set the name of this class.
Definition at line 50 of file attribute_info.hpp. Referenced by ClassEncoder::code_attribute::code_attribute(). |
|
Size of this attribute. All subclasses must implement this function.
Implemented in ClassEncoder::code_attribute. Referenced by write(). |
|
Write contents to stream. Writes the index and the size of this attribute to the stream. Subclasses reimplementing this must take care to call this function before writing their contents to the stream in order to write the whole attribute to the stream correctly. Reimplemented in ClassEncoder::code_attribute. Definition at line 37 of file attribute_info.cpp. References size(), ClassEncoder::ClassWriterBase::writeu2(), and ClassEncoder::ClassWriterBase::writeu4(). |