[GME-commit] GMESRC/GME/Mga MgaFCO.cpp,1.29,1.30 MgaFCO.h,1.17,1.18 MgaFolder.cpp,1.21,1.22 MgaProject.cpp,1.49,1.50

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Jun 30 13:50:49 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Mga
In directory braindrain:/tmp/cvs-serv23427/Mga

Modified Files:
	MgaFCO.cpp MgaFCO.h MgaFolder.cpp MgaProject.cpp 
Log Message:
Dumper/Parser changed for closure logic:
	-not to dump relids, childrelidscntrs in case of closure dump
	-libreferred and libderivedfrom (soft) attributes added, if the objects are found upon parsing the reference or instantiation is reproduced
Mga:
	-AbsPath property added for MgaObject: gives back the absolute path to an object
	-get_ObjectByPath search implemented for search based on kindnames


CVS User: zolmol

Index: MgaFCO.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaFCO.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** MgaFCO.cpp	29 Mar 2004 17:51:06 -0000	1.29
--- MgaFCO.cpp	30 Jun 2004 17:50:47 -0000	1.30
***************
*** 418,421 ****
--- 418,448 ----
  
  
+ // gives back the path to an object starting from the rootfolder (does not include project name)
+ HRESULT FCO::get_AbsPath(BSTR *pVal)		{ 
+ 	COMTRY {
+ 		CComBSTR path("/@");
+ 		path.Append( self[ATTRID_NAME]);
+ 
+ 		CoreObj par = self[ATTRID_PARENT];
+ 		while( par.GetMetaID() != DTID_ROOT)
+ 		{
+ 			CComBSTR tp("/@");
+ 			tp.Append( par[ATTRID_NAME]);
+ 
+ 			par = par[ATTRID_PARENT];
+ 
+ 			if( par.GetMetaID() != DTID_ROOT) // do not include project name
+ 			{
+ 				tp.AppendBSTR( path);
+ 				path = tp;
+ 			}
+ 			
+ 		}
+ 		CheckDeletedRead();
+ 		CHECK_OUTPAR(pVal);  
+ 		*pVal = path.Detach();
+ 	} COMCATCH(;);
+ };
+ 
  // ----------------------------------------
  // Add FCO to a collection (create new coll if null)

Index: MgaFCO.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaFCO.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** MgaFCO.h	2 Jun 2004 21:43:19 -0000	1.17
--- MgaFCO.h	30 Jun 2004 17:50:47 -0000	1.18
***************
*** 96,99 ****
--- 96,101 ----
   STDMETHOD(get_Name)( BSTR *pVal)					{ return inFCO->get_Name(pVal); }
   STDMETHOD(put_Name)( BSTR newVal)					{ return inFCO->put_Name(newVal); }
+  //by ZolMol
+  STDMETHOD(get_AbsPath)( BSTR *pVal)				{ return inFCO->get_AbsPath(pVal); }
   STDMETHOD(get_Meta)( IMgaMetaFCO **pVal)			{ return inFCO->get_Meta(pVal); }
   //by ZolMol
***************
*** 320,323 ****
--- 322,326 ----
  		void initialname();  // add inital name to object
  	HRESULT put_Name(BSTR newVal);
+ 	HRESULT get_AbsPath(BSTR *pVal);
  	HRESULT get_Status(long *p);
  	HRESULT get_IsWritable(VARIANT_BOOL *p);

Index: MgaFolder.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaFolder.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** MgaFolder.cpp	3 Jun 2004 16:17:04 -0000	1.21
--- MgaFolder.cpp	30 Jun 2004 17:50:47 -0000	1.22
***************
*** 427,430 ****
--- 427,436 ----
  }
  
+ //The FCO::get_ObjectByPath ignores all the time the leading '/'
+ // search based on name: "/@MyFolder/@MySubFolder"
+ // search based on id: "/id0065-00001/id0065-00014"
+ //         or          "/#id0065-00001/#id0065-00014"
+ //
+ // the project name must not be included into the path
  HRESULT FCO::get_ObjectByPath(BSTR path, IMgaObject ** pVal) {
  	COMTRY {
***************
*** 437,443 ****
  		if(*p == '@') {
  			p++;
! 			COMTHROW(E_MGA_NOT_IMPLEMENTED);
! //			wcsacnf
! //			COMTHROW(get_ChildObjectByName(p, pp));
  		}
  		else {
--- 443,474 ----
  		if(*p == '@') {
  			p++;
! 
! 			CComBSTR name_b;
! 			OLECHAR * p2 = p;
! 			while ( *p2 != '/' && *p2 != '#' && *p2 != '@' && *p2 != 0)
! 			{
! 				name_b.Append( p2, 1);
! 				++p2;
! 			}
! 
! 			bool found = false;
! 			CoreObjs children = self[ATTRID_FCOPARENT+ATTRID_COLLECTION];
! 			ITERATE_THROUGH(children) {
! 				CComBSTR n = ITER[ATTRID_NAME];
! 				if(n == name_b && !found)
! 				{
! 					if ( *p2 != 0)
! 					{
! 						ObjForCore(ITER)->get_ObjectByPath( p2, pVal);
! 					}
! 					else
! 					{
! 						ObjForCore(ITER)->getinterface( pVal);
! 					}
! 
! 					if ( *pVal)
! 						found = true;
! 				}
! 			}
  		}
  		else {

Index: MgaProject.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaProject.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** MgaProject.cpp	2 Jun 2004 21:43:19 -0000	1.49
--- MgaProject.cpp	30 Jun 2004 17:50:47 -0000	1.50
***************
*** 624,627 ****
--- 624,628 ----
  }
  
+ // see FCO::get_ObjectByPath for details in MgaFolder.cpp 
  STDMETHODIMP CMgaProject::get_ObjectByPath(BSTR path, IMgaObject **pVal) {
  	COMTRY {



More information about the GME-commit mailing list