LibreOffice Module codemaker (master) 1
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
codemaker::javamaker::ClassFile Class Reference

#include <classfile.hxx>

Classes

class  Code
 

Public Types

enum  AccessFlags {
  ACC_PUBLIC = 0x0001 ,
  ACC_PRIVATE = 0x0002 ,
  ACC_STATIC = 0x0008 ,
  ACC_FINAL = 0x0010 ,
  ACC_SUPER = 0x0020 ,
  ACC_VARARGS = 0x0080 ,
  ACC_INTERFACE = 0x0200 ,
  ACC_ABSTRACT = 0x0400 ,
  ACC_SYNTHETIC = 0x1000
}
 

Public Member Functions

 ClassFile (AccessFlags accessFlags, rtl::OString const &thisClass, rtl::OString const &superClass, rtl::OString const &signature)
 
 ~ClassFile ()
 
std::unique_ptr< CodenewCode ()
 
sal_uInt16 addIntegerInfo (sal_Int32 value)
 
sal_uInt16 addFloatInfo (float value)
 
sal_uInt16 addLongInfo (sal_Int64 value)
 
sal_uInt16 addDoubleInfo (double value)
 
void addInterface (rtl::OString const &interface)
 
void addField (AccessFlags accessFlags, rtl::OString const &name, rtl::OString const &descriptor, sal_uInt16 constantValueIndex, rtl::OString const &signature)
 
void addMethod (AccessFlags accessFlags, rtl::OString const &name, rtl::OString const &descriptor, Code const *code, std::vector< rtl::OString > const &exceptions, rtl::OString const &signature)
 
void write (FileStream &file) const
 

Private Types

typedef std::map< rtl::OString, sal_uInt16 > Map
 

Private Member Functions

 ClassFile (ClassFile const &)=delete
 
ClassFileoperator= (const ClassFile &)=delete
 
sal_uInt16 nextConstantPoolIndex (sal_uInt16 width)
 
sal_uInt16 addUtf8Info (rtl::OString const &value)
 
sal_uInt16 addClassInfo (rtl::OString const &type)
 
sal_uInt16 addStringInfo (rtl::OString const &value)
 
sal_uInt16 addFieldrefInfo (rtl::OString const &type, rtl::OString const &name, rtl::OString const &descriptor)
 
sal_uInt16 addMethodrefInfo (rtl::OString const &type, rtl::OString const &name, rtl::OString const &descriptor)
 
sal_uInt16 addInterfaceMethodrefInfo (rtl::OString const &type, rtl::OString const &name, rtl::OString const &descriptor)
 
sal_uInt16 addNameAndTypeInfo (rtl::OString const &name, rtl::OString const &descriptor)
 
void appendSignatureAttribute (std::vector< unsigned char > &stream, rtl::OString const &signature)
 

Private Attributes

sal_uInt16 m_constantPoolCount
 
std::vector< unsigned char > m_constantPool
 
std::map< rtl::OString, sal_uInt16 > m_utf8Infos
 
std::map< sal_Int32, sal_uInt16 > m_integerInfos
 
std::map< sal_Int64, sal_uInt16 > m_longInfos
 
std::map< float, sal_uInt16 > m_floatInfos
 
std::map< double, sal_uInt16 > m_doubleInfos
 
std::map< sal_uInt16, sal_uInt16 > m_classInfos
 
std::map< sal_uInt16, sal_uInt16 > m_stringInfos
 
std::map< sal_uInt32, sal_uInt16 > m_fieldrefInfos
 
std::map< sal_uInt32, sal_uInt16 > m_methodrefInfos
 
std::map< sal_uInt32, sal_uInt16 > m_interfaceMethodrefInfos
 
std::map< sal_uInt32, sal_uInt16 > m_nameAndTypeInfos
 
AccessFlags m_accessFlags
 
sal_uInt16 m_thisClass
 
sal_uInt16 m_superClass
 
sal_uInt16 m_interfacesCount
 
std::vector< unsigned char > m_interfaces
 
sal_uInt16 m_fieldsCount
 
std::vector< unsigned char > m_fields
 
sal_uInt16 m_methodsCount
 
std::vector< unsigned char > m_methods
 
sal_uInt16 m_attributesCount
 
std::vector< unsigned char > m_attributes
 

Friends

class Code
 

Detailed Description

Definition at line 34 of file classfile.hxx.

Member Typedef Documentation

◆ Map

typedef std::map< rtl::OString, sal_uInt16 > codemaker::javamaker::ClassFile::Map
private

Definition at line 181 of file classfile.hxx.

Member Enumeration Documentation

◆ AccessFlags

Enumerator
ACC_PUBLIC 
ACC_PRIVATE 
ACC_STATIC 
ACC_FINAL 
ACC_SUPER 
ACC_VARARGS 
ACC_INTERFACE 
ACC_ABSTRACT 
ACC_SYNTHETIC 

