You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ea...@apache.org on 2007/08/14 15:07:18 UTC

svn commit: r565733 - in /incubator/uima/uimacpp/trunk/src/cas: uima/typesystem.hpp xmiwriter.cpp

Author: eae
Date: Tue Aug 14 06:07:17 2007
New Revision: 565733

URL: http://svn.apache.org/viewvc?view=rev&rev=565733
Log:
UIMA-371 changes toward eliminating the format differences between Java and C++

Modified:
    incubator/uima/uimacpp/trunk/src/cas/uima/typesystem.hpp
    incubator/uima/uimacpp/trunk/src/cas/xmiwriter.cpp

Modified: incubator/uima/uimacpp/trunk/src/cas/uima/typesystem.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/cas/uima/typesystem.hpp?view=diff&rev=565733&r1=565732&r2=565733
==============================================================================
--- incubator/uima/uimacpp/trunk/src/cas/uima/typesystem.hpp (original)
+++ incubator/uima/uimacpp/trunk/src/cas/uima/typesystem.hpp Tue Aug 14 06:07:17 2007
@@ -254,6 +254,7 @@
     friend class uima::lowlevel::TypeSystem;
     friend class uima::XCASDeserializerHandler;
 	 friend class uima::XmiDeserializerHandler;
+	 friend class XmiWriter;
     friend class lowlevel::DefaultFSIterator;
   protected:
     virtual uima::lowlevel::TypeSystem const & getLowlevelTypeSystem() const = 0;
@@ -279,10 +280,18 @@
     }
     
 	 bool isListType(lowlevel::TyFSType tyType) const  {
-      return ( tyType == uima::internal::gs_tyIntListType )
+      return ( tyType == uima::internal::gs_tyFSListType )
+             || ( tyType == uima::internal::gs_tyEListType )
+             || ( tyType == uima::internal::gs_tyNEListType )
+			 || ( tyType == uima::internal::gs_tyIntListType )
+		     || ( tyType == uima::internal::gs_tyEIntListType )
+		     || ( tyType == uima::internal::gs_tyNEIntListType )
              || ( tyType == uima::internal::gs_tyFloatListType )
+             || ( tyType == uima::internal::gs_tyEFloatListType )
+             || ( tyType == uima::internal::gs_tyNEFloatListType )
              || ( tyType == uima::internal::gs_tyStringListType )
-             || ( tyType == uima::internal::gs_tyFSListType );
+             || ( tyType == uima::internal::gs_tyEStringListType )
+		     || ( tyType == uima::internal::gs_tyNEStringListType );
     }
 
     bool isFSType(lowlevel::TyFSType tyType) const  {

Modified: incubator/uima/uimacpp/trunk/src/cas/xmiwriter.cpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/cas/xmiwriter.cpp?view=diff&rev=565733&r1=565732&r2=565733
==============================================================================
--- incubator/uima/uimacpp/trunk/src/cas/xmiwriter.cpp (original)
+++ incubator/uima/uimacpp/trunk/src/cas/xmiwriter.cpp Tue Aug 14 06:07:17 2007
@@ -690,8 +690,14 @@
           break;                               
         }
         case internal::gs_tyIntListType:
+        case internal::gs_tyEIntListType:
+        case internal::gs_tyNEIntListType:
         case internal::gs_tyFloatListType:
-        case internal::gs_tyFSListType:  {
+        case internal::gs_tyEFloatListType:
+        case internal::gs_tyNEFloatListType:
+        case internal::gs_tyFSListType:
+        case internal::gs_tyEListType:
+        case internal::gs_tyNEListType:  {
           //cout << "list type " << f.getName() << endl;
           if (f.isMultipleReferencesAllowed()) {
             writeFeatureValue(os, fs, f);
@@ -703,7 +709,9 @@
             }
           }	
           break;                                     }
-        case internal::gs_tyStringListType: {
+        case internal::gs_tyStringListType:
+        case internal::gs_tyEStringListType:
+        case internal::gs_tyNEStringListType: {
           FeatureStructure listFS = fs.getFSValue(f);
           if (listFS.isValid()) {
             if (f.isMultipleReferencesAllowed() ) {
@@ -775,10 +783,7 @@
     Type t = fs.getType();
 	//cout << "findReferencedFSs() " << t.getName() << endl;
 	int tcode = internal::FSPromoter::demoteType(t);
-	if (tcode == internal::gs_tyFSListType ||
-		tcode == internal::gs_tyIntListType ||
-		tcode == internal::gs_tyFloatListType ||
-		tcode == internal::gs_tyStringListType) {
+	if ( fs.getCAS().getTypeSystem().isListType(tcode) ) {
 			insideListNode=true;
 	}
     assert( t.isValid() );
@@ -790,7 +795,9 @@
           findReferencedFSs(array.get(i));
         }
       }
-	} else if (tcode == internal::gs_tyFSListType) {
+	} else if (tcode == internal::gs_tyFSListType
+			   || tcode == internal::gs_tyEListType
+			   || tcode == internal::gs_tyNEListType ) {
 		ListFS listfs(fs);
 		//cout << __LINE__ << " Enqueue FSList elements " << listfs.getLength() << endl;
         //we need to enqueue any FSs reachable from an FSList