move some more slot parsing to SvIdlParser
Change-Id: I186e80ed0446585aceaf4d25f32ecca7e8ed396c
This commit is contained in:
@@ -33,6 +33,7 @@ class SvClassElement
|
||||
tools::SvRef<SvMetaClass> xClass;
|
||||
public:
|
||||
SvClassElement();
|
||||
SvClassElement(SvMetaClass* pClass) { xClass = pClass; }
|
||||
|
||||
void SetPrefix( const OString& rPrefix )
|
||||
{ aPrefix = rPrefix; }
|
||||
|
@@ -50,6 +50,7 @@ public:
|
||||
void ReadStruct();
|
||||
void ReadEnum();
|
||||
void ReadEnumValue( SvMetaTypeEnum& rEnum );
|
||||
SvMetaClass* ReadKnownClass();
|
||||
SvMetaType* ReadKnownType();
|
||||
void ReadChar(char cChar);
|
||||
void ReadDelimiter();
|
||||
|
@@ -282,9 +282,7 @@ void SvIdlParser::ReadInterfaceOrShell( SvMetaModule& rModule, MetaTypeType aMet
|
||||
|
||||
if( rInStm.ReadIf( ':' ) )
|
||||
{
|
||||
aClass->aSuperClass = rBase.ReadKnownClass( rInStm );
|
||||
if( !aClass->aSuperClass.Is() )
|
||||
throw SvParseException( rInStm, "unknown super class" );
|
||||
aClass->aSuperClass = ReadKnownClass();
|
||||
}
|
||||
if( rInStm.ReadIf( '{' ) )
|
||||
{
|
||||
@@ -309,19 +307,15 @@ void SvIdlParser::ReadInterfaceOrShellEntry(SvMetaClass& rClass)
|
||||
|
||||
if( rTok.Is( SvHash_import() ) )
|
||||
{
|
||||
SvMetaClass * pClass = rBase.ReadKnownClass( rInStm );
|
||||
if( !pClass )
|
||||
throw SvParseException( rInStm, "unknown imported interface" );
|
||||
SvClassElement xEle;
|
||||
xEle.SetClass( pClass );
|
||||
rClass.aClassElementList.push_back( xEle );
|
||||
|
||||
SvMetaClass * pClass = ReadKnownClass();
|
||||
SvClassElement xEle(pClass);
|
||||
rTok = rInStm.GetToken();
|
||||
if( rTok.IsString() )
|
||||
{
|
||||
xEle.SetPrefix( rTok.GetString() );
|
||||
rInStm.GetToken_Next();
|
||||
}
|
||||
rClass.aClassElementList.push_back( xEle );
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -368,7 +362,17 @@ bool SvIdlParser::ReadInterfaceOrShellSlot(SvMetaSlot& rSlot)
|
||||
throw SvParseException( rInStm, "attribute " + pAttr->GetName() + " is method or variable but not a slot" );
|
||||
rSlot.SetRef( pKnownSlot );
|
||||
rSlot.SetName( pKnownSlot->GetName() );
|
||||
bOk = rSlot.SvMetaObject::ReadSvIdl( rBase, rInStm );
|
||||
if( rInStm.ReadIf( '[' ) )
|
||||
{
|
||||
sal_uInt32 nBeginPos = 0; // can not happen with Tell
|
||||
while( nBeginPos != rInStm.Tell() )
|
||||
{
|
||||
nBeginPos = rInStm.Tell();
|
||||
rSlot.ReadAttributesSvIdl( rBase, rInStm );
|
||||
rInStm.ReadIfDelimiter();
|
||||
}
|
||||
bOk = rInStm.ReadIf( ']' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -435,6 +439,14 @@ bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr
|
||||
return bOk;
|
||||
}
|
||||
|
||||
SvMetaClass * SvIdlParser::ReadKnownClass()
|
||||
{
|
||||
SvMetaClass* pClass = rBase.ReadKnownClass( rInStm );
|
||||
if( !pClass )
|
||||
throw SvParseException( rInStm, "unknown class" );
|
||||
return pClass;
|
||||
}
|
||||
|
||||
SvMetaType * SvIdlParser::ReadKnownType()
|
||||
{
|
||||
OString aName = ReadIdentifier();
|
||||
|
Reference in New Issue
Block a user