Definition at line 36 of file classfile.hxx.

Constructor & Destructor Documentation

◆ ClassFile() [1/2]

codemaker::javamaker::ClassFile::ClassFile ( AccessFlags  accessFlags,
rtl::OString const &  thisClass,
rtl::OString const &  superClass,
rtl::OString const &  signature 
)

◆ ~ClassFile()

ClassFile::~ClassFile ( )

Definition at line 480 of file classfile.cxx.

◆ ClassFile() [2/2]

codemaker::javamaker::ClassFile::ClassFile ( ClassFile const &  )
privatedelete

Member Function Documentation

◆ addClassInfo()

sal_uInt16 ClassFile::addClassInfo ( rtl::OString const &  type)
private

◆ addDoubleInfo()

sal_uInt16 ClassFile::addDoubleInfo ( double  value)

Definition at line 533 of file classfile.cxx.

References i, index, m_constantPool, m_doubleInfos, nextConstantPoolIndex(), and value.

◆ addField()

void ClassFile::addField ( AccessFlags  accessFlags,
rtl::OString const &  name,
rtl::OString const &  descriptor,
sal_uInt16  constantValueIndex,
rtl::OString const &  signature 
)

◆ addFieldrefInfo()

sal_uInt16 ClassFile::addFieldrefInfo ( rtl::OString const &  type,
rtl::OString const &  name,
rtl::OString const &  descriptor 
)
private

◆ addFloatInfo()

sal_uInt16 ClassFile::addFloatInfo ( float  value)

Definition at line 501 of file classfile.cxx.

References i, index, m_constantPool, m_floatInfos, nextConstantPoolIndex(), and value.

◆ addIntegerInfo()

sal_uInt16 ClassFile::addIntegerInfo ( sal_Int32  value)

Definition at line 486 of file classfile.cxx.

References i, index, m_constantPool, m_integerInfos, nextConstantPoolIndex(), and value.

◆ addInterface()

void ClassFile::addInterface ( rtl::OString const &  interface)

Definition at line 550 of file classfile.cxx.

References addClassInfo(), m_interfaces, m_interfacesCount, and SAL_MAX_UINT16.

◆ addInterfaceMethodrefInfo()

sal_uInt16 ClassFile::addInterfaceMethodrefInfo ( rtl::OString const &  type,
rtl::OString const &  name,
rtl::OString const &  descriptor 
)
private

◆ addLongInfo()

sal_uInt16 ClassFile::addLongInfo ( sal_Int64  value)

Definition at line 518 of file classfile.cxx.

References i, index, m_constantPool, m_longInfos, nextConstantPoolIndex(), and value.

◆ addMethod()

void ClassFile::addMethod ( AccessFlags  accessFlags,
rtl::OString const &  name,
rtl::OString const &  descriptor,
Code const *  code,
std::vector< rtl::OString > const &  exceptions,
rtl::OString const &  signature 
)

◆ addMethodrefInfo()

sal_uInt16 ClassFile::addMethodrefInfo ( rtl::OString const &  type,
rtl::OString const &  name,
rtl::OString const &  descriptor 
)
private

◆ addNameAndTypeInfo()

sal_uInt16 ClassFile::addNameAndTypeInfo ( rtl::OString const &  name,
rtl::OString const &  descriptor 
)
private

◆ addStringInfo()

sal_uInt16 ClassFile::addStringInfo ( rtl::OString const &  value)
private

Definition at line 708 of file classfile.cxx.

References addUtf8Info(), i, index, m_constantPool, m_stringInfos, nextConstantPoolIndex(), and value.

◆ addUtf8Info()

sal_uInt16 ClassFile::addUtf8Info ( rtl::OString const &  value)
private

◆ appendSignatureAttribute()

void ClassFile::appendSignatureAttribute ( std::vector< unsigned char > &  stream,
rtl::OString const &  signature 
)
private

Definition at line 818 of file classfile.cxx.

References addUtf8Info(), and stream.

Referenced by addField(), and addMethod().

◆ newCode()

std::unique_ptr< ClassFile::Code > ClassFile::newCode ( )

Definition at line 482 of file classfile.cxx.

References Code.

◆ nextConstantPoolIndex()

sal_uInt16 ClassFile::nextConstantPoolIndex ( sal_uInt16  width)
private

◆ operator=()

ClassFile & codemaker::javamaker::ClassFile::operator= ( const ClassFile )
privatedelete

◆ write()

void ClassFile::write ( FileStream file) const

Friends And Related Function Documentation

◆ Code

friend class Code
friend

Definition at line 234 of file classfile.hxx.

Referenced by newCode().

Member Data Documentation

◆ m_accessFlags

AccessFlags codemaker::javamaker::ClassFile::m_accessFlags
private

Definition at line 222 of file classfile.hxx.

Referenced by write().

◆ m_attributes

