From 46e2e9651333e59dcd117289b457186d72e5dfad Mon Sep 17 00:00:00 2001 From: cascade Date: Fri, 9 Sep 2005 21:47:22 +0000 Subject: [PATCH] OCC9462 Changing approach at Reference Documentation production cdl,hxx,cxx,tcl,edl Modifications in WOK that allow to extract documentation blocks --- src/MS/MS_Class.cdl | 13 ++++++++++--- src/MS/MS_Class.cxx | 17 +++++++++++++++-- src/MS/MS_Enum.cdl | 6 ++++++ src/MS/MS_Enum.cxx | 12 +++++++++++- src/MS/MS_GenClass.cdl | 3 +++ src/MS/MS_GenClass.cxx | 6 ++++++ src/MS/MS_InstClass.cdl | 4 +++- src/MS/MS_InstClass.cxx | 5 +++-- src/MS/MS_Method.cdl | 5 +++++ src/MS/MS_Method.cxx | 15 ++++++++++++++- src/MS/MS_Package.cdl | 7 ++++++- src/MS/MS_Package.cxx | 17 +++++++++++++++++ src/MS/MS_Schema.cdl | 7 ++++++- src/MS/MS_Schema.cxx | 12 ++++++++++++ src/MS/MS_StdClass.cdl | 13 ++++++++++--- src/MS/MS_StdClass.cxx | 15 +++++++++++++-- 16 files changed, 140 insertions(+), 17 deletions(-) diff --git a/src/MS/MS_Class.cdl b/src/MS/MS_Class.cdl index 53bfca0..3f52eda 100755 --- a/src/MS/MS_Class.cdl +++ b/src/MS/MS_Class.cdl @@ -115,7 +115,13 @@ is IsStorable(me : mutable) returns Boolean from Standard; - + + Comment(me) + returns HAsciiString from TCollection; + + SetComment(me : mutable; aComment : HAsciiString from TCollection); + + fields myIncomplete : Boolean from Standard; @@ -129,8 +135,9 @@ fields myFriendMets : HSequenceOfHAsciiString from TColStd; myFriends : HSequenceOfHAsciiString from TColStd; myMother : HAsciiString from TCollection; - myNestingClass : HAsciiString from TCollection; - + myNestingClass : HAsciiString from TCollection; + myComment : HAsciiString from TCollection; -- Comment to class declaration + end Class from MS; diff --git a/src/MS/MS_Class.cxx b/src/MS/MS_Class.cxx index 5fc6b16..e98f4ea 100755 --- a/src/MS/MS_Class.cxx +++ b/src/MS/MS_Class.cxx @@ -21,6 +21,7 @@ MS_Class::MS_Class(const Handle(TCollection_HAsciiString)& aName, myFields = new MS_HSequenceOfField; myFriendMets = new TColStd_HSequenceOfHAsciiString; myFriends = new TColStd_HSequenceOfHAsciiString; + myComment = new TCollection_HAsciiString(""); myIncomplete = Standard_True; myPrivate = Standard_False; myDeferred = Standard_False; @@ -55,7 +56,8 @@ MS_Class::MS_Class(const Handle(TCollection_HAsciiString)& aName, myFields = new MS_HSequenceOfField; myFriendMets = new TColStd_HSequenceOfHAsciiString; myFriends = new TColStd_HSequenceOfHAsciiString; - + myComment = new TCollection_HAsciiString(""); + FullName(aFullName); } else { @@ -83,7 +85,6 @@ Standard_Boolean MS_Class::Private() const return myPrivate; } -//void MS_Class::Check(const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aPackage) const void MS_Class::Check(const Handle(TCollection_HAsciiString)& , const Handle(TCollection_HAsciiString)& ) const { } @@ -408,4 +409,16 @@ Standard_Boolean MS_Class::IsStorable() else return Standard_False; } +Handle(TCollection_HAsciiString) MS_Class::Comment() const +{ +// const Handle(TCollection_HAsciiString)& startComment = new TCollection_HAsciiString("///"); + +// if (myComment->IsSameString(startComment)) myComment->Clear(); + return myComment; +} + +void MS_Class::SetComment(const Handle(TCollection_HAsciiString)& aComment) +{ + myComment->AssignCat(aComment); +} diff --git a/src/MS/MS_Enum.cdl b/src/MS/MS_Enum.cdl index 2040696..6d99cd2 100755 --- a/src/MS/MS_Enum.cdl +++ b/src/MS/MS_Enum.cdl @@ -28,9 +28,15 @@ is Check(me); + Comment(me) + returns HAsciiString from TCollection; + + SetComment(me : mutable; aComment : HAsciiString from TCollection); + fields myEnums : HSequenceOfHAsciiString from TColStd; + myEnumComment : HAsciiString from TCollection; -- Comment to enumeration declaration end Enum from MS; diff --git a/src/MS/MS_Enum.cxx b/src/MS/MS_Enum.cxx index 37def79..e096af1 100755 --- a/src/MS/MS_Enum.cxx +++ b/src/MS/MS_Enum.cxx @@ -8,7 +8,8 @@ MS_Enum::MS_Enum(const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aContainer, const Standard_Boolean aPrivate) : MS_NatType(aName,aPackage,aContainer,aPrivate) { - myEnums = new TColStd_HSequenceOfHAsciiString; + myEnums = new TColStd_HSequenceOfHAsciiString; + myEnumComment = new TCollection_HAsciiString(""); } void MS_Enum::Enum(const Handle(TCollection_HAsciiString)& anEnum) @@ -43,3 +44,12 @@ void MS_Enum::Check() const } } +Handle(TCollection_HAsciiString) MS_Enum::Comment() const +{ + return myEnumComment; +} + +void MS_Enum::SetComment(const Handle(TCollection_HAsciiString)& aComment) +{ + myEnumComment->AssignCat(aComment); +} diff --git a/src/MS/MS_GenClass.cdl b/src/MS/MS_GenClass.cdl index f43e8a9..35a48ba 100755 --- a/src/MS/MS_GenClass.cdl +++ b/src/MS/MS_GenClass.cdl @@ -53,6 +53,7 @@ is GenType(me: mutable; aItem: GenType from MS); GenTypes(me) returns mutable HSequenceOfGenType from MS; + fields @@ -60,6 +61,8 @@ fields myNestStd : HSequenceOfHAsciiString from TColStd; myNestIns : HSequenceOfHAsciiString from TColStd; myNested : HSequenceOfHAsciiString from TColStd; + myComment : HAsciiString from TCollection; -- Comment to class declaration + end GenClass from MS; diff --git a/src/MS/MS_GenClass.cxx b/src/MS/MS_GenClass.cxx index 02ca37f..9822a58 100755 --- a/src/MS/MS_GenClass.cxx +++ b/src/MS/MS_GenClass.cxx @@ -11,6 +11,7 @@ MS_GenClass::MS_GenClass(const Handle(TCollection_HAsciiString)& aName, const Ha myNestStd = new TColStd_HSequenceOfHAsciiString; myNestIns = new TColStd_HSequenceOfHAsciiString; myNested = new TColStd_HSequenceOfHAsciiString; + myComment = new TCollection_HAsciiString(""); } MS_GenClass::MS_GenClass(const Handle(TCollection_HAsciiString)& aName, @@ -23,6 +24,8 @@ MS_GenClass::MS_GenClass(const Handle(TCollection_HAsciiString)& aName, myNestStd = new TColStd_HSequenceOfHAsciiString; myNestIns = new TColStd_HSequenceOfHAsciiString; myNested = new TColStd_HSequenceOfHAsciiString; + myComment = new TCollection_HAsciiString(""); + Private(aPrivate); Deferred(aDeferred); Incomplete(aInComplete); @@ -213,3 +216,6 @@ void MS_GenClass::CheckNested() const } + + + diff --git a/src/MS/MS_InstClass.cdl b/src/MS/MS_InstClass.cdl index 796167c..60291d5 100755 --- a/src/MS/MS_InstClass.cdl +++ b/src/MS/MS_InstClass.cdl @@ -96,7 +96,8 @@ is ---Purpose: test or set the flag when the instantiation has been done Initialize(me : mutable); - ---Purpose: Prepare a instclass for a second instantiates pass + ---Purpose: Prepare a instclass for a second instantiates pass + fields @@ -107,6 +108,7 @@ fields myNestStd : HSequenceOfHAsciiString from TColStd; myNestIns : HSequenceOfHAsciiString from TColStd; myNestNeu : HSequenceOfHAsciiString from TColStd; + myComment : HAsciiString from TCollection; -- Comment to class declaration myInstFlag : Boolean from Standard; end InstClass from MS; diff --git a/src/MS/MS_InstClass.cxx b/src/MS/MS_InstClass.cxx index e6e5a98..d3a805f 100755 --- a/src/MS/MS_InstClass.cxx +++ b/src/MS/MS_InstClass.cxx @@ -14,6 +14,7 @@ MS_InstClass::MS_InstClass(const Handle(TCollection_HAsciiString)& aName, myGenType(new TColStd_HSequenceOfHAsciiString),myNestStd(new TColStd_HSequenceOfHAsciiString), myNestIns(new TColStd_HSequenceOfHAsciiString),myNestNeu(new TColStd_HSequenceOfHAsciiString),myInstFlag(Standard_False) { + myComment = new TCollection_HAsciiString(""); } MS_InstClass::MS_InstClass(const Handle(TCollection_HAsciiString)& aName, @@ -26,10 +27,9 @@ MS_InstClass::MS_InstClass(const Handle(TCollection_HAsciiString)& aName, myGenType(new TColStd_HSequenceOfHAsciiString),myNestStd(new TColStd_HSequenceOfHAsciiString), myNestIns(new TColStd_HSequenceOfHAsciiString),myNestNeu(new TColStd_HSequenceOfHAsciiString),myInstFlag(Standard_False) { + myComment = new TCollection_HAsciiString(""); } -//void MS_InstClass::Validity(const Handle(TCollection_HAsciiString)& aName, -// const Handle(TCollection_HAsciiString)& aPackage) const void MS_InstClass::Validity(const Handle(TCollection_HAsciiString)& , const Handle(TCollection_HAsciiString)& ) const { @@ -434,3 +434,4 @@ void MS_InstClass::Initialize() myInstType->Append(myBasicInsType->Value(i)); } } + diff --git a/src/MS/MS_Method.cdl b/src/MS/MS_Method.cdl index 61cd0d4..2d01f44 100755 --- a/src/MS/MS_Method.cdl +++ b/src/MS/MS_Method.cdl @@ -55,6 +55,10 @@ is returns HAsciiString from TCollection; SetAliasType(me : mutable; aType : Boolean from Standard); + + Comment(me) + returns HAsciiString from TCollection; + SetComment(me : mutable; aComment : HAsciiString from TCollection); IsOperator(me) returns Boolean from Standard; @@ -83,6 +87,7 @@ fields myReturns : Param from MS; -- return parameter myRaises : HSequenceOfHAsciiString from TColStd; -- list of exceptions it raises myAlias : HAsciiString from TCollection; -- alias method of me + myComment : HAsciiString from TCollection; -- Comment to method end Method from MS; diff --git a/src/MS/MS_Method.cxx b/src/MS/MS_Method.cxx index f3e2b0d..633e359 100755 --- a/src/MS/MS_Method.cxx +++ b/src/MS/MS_Method.cxx @@ -9,8 +9,9 @@ #define MET_INLINE 0x10 #define MET_OPERATOR 0x20 #define MET_FUNCCALL 0x40 +#define MET_COMMENT 0x05 -MS_Method::MS_Method(const Handle(TCollection_HAsciiString)& aName) : MS_Common(aName),myAttribute(0),myRaises(new TColStd_HSequenceOfHAsciiString) +MS_Method::MS_Method(const Handle(TCollection_HAsciiString)& aName) : MS_Common(aName),myAttribute(0),myRaises(new TColStd_HSequenceOfHAsciiString),myComment(new TCollection_HAsciiString("")) { } @@ -325,6 +326,18 @@ void MS_Method::SetAliasType(const Standard_Boolean aType) } } +Handle(TCollection_HAsciiString) MS_Method::Comment() const +{ + //const Handle(TCollection_HAsciiString)& startComment = new TCollection_HAsciiString("///"); + //if (myComment->IsSameString(startComment)) myComment->Clear(); + return myComment; +} + +void MS_Method::SetComment(const Handle(TCollection_HAsciiString)& aComment) +{ + myComment->AssignCat(aComment); +} + Standard_Boolean MS_Method::IsOperator() const { if (myAttribute & MET_OPERATOR) { diff --git a/src/MS/MS_Package.cdl b/src/MS/MS_Package.cdl index 7736fa1..a4c7bdf 100755 --- a/src/MS/MS_Package.cdl +++ b/src/MS/MS_Package.cdl @@ -77,6 +77,10 @@ is Method(me: mutable; aMethod: ExternMet from MS); Methods(me) returns mutable HSequenceOfExternMet from MS; + Comment(me) + returns HAsciiString from TCollection; + SetComment(me : mutable; aComment : HAsciiString from TCollection); + fields @@ -89,7 +93,8 @@ fields myImports : HSequenceOfHAsciiString from TColStd; myPrims : HSequenceOfHAsciiString from TColStd; - myMethods : HSequenceOfExternMet from MS; + myMethods : HSequenceOfExternMet from MS; + myPackComment : HAsciiString from TCollection; -- Comment to Package declaration end Package from MS; diff --git a/src/MS/MS_Package.cxx b/src/MS/MS_Package.cxx index 8dc622e..91c9f37 100755 --- a/src/MS/MS_Package.cxx +++ b/src/MS/MS_Package.cxx @@ -13,6 +13,8 @@ MS_Package::MS_Package(const Handle(TCollection_HAsciiString)& aPackage) : MS_Gl myImports = new TColStd_HSequenceOfHAsciiString; myPrims = new TColStd_HSequenceOfHAsciiString; + myPackComment = new TCollection_HAsciiString(""); + myMethods = new MS_HSequenceOfExternMet; myUses->Append(Name()); @@ -287,4 +289,19 @@ Handle(MS_HSequenceOfExternMet) MS_Package::Methods() const return myMethods; } +Handle(TCollection_HAsciiString) MS_Package::Comment() const +{ + //Handle(TCollection_HAsciiString) aRetComment = myComment; + //myComment->Clear(); + //return aRetComment; + //const Handle(TCollection_HAsciiString)& startComment = new TCollection_HAsciiString("///"); + //if (myPackComment->IsSameString(startComment)) myPackComment->Clear(); + return myPackComment; +} + +void MS_Package::SetComment(const Handle(TCollection_HAsciiString)& aComment) +{ + myPackComment -> AssignCat(aComment); +} + diff --git a/src/MS/MS_Schema.cdl b/src/MS/MS_Schema.cdl index 89e9a4d..5f0d31d 100755 --- a/src/MS/MS_Schema.cdl +++ b/src/MS/MS_Schema.cdl @@ -23,11 +23,16 @@ is Class(me : mutable; aClass : HAsciiString from TCollection); GetClasses(me) returns HSequenceOfHAsciiString from TColStd; + + Comment(me) returns HAsciiString from TCollection; + SetComment(me : mutable; aComment : HAsciiString from TCollection); + fields myPackages : HSequenceOfHAsciiString from TColStd; myClasses : HSequenceOfHAsciiString from TColStd; - + mySchemaComment : HAsciiString from TCollection; -- Comment to Schema declaration + end Schema from MS; diff --git a/src/MS/MS_Schema.cxx b/src/MS/MS_Schema.cxx index b9a1927..79a2f7e 100755 --- a/src/MS/MS_Schema.cxx +++ b/src/MS/MS_Schema.cxx @@ -5,6 +5,7 @@ MS_Schema::MS_Schema(const Handle(TCollection_HAsciiString)& aSchema) : MS_Globa { myPackages = new TColStd_HSequenceOfHAsciiString; myClasses = new TColStd_HSequenceOfHAsciiString; + mySchemaComment = new TCollection_HAsciiString(""); } void MS_Schema::Package(const Handle(TCollection_HAsciiString)& aPackage) @@ -26,5 +27,16 @@ Handle(TColStd_HSequenceOfHAsciiString) MS_Schema::GetClasses() const { return myClasses; } +Handle(TCollection_HAsciiString) MS_Schema::Comment() const +{ +// const Handle(TCollection_HAsciiString)& startComment = new TCollection_HAsciiString("///"); +// if (mySchemaComment->IsSameString(startComment)) mySchemaComment->Clear(); + return mySchemaComment; +} + +void MS_Schema::SetComment(const Handle(TCollection_HAsciiString)& aComment) +{ + mySchemaComment->AssignCat(aComment); +} diff --git a/src/MS/MS_StdClass.cdl b/src/MS/MS_StdClass.cdl index 797735d..99ea02b 100755 --- a/src/MS/MS_StdClass.cdl +++ b/src/MS/MS_StdClass.cdl @@ -35,10 +35,17 @@ is returns Boolean from Standard; ---Purpose: if has not been instantiated return True -- Because may be defined in a generic class. - + + --Comment(me) + -- returns HAsciiString from TCollection; + + --SetComment(me : mutable; aComment : HAsciiString from TCollection); + + fields - myInstClass : InstClass from MS; - myNestingState : Boolean from Standard; -- True if is a generic stdclass (not created by insttostd - see InstClass) + myInstClass : InstClass from MS; + myNestingState : Boolean from Standard; -- True if is a generic stdclass (not created by insttostd - see InstClass) + myComment : HAsciiString from TCollection; -- Comment to class declaration end StdClass from MS; diff --git a/src/MS/MS_StdClass.cxx b/src/MS/MS_StdClass.cxx index c691d5d..f0cc080 100755 --- a/src/MS/MS_StdClass.cxx +++ b/src/MS/MS_StdClass.cxx @@ -7,6 +7,7 @@ MS_StdClass::MS_StdClass(const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aPackage) : MS_Class(aName,aPackage), myNestingState(Standard_False) { + myComment = new TCollection_HAsciiString(""); } MS_StdClass::MS_StdClass(const Handle(TCollection_HAsciiString)& aName, @@ -17,10 +18,9 @@ MS_StdClass::MS_StdClass(const Handle(TCollection_HAsciiString)& aName, const Standard_Boolean aInComplete) : MS_Class(aName,aPackage,Mother,aPrivate,aDeferred,aInComplete), myNestingState(Standard_False) { + myComment = new TCollection_HAsciiString(""); } -//void MS_StdClass::Validity(const Handle(TCollection_HAsciiString)& aName, -// const Handle(TCollection_HAsciiString)& aPackage) const void MS_StdClass::Validity(const Handle(TCollection_HAsciiString)& , const Handle(TCollection_HAsciiString)& ) const { @@ -45,3 +45,14 @@ Standard_Boolean MS_StdClass::IsGeneric() const { return myNestingState; } + +//Handle(TCollection_HAsciiString) MS_StdClass::Comment() const +//{ +// return myComment; +//} + +//void MS_StdClass::SetComment(const Handle(TCollection_HAsciiString)& aComment) +//{ +// myComment->AssignCat(aComment); +//} + -- 2.39.5