internal short AddClass(string className)
{
int theIndex = itsClassHash.Get(className, -1);
if (theIndex == -1)
{
string slashed = className;
if (className.IndexOf('.') > 0)
{
slashed = ClassFileWriter.GetSlashedForm(className);
theIndex = itsClassHash.Get(slashed, -1);
if (theIndex != -1)
{
itsClassHash.Put(className, theIndex);
}
}
if (theIndex == -1)
{
int utf8Index = AddUtf8(slashed);
Ensure(3);
itsPool[itsTop++] = CONSTANT_Class;
itsTop = ClassFileWriter.PutInt16(utf8Index, itsPool, itsTop);
theIndex = itsTopIndex++;
itsClassHash.Put(slashed, theIndex);
if (className != slashed)
{
itsClassHash.Put(className, theIndex);
}
}
}
SetConstantData(theIndex, className);
itsPoolTypes.Put(theIndex, CONSTANT_Class);
return (short)theIndex;
}