std::vector< unsigned char > codemaker::javamaker::ClassFile::m_attributes
private

Definition at line 232 of file classfile.hxx.

Referenced by write().

◆ m_attributesCount

sal_uInt16 codemaker::javamaker::ClassFile::m_attributesCount
private

Definition at line 231 of file classfile.hxx.

Referenced by write().

◆ m_classInfos

std::map< sal_uInt16, sal_uInt16 > codemaker::javamaker::ClassFile::m_classInfos
private

Definition at line 216 of file classfile.hxx.

Referenced by addClassInfo().

◆ m_constantPool

std::vector< unsigned char > codemaker::javamaker::ClassFile::m_constantPool
private

◆ m_constantPoolCount

sal_uInt16 codemaker::javamaker::ClassFile::m_constantPoolCount
private

Definition at line 209 of file classfile.hxx.

Referenced by nextConstantPoolIndex(), and write().

◆ m_doubleInfos

std::map< double, sal_uInt16 > codemaker::javamaker::ClassFile::m_doubleInfos
private

Definition at line 215 of file classfile.hxx.

Referenced by addDoubleInfo().

◆ m_fieldrefInfos

std::map< sal_uInt32, sal_uInt16 > codemaker::javamaker::ClassFile::m_fieldrefInfos
private

Definition at line 218 of file classfile.hxx.

Referenced by addFieldrefInfo().

◆ m_fields

std::vector< unsigned char > codemaker::javamaker::ClassFile::m_fields
private

Definition at line 228 of file classfile.hxx.

Referenced by addField(), and write().

◆ m_fieldsCount

sal_uInt16 codemaker::javamaker::ClassFile::m_fieldsCount
private

Definition at line 227 of file classfile.hxx.

Referenced by addField(), and write().

◆ m_floatInfos

std::map< float, sal_uInt16 > codemaker::javamaker::ClassFile::m_floatInfos
private

Definition at line 214 of file classfile.hxx.

Referenced by addFloatInfo().

◆ m_integerInfos

std::map< sal_Int32, sal_uInt16 > codemaker::javamaker::ClassFile::m_integerInfos
private

Definition at line 212 of file classfile.hxx.

Referenced by addIntegerInfo().

◆ m_interfaceMethodrefInfos

std::map< sal_uInt32, sal_uInt16 > codemaker::javamaker::ClassFile::m_interfaceMethodrefInfos
private

Definition at line 220 of file classfile.hxx.

Referenced by addInterfaceMethodrefInfo().

◆ m_interfaces

std::vector< unsigned char > codemaker::javamaker::ClassFile::m_interfaces
private

Definition at line 226 of file classfile.hxx.

Referenced by addInterface(), and write().

◆ m_interfacesCount

sal_uInt16 codemaker::javamaker::ClassFile::m_interfacesCount
private

Definition at line 225 of file classfile.hxx.

Referenced by addInterface(), and write().

◆ m_longInfos

std::map< sal_Int64, sal_uInt16 > codemaker::javamaker::ClassFile::m_longInfos
private

Definition at line 213 of file classfile.hxx.

Referenced by addLongInfo().

◆ m_methodrefInfos

std::map< sal_uInt32, sal_uInt16 > codemaker::javamaker::ClassFile::m_methodrefInfos
private

Definition at line 219 of file classfile.hxx.

Referenced by addMethodrefInfo().

◆ m_methods

std::vector< unsigned char > codemaker::javamaker::ClassFile::m_methods
private

Definition at line 230 of file classfile.hxx.

Referenced by addMethod(), and write().

◆ m_methodsCount

sal_uInt16 codemaker::javamaker::ClassFile::m_methodsCount
private

Definition at line 229 of file classfile.hxx.

Referenced by addMethod(), and write().

◆ m_nameAndTypeInfos

std::map< sal_uInt32, sal_uInt16 > codemaker::javamaker::ClassFile::m_nameAndTypeInfos
private

Definition at line 221 of file classfile.hxx.

Referenced by addNameAndTypeInfo().

◆ m_stringInfos

std::map< sal_uInt16, sal_uInt16 > codemaker::javamaker::ClassFile::m_stringInfos
private

Definition at line 217 of file classfile.hxx.

Referenced by addStringInfo().

◆ m_superClass

sal_uInt16 codemaker::javamaker::ClassFile::m_superClass
private

Definition at line 224 of file classfile.hxx.

Referenced by write().

◆ m_thisClass

sal_uInt16 codemaker::javamaker::ClassFile::m_thisClass
private

Definition at line 223 of file classfile.hxx.

Referenced by write().

◆ m_utf8Infos

std::map< rtl::OString, sal_uInt16 > codemaker::javamaker::ClassFile::m_utf8Infos
private

Definition at line 211 of file classfile.hxx.

Referenced by addUtf8Info().


The documentation for this class was generated from the following files: