From: Nando D. <na...@us...> - 2005-02-18 14:27:15
|
Update of /cvsroot/instantobjects/Source/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8625/Core Modified Files: InstantCode.pas InstantPersistence.pas Log Message: External storage unification & refactoring Index: InstantCode.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantCode.pas,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** InstantCode.pas 18 Feb 2005 11:04:08 -0000 1.9 --- InstantCode.pas 18 Feb 2005 14:27:04 -0000 1.10 *************** *** 25,33 **** * * Contributor(s): ! * Carlo Barazzetta, Adrea Petrelli: porting Kylix ! * Nando Dessena, Andrea Petrelli: ! * - ExternalPart, ExternalParts and ExternalReferences support ! * Steven Mitchell: ! * - Added MetadataInfo identification tag * ***** END LICENSE BLOCK ***** *) --- 25,29 ---- * * Contributor(s): ! * Carlo Barazzetta, Adrea Petrelli, Nando Dessena, Steven Mitchell. * ***** END LICENSE BLOCK ***** *) *************** *** 624,633 **** procedure SetStorageName(const Value: string); procedure SetVisibility(Value: TInstantCodeVisibility); ! function GetExternalLinkedName: string; ! function GetExternalStoredName: string; ! function GetIsExternal: TInstantContainerIsExternal; ! procedure SetExternalLinkedName(const Value: string); ! procedure SetExternalStoredName(const Value: string); ! procedure SetIsExternal(const Value: TInstantContainerIsExternal); protected function GetIsDefault: Boolean; virtual; --- 620,627 ---- procedure SetStorageName(const Value: string); procedure SetVisibility(Value: TInstantCodeVisibility); ! function GetExternalStorageName: string; ! function GetStorageKind: TInstantStorageKind; ! procedure SetExternalStorageName(const Value: string); ! procedure SetStorageKind(const Value: TInstantStorageKind); protected function GetIsDefault: Boolean; virtual; *************** *** 675,680 **** property AttributeTypeName: string read GetAttributeTypeName write SetAttributeTypeName; property AttributeTypeText: string read GetAttributeTypeText; ! property ExternalLinkedName: string read GetExternalLinkedName write SetExternalLinkedName; ! property ExternalStoredName: string read GetExternalStoredName write SetExternalStoredName; property IncludeAddMethod: Boolean read GetIncludeAddMethod write SetIncludeAddMethod; property IncludeClearMethod: Boolean read GetIncludeClearMethod write SetIncludeClearMethod; --- 669,673 ---- property AttributeTypeName: string read GetAttributeTypeName write SetAttributeTypeName; property AttributeTypeText: string read GetAttributeTypeText; ! property ExternalStorageName: string read GetExternalStorageName write SetExternalStorageName; property IncludeAddMethod: Boolean read GetIncludeAddMethod write SetIncludeAddMethod; property IncludeClearMethod: Boolean read GetIncludeClearMethod write SetIncludeClearMethod; *************** *** 684,688 **** property IncludeRemoveMethod: Boolean read GetIncludeRemoveMethod write SetIncludeRemoveMethod; property IsDefault: Boolean read GetIsDefault write SetIsDefault; ! property IsExternal: TInstantContainerIsExternal read GetIsExternal write SetIsExternal; property IsIndexed: Boolean read GetIsIndexed write SetIsIndexed; property IsRequired: Boolean read GetIsRequired write SetIsRequired; --- 677,681 ---- property IncludeRemoveMethod: Boolean read GetIncludeRemoveMethod write SetIncludeRemoveMethod; property IsDefault: Boolean read GetIsDefault write SetIsDefault; ! property StorageKind: TInstantStorageKind read GetStorageKind write SetStorageKind; property IsIndexed: Boolean read GetIsIndexed write SetIsIndexed; property IsRequired: Boolean read GetIsRequired write SetIsRequired; *************** *** 1534,1539 **** MetadataInfoID = 'IOMETADATA'; MetaKeyDefault = 'default'; ! MetaKeyExternalStored = 'externalstored'; ! MetaKeyExternalLinked = 'externallinked'; MetaKeyFormat = 'format'; MetaKeyIndex = 'index'; --- 1527,1531 ---- MetadataInfoID = 'IOMETADATA'; MetaKeyDefault = 'default'; ! MetaKeyExternal = 'external'; MetaKeyFormat = 'format'; MetaKeyIndex = 'index'; *************** *** 1790,1802 **** if SameText(Token, MetaKeyDefault) then FMetadata.IsDefault := True; ! if SameText(Token, MetaKeyExternalStored) then ! begin ! FMetadata.IsExternal := ceStored; ! FMetadata.ExternalStoredName := ReadStringValue; ! end; ! if SameText(Token, MetaKeyExternalLinked) then begin ! FMetadata.IsExternal := ceLinked; ! FMetadata.ExternalLinkedName := ReadStringValue; end; end; --- 1782,1789 ---- if SameText(Token, MetaKeyDefault) then FMetadata.IsDefault := True; ! if SameText(Token, MetaKeyExternal) then begin ! FMetadata.StorageKind := skExternal; ! FMetadata.ExternalStorageName := ReadStringValue; end; end; *************** *** 3728,3739 **** end; ! function TInstantCodeAttribute.GetExternalLinkedName: string; ! begin ! Result := Metadata.ExternalLinkedName; ! end; ! ! function TInstantCodeAttribute.GetExternalStoredName: string; begin ! Result := Metadata.ExternalStoredName; end; --- 3715,3721 ---- end; ! function TInstantCodeAttribute.GetExternalStorageName: string; begin ! Result := Metadata.ExternalStorageName; end; *************** *** 3798,3804 **** end; ! function TInstantCodeAttribute.GetIsExternal: TInstantContainerIsExternal; begin ! Result := Metadata.IsExternal; end; --- 3780,3786 ---- end; ! function TInstantCodeAttribute.GetStorageKind: TInstantStorageKind; begin ! Result := Metadata.StorageKind; end; *************** *** 3994,4004 **** begin Writer.WriteFmt('%s: %s', [Name, AttributeTypeText]); ! if Metadata.IsExternal = ceLinked then ! WriteStr(MetaKeyExternalLinked, Metadata.ExternalLinkedName) ! else if Metadata.IsExternal = ceStored then begin if Metadata.AttributeType = atPart then WriteStr(MetaKeyStored, Metadata.StorageName); ! WriteStr(MetaKeyExternalStored, Metadata.ExternalStoredName, True); end else --- 3976,3984 ---- begin Writer.WriteFmt('%s: %s', [Name, AttributeTypeText]); ! if Metadata.StorageKind = skExternal then begin if Metadata.AttributeType = atPart then WriteStr(MetaKeyStored, Metadata.StorageName); ! WriteStr(MetaKeyExternal, Metadata.ExternalStorageName, True); end else *************** *** 4057,4068 **** end; ! procedure TInstantCodeAttribute.SetExternalLinkedName(const Value: string); ! begin ! Metadata.ExternalLinkedName := Value; ! end; ! ! procedure TInstantCodeAttribute.SetExternalStoredName(const Value: string); begin ! Metadata.ExternalStoredName := Value; end; --- 4037,4043 ---- end; ! procedure TInstantCodeAttribute.SetExternalStorageName(const Value: string); begin ! Metadata.ExternalStorageName := Value; end; *************** *** 4107,4113 **** end; ! procedure TInstantCodeAttribute.SetIsExternal(const Value: TInstantContainerIsExternal); begin ! Metadata.IsExternal := Value; end; --- 4082,4088 ---- end; ! procedure TInstantCodeAttribute.SetStorageKind(const Value: TInstantStorageKind); begin ! Metadata.StorageKind := Value; end; *************** *** 8559,8571 **** Break; Token := ReadToken; ! if SameText(Token, MetaKeyExternalStored) then ! begin ! FMetadata.IsExternal := ceStored; ! FMetadata.ExternalStoredName := ''; ! end; ! if SameText(Token, MetaKeyExternalLinked) then begin ! FMetadata.IsExternal := ceLinked; ! FMetadata.ExternalLinkedName := ReadStringValue; end; end; --- 8534,8541 ---- Break; Token := ReadToken; ! if SameText(Token, MetaKeyExternal) then begin ! FMetadata.StorageKind := skExternal; ! FMetadata.ExternalStorageName := ''; end; end; Index: InstantPersistence.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Core/InstantPersistence.pas,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** InstantPersistence.pas 18 Feb 2005 11:04:09 -0000 1.23 --- InstantPersistence.pas 18 Feb 2005 14:27:04 -0000 1.24 *************** *** 25,43 **** * * Contributor(s): ! * Carlo Barazzetta, Andrea Petrelli: porting Kylix ! * Carlo Barazzetta: ! * - blob streaming in XML format (Part, Parts, References) ! * - UserPreparedQuery support ! * - Objects Assign with different connectors ! * - TInstantCurrency support ! * - TInstantGraphic support ! * - LoginPrompt support in Connections based on TCustomConnection [...1540 lines suppressed...] StatementObject: TInstantStatement; begin ! if Assigned(StatementImplementation) then ! begin Shrink; StatementObject := TInstantStatement.Create(StatementImplementation); *************** *** 15344,15348 **** begin Index := FStatements.IndexOf(StatementText); ! if Index >= 0 then begin DeleteStatement(Index); Result := True; --- 14917,14922 ---- begin Index := FStatements.IndexOf(StatementText); ! if Index >= 0 then ! begin DeleteStatement(Index); Result := True; |