You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(25) |
Oct
(10) |
Nov
(19) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(206) |
Mar
(43) |
Apr
(25) |
May
(20) |
Jun
(69) |
Jul
(121) |
Aug
(95) |
Sep
(122) |
Oct
(213) |
Nov
(46) |
Dec
(39) |
2006 |
Jan
(28) |
Feb
(57) |
Mar
(21) |
Apr
(7) |
May
(11) |
Jun
(2) |
Jul
(8) |
Aug
(13) |
Sep
(2) |
Oct
(2) |
Nov
(20) |
Dec
(16) |
2007 |
Jan
(9) |
Feb
(15) |
Mar
|
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(9) |
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(8) |
Apr
(1) |
May
|
Jun
|
Jul
(11) |
Aug
(57) |
Sep
(2) |
Oct
(6) |
Nov
|
Dec
(7) |
2010 |
Jan
(11) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(27) |
Oct
(3) |
Nov
(7) |
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(10) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(1) |
2013 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(4) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(4) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <dav...@us...> - 2010-01-29 04:25:03
|
Revision: 893 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=893&view=rev Author: davidvtaylor Date: 2010-01-29 04:24:56 +0000 (Fri, 29 Jan 2010) Log Message: ----------- * Fix blob update error with AnyDAC/MSSQL for blob sizes exceeding 8000 bytes. Blob parameter values were being assigned with AsBytes rather than AsBlob for Unicode version of Delphi. * Remove obsolete blob/memo code left over from the Unicode porting process Modified Paths: -------------- trunk/Source/Core/InstantBrokers.pas Modified: trunk/Source/Core/InstantBrokers.pas =================================================================== --- trunk/Source/Core/InstantBrokers.pas 2010-01-27 08:34:40 UTC (rev 892) +++ trunk/Source/Core/InstantBrokers.pas 2010-01-29 04:24:56 UTC (rev 893) @@ -2805,26 +2805,6 @@ var FieldName: string; - (* No longer used. To be removed when things stabilize with D2009. - procedure AddBlobParam(const AFieldName, Value: string); - var - Param: TParam; - begin - Param := AddParam(Params, AFieldName, ftBlob); - if Value <> '' then - Param.AsMemo := Value - end; - - procedure AddMemoParam(const AFieldName, Value: string); - var - Param: TParam; - begin - Param := AddParam(Params, AFieldName, ftMemo); - if Value <> '' then - Param.AsMemo := Value - end; - *) - procedure AddBlobAttributeParam; var LParam: TParam; @@ -2834,7 +2814,7 @@ LParam.Clear else {$IFDEF D12+} - LParam.AsBytes := (Attribute as TInstantBlob).Bytes; + LParam.AsBlob := (Attribute as TInstantBlob).Bytes; {$ELSE} LParam.AsBlob := (Attribute as TInstantBlob).Value; {$ENDIF} |
From: <na...@us...> - 2010-01-27 08:34:46
|
Revision: 892 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=892&view=rev Author: nandod Date: 2010-01-27 08:34:40 +0000 (Wed, 27 Jan 2010) Log Message: ----------- * Fixed bug #1503475. Modified Paths: -------------- trunk/Source/Core/InstantBrokers.pas Modified: trunk/Source/Core/InstantBrokers.pas =================================================================== --- trunk/Source/Core/InstantBrokers.pas 2010-01-27 08:33:07 UTC (rev 891) +++ trunk/Source/Core/InstantBrokers.pas 2010-01-27 08:34:40 UTC (rev 892) @@ -801,7 +801,7 @@ FStatement: TInstantIQLObject; FTablePathList: TStringList; FParentContext: TInstantTranslationContext; - + FIdDataType: TInstantDataType; procedure AddJoin(const FromPath, FromField, ToPath, ToField: string); function GetClassTablePath: string; function GetChildContext(const AIndex: Integer): TInstantTranslationContext; @@ -840,7 +840,8 @@ property TablePathList: TStringList read GetTablePathList; public constructor Create(const AStatement: TInstantIQLObject; const AQuote: Char; - const ADelimiters: string; const AParentContext: TInstantTranslationContext = nil); + const ADelimiters: string; const AIdDataType: TInstantDataType; + const AParentContext: TInstantTranslationContext = nil); destructor Destroy; override; procedure AfterConstruction; override; @@ -866,6 +867,7 @@ property CriteriaCount: Integer read GetCriteriaCount; property Criterias[Index: Integer]: string read GetCriterias; property Delimiters: string read FDelimiters; + property IdDataType: TInstantDataType read FIdDataType; property ObjectClassName: string read FObjectClassName write SetObjectClassName; property ObjectClassMetadata: TInstantClassMetadata read GetObjectClassMetadata; property ParentContext: TInstantTranslationContext read FParentContext; @@ -932,7 +934,7 @@ public property Context: TInstantTranslationContext read FContext; destructor Destroy; override; - function QuoteString(const Str: string): string; // funzione non membro + function QuoteString(const Str: string): string; property Query: TInstantCustomRelationalQuery read GetQuery; end; @@ -5165,7 +5167,8 @@ if not Assigned(Command.ClassRef) then Exit; - FContext := TInstantTranslationContext.Create(Command, Quote, Delimiters); + FContext := TInstantTranslationContext.Create(Command, Quote, + Delimiters, Connector.IdDataType); end; procedure TInstantRelationalTranslator.Clear; @@ -6139,7 +6142,8 @@ constructor TInstantTranslationContext.Create( const AStatement: TInstantIQLObject; const AQuote: Char; - const ADelimiters: string; const AParentContext: TInstantTranslationContext = nil); + const ADelimiters: string; const AIdDataType: TInstantDataType; + const AParentContext: TInstantTranslationContext = nil); begin inherited Create; FParentContext := AParentContext; @@ -6157,7 +6161,8 @@ function TInstantTranslationContext.CreateChildContext( const AStatement: TInstantIQLObject): TInstantTranslationContext; begin - Result := TInstantTranslationContext.Create(AStatement, Quote, Delimiters, Self); + Result := TInstantTranslationContext.Create(AStatement, Quote, Delimiters, + IdDataType, Self); end; destructor TInstantTranslationContext.Destroy; @@ -6383,9 +6388,15 @@ [Qualify(ClassTablePath, InstantClassFieldName), QuoteString(ClassRef.ObjectClassName)])); if Specifier.IsPath then - AddCriteria(Format('%s <> %s%s', - [QualifyPath(ConcatPath(Specifier.Text, InstantIdFieldName)), - Quote, Quote])); + begin + if IdDataType in [dtString, dtMemo, dtBlob] then + AddCriteria(Format('%s <> %s%s', + [QualifyPath(ConcatPath(Specifier.Text, InstantIdFieldName)), + Quote, Quote])) + else + AddCriteria(Format('%s <> 0', + [QualifyPath(ConcatPath(Specifier.Text, InstantIdFieldName))])); + end; end; var @@ -6403,8 +6414,6 @@ Specifier := TInstantIQLSubquery(FStatement).Specifier; end; - // da TInstantIQLRelationalTranslator.BeforeTranslate - PathList := TList.Create; try CollectPaths(FStatement, PathList); |
From: <na...@us...> - 2010-01-27 08:33:15
|
Revision: 891 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=891&view=rev Author: nandod Date: 2010-01-27 08:33:07 +0000 (Wed, 27 Jan 2010) Log Message: ----------- + Support for native D2010 Firebird DBX driver. Modified Paths: -------------- trunk/Source/Brokers/DBX/InstantDBX.pas Modified: trunk/Source/Brokers/DBX/InstantDBX.pas =================================================================== --- trunk/Source/Brokers/DBX/InstantDBX.pas 2010-01-03 04:02:13 UTC (rev 890) +++ trunk/Source/Brokers/DBX/InstantDBX.pas 2010-01-27 08:33:07 UTC (rev 891) @@ -172,6 +172,13 @@ function GetDBMSName: string; override; end; + { Firebird through the native D2010 driver } + + TInstantDBXFirebirdBroker = class(TInstantDBXInterBaseFirebirdBroker) + protected + function GetDBMSName: string; override; + end; + { MS SQL Server } TInstantDBXMSSQLSQLGenerator = class(TInstantSQLGenerator) @@ -321,6 +328,8 @@ Result := TInstantDBXMySQLBroker.Create(Self) else if SameText(Connection.DriverName, 'FirebirdUIB') then Result := TInstantDBXFirebirdUIBBroker.Create(Self) + else if SameText(Connection.DriverName, 'FIREBIRD') then + Result := TInstantDBXFirebirdBroker.Create(Self) else if SameText(Connection.DriverName, 'DevartInterbase') then Result := TInstantDBXDevartInterbaseBroker.Create(Self) else @@ -962,6 +971,13 @@ end; {$ENDIF} +{ TInstantDBXFirebirdBroker } + +function TInstantDBXFirebirdBroker.GetDBMSName: string; +begin + Result := 'Firebird'; +end; + initialization RegisterClass(TInstantDBXConnectionDef); TInstantDBXConnector.RegisterClass; |
From: <dav...@us...> - 2010-01-03 04:02:20
|
Revision: 890 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=890&view=rev Author: davidvtaylor Date: 2010-01-03 04:02:13 +0000 (Sun, 03 Jan 2010) Log Message: ----------- * Backout change to enumeration handling in InstantRtti to fix Model Explorer breakage Modified Paths: -------------- trunk/Source/Core/InstantRtti.pas Modified: trunk/Source/Core/InstantRtti.pas =================================================================== --- trunk/Source/Core/InstantRtti.pas 2010-01-03 03:58:44 UTC (rev 889) +++ trunk/Source/Core/InstantRtti.pas 2010-01-03 04:02:13 UTC (rev 890) @@ -105,7 +105,8 @@ Value: Variant): Variant; var PropInfo: PPropInfo; - PreferStrings: Boolean; +// DVT Backed out change to fix ME breakage issue +//PreferStrings: Boolean; begin if Assigned(AObject) then begin @@ -148,8 +149,10 @@ SetPropValue(AObject, InstantGetPropName(PropInfo), Value); end; end; - PreferStrings := GetTypeInfo(PropInfo)^.Kind <> tkEnumeration; - Result := GetPropValue(AObject, InstantGetPropName(PropInfo), PreferStrings); + // DVT Backed out change to fix ME breakage issue + //PreferStrings := GetTypeInfo(PropInfo)^.Kind <> tkEnumeration; + //Result := GetPropValue(AObject, InstantGetPropName(PropInfo), PreferStrings); + Result := GetPropValue(AObject, InstantGetPropName(PropInfo)); end else Result := Null; end else |
From: <dav...@us...> - 2010-01-03 03:58:56
|
Revision: 889 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=889&view=rev Author: davidvtaylor Date: 2010-01-03 03:58:44 +0000 (Sun, 03 Jan 2010) Log Message: ----------- + Add ZeosDBO Broker packages for D2009 and D2010 Added Paths: ----------- trunk/Source/Brokers/ZeosDBO/D2009/ trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.dpk trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.res trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.dpk trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.res trunk/Source/Brokers/ZeosDBO/D2010/ trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.dpk trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.res trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.dpk trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.res Added: trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.dpk =================================================================== --- trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.dpk (rev 0) +++ trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.dpk 2010-01-03 03:58:44 UTC (rev 889) @@ -0,0 +1,39 @@ +package DclIOZeosDBO; + +{$R *.res} +{$R '..\InstantZeosDBO.dcr'} + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS ON} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'InstantObjects ZeosDBO Design-Time Support (Delphi 2009)'} +{$LIBSUFFIX '_D12'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + IOZeosDBO; + +contains + InstantZeosDBOReg in '..\InstantZeosDBOReg.pas'; + +end. + Property changes on: trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.dpk ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.res =================================================================== (Binary files differ) Property changes on: trunk/Source/Brokers/ZeosDBO/D2009/DclIOZeosDBO.res ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.dpk =================================================================== --- trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.dpk (rev 0) +++ trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.dpk 2010-01-03 03:58:44 UTC (rev 889) @@ -0,0 +1,40 @@ +package IOZeosDBO; + +{$R *.res} + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS ON} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'InstantObjects ZeosDBO Run-Time Support (Delphi 2009)'} +{$LIBSUFFIX '_D12'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + IOCore, + ZComponent; + +contains + InstantZeosDBO in '..\InstantZeosDBO.pas', + InstantZeosDBOCatalog in '..\InstantZeosDBOCatalog.pas', + InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}; + +end. Property changes on: trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.dpk ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.res =================================================================== (Binary files differ) Property changes on: trunk/Source/Brokers/ZeosDBO/D2009/IOZeosDBO.res ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.dpk =================================================================== --- trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.dpk (rev 0) +++ trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.dpk 2010-01-03 03:58:44 UTC (rev 889) @@ -0,0 +1,39 @@ +package DclIOZeosDBO; + +{$R *.res} +{$R '..\InstantZeosDBO.dcr'} + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS ON} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'InstantObjects ZeosDBO Design-Time Support (Delphi 2010)'} +{$LIBSUFFIX '_D14'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + IOZeosDBO; + +contains + InstantZeosDBOReg in '..\InstantZeosDBOReg.pas'; + +end. + Property changes on: trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.dpk ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.res =================================================================== (Binary files differ) Property changes on: trunk/Source/Brokers/ZeosDBO/D2010/DclIOZeosDBO.res ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.dpk =================================================================== --- trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.dpk (rev 0) +++ trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.dpk 2010-01-03 03:58:44 UTC (rev 889) @@ -0,0 +1,40 @@ +package IOZeosDBO; + +{$R *.res} + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS ON} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'InstantObjects ZeosDBO Run-Time Support (Delphi 2010)'} +{$LIBSUFFIX '_D14'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + IOCore, + ZComponent; + +contains + InstantZeosDBO in '..\InstantZeosDBO.pas', + InstantZeosDBOCatalog in '..\InstantZeosDBOCatalog.pas', + InstantZeosDBOConnectionDefEdit in '..\InstantZeosDBOConnectionDefEdit.pas' {InstantZeosDBOConnectionDefEditForm}; + +end. Property changes on: trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.dpk ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.res =================================================================== (Binary files differ) Property changes on: trunk/Source/Brokers/ZeosDBO/D2010/IOZeosDBO.res ___________________________________________________________________ Added: svn:mime-type + application/octet-stream |
From: <dav...@us...> - 2010-01-03 03:39:41
|
Revision: 888 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=888&view=rev Author: davidvtaylor Date: 2010-01-03 03:39:29 +0000 (Sun, 03 Jan 2010) Log Message: ----------- * Fix for compile breakage under D2010 caused by a parameter type mismatch in TInstantAttribute.Initialize. This change is only a quick fix. A more complete design review should be performed. Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2010-01-03 03:34:13 UTC (rev 887) +++ trunk/Source/Core/InstantPersistence.pas 2010-01-03 03:39:29 UTC (rev 888) @@ -2453,7 +2453,7 @@ begin for CustomAttribute in RttiMember.GetAttributes do if CustomAttribute is TInstantRttiAttribute then - TInstantRttiAttribute(CustomAttribute).Change(Self, RttiMember); + TInstantRttiAttribute(CustomAttribute).Change(Self.GetOwner, RttiMember); end; var |
From: <dav...@us...> - 2010-01-03 03:34:25
|
Revision: 887 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=887&view=rev Author: davidvtaylor Date: 2010-01-03 03:34:13 +0000 (Sun, 03 Jan 2010) Log Message: ----------- * Add missing reference to InstantRttiAttributes to the IOCore package. This change only applies to D2010 Modified Paths: -------------- trunk/Source/Core/D2010/IOCore.dpk trunk/Source/Core/D2010/IOCore.dproj Modified: trunk/Source/Core/D2010/IOCore.dpk =================================================================== --- trunk/Source/Core/D2010/IOCore.dpk 2010-01-03 03:32:16 UTC (rev 886) +++ trunk/Source/Core/D2010/IOCore.dpk 2010-01-03 03:34:13 UTC (rev 887) @@ -58,6 +58,7 @@ InstantBrokers in '..\InstantBrokers.pas', InstantMetadata in '..\InstantMetadata.pas', InstantStandardValidators in '..\InstantStandardValidators.pas', - InstantValidation in '..\InstantValidation.pas'; + InstantValidation in '..\InstantValidation.pas', + InstantRttiAttributes in '..\InstantRttiAttributes.pas'; end. Modified: trunk/Source/Core/D2010/IOCore.dproj =================================================================== --- trunk/Source/Core/D2010/IOCore.dproj 2010-01-03 03:32:16 UTC (rev 886) +++ trunk/Source/Core/D2010/IOCore.dproj 2010-01-03 03:34:13 UTC (rev 887) @@ -83,6 +83,7 @@ <DCCReference Include="..\InstantMetadata.pas"/> <DCCReference Include="..\InstantStandardValidators.pas"/> <DCCReference Include="..\InstantValidation.pas"/> + <DCCReference Include="..\InstantRttiAttributes.pas"/> <BuildConfiguration Include="Base"> <Key>Base</Key> </BuildConfiguration> |
From: <dav...@us...> - 2010-01-03 03:32:24
|
Revision: 886 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=886&view=rev Author: davidvtaylor Date: 2010-01-03 03:32:16 +0000 (Sun, 03 Jan 2010) Log Message: ----------- * Add typecasts to fix string mismatch warnings with ZeosDBO v7. The Zeos team chose to "Ansify" the library rather than perform a full Unicode port. The typecasts have no effect on previous Delphi versions. Modified Paths: -------------- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas Modified: trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas =================================================================== --- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2010-01-03 01:58:02 UTC (rev 885) +++ trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2010-01-03 03:32:16 UTC (rev 886) @@ -365,7 +365,7 @@ with DbcConnection.GetMetadata.GetCatalogs do try while Next do - Strings.Add(GetString(1)); + Strings.Add(string(GetString(1))); finally Close; end; @@ -1124,7 +1124,7 @@ DbcConnection.QueryInterface(IZMySqlConnection, MySqlConnection); if Assigned(MySqlConnection) then MySqlConnection.GetPlainDriver. - CreateDatabase(MySqlConnection.GetConnectionHandle, PAnsiChar(Database)) + CreateDatabase(MySqlConnection.GetConnectionHandle, PAnsiChar(AnsiString(Database))) else inherited; finally Modified: trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas =================================================================== --- trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas 2010-01-03 01:58:02 UTC (rev 885) +++ trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas 2010-01-03 03:32:16 UTC (rev 886) @@ -85,13 +85,13 @@ // Work around for a ZeosDBO behavior with Interbase and Firebird, where // metadata name with wildcards ('_' or '%') receives a '%' after its name, // and another drivers where metadata names are searched with LIKE clause - if SameText(Fields.GetStringByName('TABLE_NAME'), TableMetadata.Name) then + if SameText(string(Fields.GetStringByName('TABLE_NAME')), TableMetadata.Name) then begin if ColumnTypeToDataType(TZSQLType(Fields.GetShortByName('DATA_TYPE')), FieldDataType, FieldAlternateDataTypes) then begin FieldMetadata := TableMetadata.FieldMetadatas.Add; - FieldMetadata.Name := Fields.GetStringByName('COLUMN_NAME'); + FieldMetadata.Name := string(Fields.GetStringByName('COLUMN_NAME')); FieldMetadata.DataType := FieldDataType; FieldMetadata.AlternateDataTypes := FieldAlternateDataTypes; FieldMetadata.Options := []; @@ -131,20 +131,20 @@ while PrimaryKeys.Next do // Work around for a ZeosDBO behavior with Interbase and Firebird where // metadata names are searched with LIKE clause - if SameText(PrimaryKeys.GetStringByName('TABLE_NAME'), TableMetadata.Name) then + if SameText(string(PrimaryKeys.GetStringByName('TABLE_NAME')), TableMetadata.Name) then begin - IndexName := PrimaryKeys.GetStringByName('PK_NAME'); + IndexName := string(PrimaryKeys.GetStringByName('PK_NAME')); // MySQL driver doesn't assign PK_NAME if IndexName = '' then IndexName := 'PRIMARY'; if Assigned(IndexMetadata) and SameText(IndexMetadata.Name, IndexName) then IndexMetadata.Fields := IndexMetadata.Fields + ';' + - PrimaryKeys.GetStringByName('COLUMN_NAME') + string(PrimaryKeys.GetStringByName('COLUMN_NAME')) else begin IndexMetadata := TableMetadata.IndexMetadatas.Add; IndexMetadata.Name := IndexName; - IndexMetadata.Fields := PrimaryKeys.GetStringByName('COLUMN_NAME'); + IndexMetadata.Fields := string(PrimaryKeys.GetStringByName('COLUMN_NAME')); IndexMetadata.Options := [ixPrimary, ixUnique]; end; end; @@ -157,17 +157,17 @@ IndexInfo.BeforeFirst; while IndexInfo.Next do begin - IndexName := IndexInfo.GetStringByName('INDEX_NAME'); + IndexName := string(IndexInfo.GetStringByName('INDEX_NAME')); // Exclude primary keys if not Assigned(TableMetadata.IndexMetadatas.Find(IndexName)) then begin if Assigned(IndexMetadata) and SameText(IndexMetadata.Name, IndexName) then IndexMetadata.Fields := IndexMetadata.Fields + ';' + - IndexInfo.GetStringByName('COLUMN_NAME'); + string(IndexInfo.GetStringByName('COLUMN_NAME')); begin IndexMetadata := TableMetadata.IndexMetadatas.Add; IndexMetadata.Name := IndexName; - IndexMetadata.Fields := IndexInfo.GetStringByName('COLUMN_NAME'); + IndexMetadata.Fields := string(IndexInfo.GetStringByName('COLUMN_NAME')); IndexMetadata.Options := []; if not IndexInfo.GetBooleanByName('NON_UNIQUE') { TODO : This work around must be removed for ZeosDBO versions @@ -199,10 +199,10 @@ Tables.BeforeFirst; while Tables.Next do begin - if SameText(Tables.GetStringByName('TABLE_TYPE'), 'TABLE') then + if SameText(string(Tables.GetStringByName('TABLE_TYPE')), 'TABLE') then begin TableMetadata := TableMetadatas.Add; - TableMetadata.Name := Tables.GetStringByName('TABLE_NAME'); + TableMetadata.Name := string(Tables.GetStringByName('TABLE_NAME')); // Call AddIndexMetadatas first, so that AddFieldMetadatas can see which // indexes are defined to correctly set the foIndexed option. AddIndexMetadatas(TableMetadata); |
From: <dav...@us...> - 2010-01-03 01:58:14
|
Revision: 885 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=885&view=rev Author: davidvtaylor Date: 2010-01-03 01:58:02 +0000 (Sun, 03 Jan 2010) Log Message: ----------- * Added experimental support for ZeosDBO v7 Alpha (Enabled using ZEOSDBO_V7+ define) * Added protocol support for Firebird 2.0 and 2.1 including embedded versions Modified Paths: -------------- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas Modified: trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas =================================================================== --- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2009-12-28 22:53:38 UTC (rev 884) +++ trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2010-01-03 01:58:02 UTC (rev 885) @@ -36,6 +36,15 @@ {$I '..\..\InstantDefines.inc'} {$ENDIF} +// +// Enable this define for ZeosDBO 7.x Alpha support +// +// WARNING: The broker will no longer compile agaist ZeosDBO v6.6.x. +// Zeos v7 support is experimental and has seen very little testing. +// +{.$DEFINE ZEOSDBO_V7+} + + // Supported databases {$DEFINE SYBASE_SUPPORT} @@ -54,6 +63,13 @@ {$IFDEF D10+}, DBCommonTypes{$ENDIF}; type + // Login event signature changed in v7 Alpha + {$IFDEF ZEOSDBO_V7+} + TZeosLoginEvent = TZLoginEvent; + {$ELSE} + TZeosLoginEvent = TLoginEvent; + {$ENDIF} + TInstantZeosDBOConnectionDef = class(TInstantRelationalConnectionDef) private FCatalog: string; @@ -91,7 +107,7 @@ private FConnection: TZConnection; FLoginPrompt: Boolean; - FOnLogin: TLoginEvent; + FOnLogin: TZeosLoginEvent; FUseDelimitedIdents: Boolean; procedure DoAfterConnectionChange; procedure DoBeforeConnectionChange; @@ -126,7 +142,7 @@ published property Connection: TZConnection read GetConnection write SetConnection; property LoginPrompt: Boolean read GetLoginPrompt write SetLoginPrompt default False; - property OnLogin: TLoginEvent read FOnLogin write FOnLogin; + property OnLogin: TZeosLoginEvent read FOnLogin write FOnLogin; property UseDelimitedIdents: Boolean read FUseDelimitedIdents write SetUseDelimitedIdents default False; end; @@ -485,7 +501,12 @@ if SameText(FConnection.Protocol, 'interbase-5') or SameText(FConnection.Protocol, 'interbase-6') or SameText(FConnection.Protocol, 'firebird-1.0') or - SameText(FConnection.Protocol, 'firebird-1.5') then + SameText(FConnection.Protocol, 'firebird-1.5') or + SameText(FConnection.Protocol, 'firebirdd-1.5') or + SameText(FConnection.Protocol, 'firebird-2.0') or + SameText(FConnection.Protocol, 'firebirdd-2.0') or + SameText(FConnection.Protocol, 'firebird-2.1') or + SameText(FConnection.Protocol, 'firebirdd-2.1') then Result := TInstantZeosDBOIbFbBroker.Create(Self); {$ENDIF} @@ -813,7 +834,11 @@ function TInstantZeosDBOBroker.GetDBMSName: string; begin if Connector.Connected then + {$IFDEF ZEOSDBO_V7+} + Result := Connector.Connection.DbcConnection.GetMetadata.GetDatabaseInfo.GetDatabaseProductName + {$ELSE} Result := Connector.Connection.DbcConnection.GetMetadata.GetDatabaseProductName + {$ENDIF} else Result := Connector.Connection.Protocol; end; @@ -1099,7 +1124,7 @@ DbcConnection.QueryInterface(IZMySqlConnection, MySqlConnection); if Assigned(MySqlConnection) then MySqlConnection.GetPlainDriver. - CreateDatabase(MySqlConnection.GetConnectionHandle, PChar(Database)) + CreateDatabase(MySqlConnection.GetConnectionHandle, PAnsiChar(Database)) else inherited; finally |
From: <dav...@us...> - 2009-12-28 22:53:47
|
Revision: 884 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=884&view=rev Author: davidvtaylor Date: 2009-12-28 22:53:38 +0000 (Mon, 28 Dec 2009) Log Message: ----------- * Fix failing Blob test under D2009+ caused by reading raw AnsiString data into a UnicodeString Modified Paths: -------------- trunk/Tests/TestInstantBlob.pas Modified: trunk/Tests/TestInstantBlob.pas =================================================================== --- trunk/Tests/TestInstantBlob.pas 2009-12-28 15:43:22 UTC (rev 883) +++ trunk/Tests/TestInstantBlob.pas 2009-12-28 22:53:38 UTC (rev 884) @@ -203,6 +203,8 @@ vReturnValue: Integer; vCount: Integer; vPosition: Integer; + vTempStr1: AnsiString; + vTempStr2: AnsiString; vBlobReadStr: string; vStreamReadStr: string; begin @@ -218,15 +220,16 @@ vReturnValue := vStream.Seek(vPosition, soFromBeginning); AssertEquals(vPosition, vReturnValue); - SetLength(vStreamReadStr, vCount); - vReturnValue := vStream.Read(vStreamReadStr[1], vCount); + SetLength(vTempStr1, vCount); + vReturnValue := vStream.Read(vTempStr1[1], vCount); AssertEquals(vCount, vReturnValue); + vStreamReadStr := string(vTempStr1); - SetLength(vBlobReadStr, vCount); - vReturnValue := FInstantBlob.ReadBuffer(vBlobReadStr[1], vPosition, - vCount); + SetLength(vTempStr2, vCount); + vReturnValue := FInstantBlob.ReadBuffer(vTempStr2[1], vPosition, vCount); AssertEquals(vCount, vReturnValue); - AssertEquals(vStreamReadStr, vBlobReadStr); + vBlobReadStr := string(vTempStr2); + AssertEquals(string(vStreamReadStr), string(vBlobReadStr)); vStreamReadStr := UpperCase(vStreamReadStr); vBlobReadStr := UpperCase(vBlobReadStr); |
From: <car...@us...> - 2009-12-28 15:43:35
|
Revision: 883 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=883&view=rev Author: carlobar Date: 2009-12-28 15:43:22 +0000 (Mon, 28 Dec 2009) Log Message: ----------- Prevent an access violation into IDE closing an application that uses InstantObjects. Modified Paths: -------------- trunk/Source/Core/InstantCode.pas trunk/Source/Design/InstantAttributeView.pas Modified: trunk/Source/Core/InstantCode.pas =================================================================== --- trunk/Source/Core/InstantCode.pas 2009-12-28 15:41:25 UTC (rev 882) +++ trunk/Source/Core/InstantCode.pas 2009-12-28 15:43:22 UTC (rev 883) @@ -5189,7 +5189,10 @@ function TInstantCodeClass.GetBaseClass: TInstantCodeClass; begin - Result := FBaseClassLink.Instance; + if Assigned(FBaseClassLink) then + Result := FBaseClassLink.Instance + else + Result := nil; end; function TInstantCodeClass.GetBaseClassName: string; Modified: trunk/Source/Design/InstantAttributeView.pas =================================================================== --- trunk/Source/Design/InstantAttributeView.pas 2009-12-28 15:41:25 UTC (rev 882) +++ trunk/Source/Design/InstantAttributeView.pas 2009-12-28 15:43:22 UTC (rev 883) @@ -447,7 +447,7 @@ procedure TInstantAttributeViewFrame.PopulateInheritedAttributes; begin - if (assigned(Subject)) then + if (assigned(Subject)) and (assigned(Subject.BaseClass)) then LoadAttributeView(InheritedAttributesView, Subject.BaseClass, True); end; |
From: <car...@us...> - 2009-12-28 15:41:34
|
Revision: 882 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=882&view=rev Author: carlobar Date: 2009-12-28 15:41:25 +0000 (Mon, 28 Dec 2009) Log Message: ----------- Added support for Devart DbExpress Driver for Interbase/Firebird Modified Paths: -------------- trunk/Source/Brokers/DBX/InstantDBX.pas Modified: trunk/Source/Brokers/DBX/InstantDBX.pas =================================================================== --- trunk/Source/Brokers/DBX/InstantDBX.pas 2009-12-22 19:11:42 UTC (rev 881) +++ trunk/Source/Brokers/DBX/InstantDBX.pas 2009-12-28 15:41:25 UTC (rev 882) @@ -165,6 +165,13 @@ function GetDBMSName: string; override; end; + { Firebird/Interbase through the Devart dbX driver } + + TInstantDBXDevartInterbaseBroker = class(TInstantDBXInterBaseFirebirdBroker) + protected + function GetDBMSName: string; override; + end; + { MS SQL Server } TInstantDBXMSSQLSQLGenerator = class(TInstantSQLGenerator) @@ -314,6 +321,8 @@ Result := TInstantDBXMySQLBroker.Create(Self) else if SameText(Connection.DriverName, 'FirebirdUIB') then Result := TInstantDBXFirebirdUIBBroker.Create(Self) + else if SameText(Connection.DriverName, 'DevartInterbase') then + Result := TInstantDBXDevartInterbaseBroker.Create(Self) else raise Exception.CreateFmt('dbExpress driver "%s" not supported', [Connection.DriverName]); @@ -893,6 +902,13 @@ Result := 'Firebird'; end; +{ TInstantDBXDevartInterbaseBroker } + +function TInstantDBXDevartInterbaseBroker.GetDBMSName: string; +begin + Result := 'Interbase'; +end; + { TInstantDBXTransaction } constructor TInstantDBXTransaction.Create(const AConnector: TInstantDBXConnector); |
From: <wp...@us...> - 2009-12-22 19:11:53
|
Revision: 881 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=881&view=rev Author: wp2udk Date: 2009-12-22 19:11:42 +0000 (Tue, 22 Dec 2009) Log Message: ----------- Two bug fixes: - The BDE Broker wasn't able to create SequenceNo without throwing an 'Invalid field size' BDE Exception. Don't know why this happened? The field size was 32. It works for other Integer types? Setting the field size to 0 fixes the problem. - TInstantAttributeType = atEnum was not supported by the Exposer. Attribute types of atEnum was treated as Strings. This attribute type is now treated as Integer. Modified Paths: -------------- trunk/Source/Brokers/BDE/InstantBDE.pas trunk/Source/Core/InstantPresentation.pas trunk/Source/Core/InstantRtti.pas Modified: trunk/Source/Brokers/BDE/InstantBDE.pas =================================================================== --- trunk/Source/Brokers/BDE/InstantBDE.pas 2009-12-21 09:13:48 UTC (rev 880) +++ trunk/Source/Brokers/BDE/InstantBDE.pas 2009-12-22 19:11:42 UTC (rev 881) @@ -410,6 +410,7 @@ I: Integer; Table: TTable; IndexName: string; + TmpSize: Integer; begin Table := TTable.Create(nil); try @@ -427,8 +428,17 @@ end; for I := 0 to Pred(FieldMetadatas.Count) do with FieldMetadatas[I] do - Table.FieldDefs.Add(Name, FieldTypes[DataType], Size, + begin + // Avoid 'Invalid field size' BDE Exception when creating + // SequenceNo. Don't know why it only happens for this dtInteger + // field? + if DataType = dtInteger then + TmpSize := 0 else + TmpSize := Size; + + Table.FieldDefs.Add(Name, FieldTypes[DataType], TmpSize, foRequired in Options); + end; end; Table.CreateTable; finally Modified: trunk/Source/Core/InstantPresentation.pas =================================================================== --- trunk/Source/Core/InstantPresentation.pas 2009-12-21 09:13:48 UTC (rev 880) +++ trunk/Source/Core/InstantPresentation.pas 2009-12-22 19:11:42 UTC (rev 881) @@ -2211,6 +2211,21 @@ Result := ftString; end; + function EnumerationToFieldType(const FieldName: string): TFieldType; + var + AttributeMetadata: TInstantAttributeMetadata; + begin + Result := ftString; + AttributeMetadata := FindAttributeMetadata(FieldName); + if Assigned(AttributeMetadata) then + case AttributeMetadata.AttributeType of + atEnum: + Result := ftInteger; + atBoolean: + Result := ftBoolean; + end; + end; + var FieldName: string; FieldType: TFieldType; @@ -2230,10 +2245,11 @@ Include(FieldAttribs, DB.faReadOnly); case TypeKind of tkEnumeration: - if PropInfo^.PropType^^.Name = 'Boolean' then + FieldType := EnumerationToFieldType(FieldName); +{ if PropInfo^.PropType^^.Name = 'Boolean' then FieldType := ftBoolean else - FieldType := ftString; + FieldType := ftString;} tkString, tkLString{$IFDEF D12+}, tkUString{$ENDIF}: FieldType := StringFieldType(FieldName); tkInteger: Modified: trunk/Source/Core/InstantRtti.pas =================================================================== --- trunk/Source/Core/InstantRtti.pas 2009-12-21 09:13:48 UTC (rev 880) +++ trunk/Source/Core/InstantRtti.pas 2009-12-22 19:11:42 UTC (rev 881) @@ -105,6 +105,7 @@ Value: Variant): Variant; var PropInfo: PPropInfo; + PreferStrings: Boolean; begin if Assigned(AObject) then begin @@ -147,7 +148,8 @@ SetPropValue(AObject, InstantGetPropName(PropInfo), Value); end; end; - Result := GetPropValue(AObject, InstantGetPropName(PropInfo)); + PreferStrings := GetTypeInfo(PropInfo)^.Kind <> tkEnumeration; + Result := GetPropValue(AObject, InstantGetPropName(PropInfo), PreferStrings); end else Result := Null; end else |
From: <wp...@us...> - 2009-12-21 09:14:00
|
Revision: 880 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=880&view=rev Author: wp2udk Date: 2009-12-21 09:13:48 +0000 (Mon, 21 Dec 2009) Log Message: ----------- Added support for Custom Attributes in InstantObjects. In the future this initiative (custom attributes) might replace Metadata comments (See post "info: Fix for Delphi 2010 Custom Attributes"). This is a fairly new implementation and it NEEDS a great amount of DESIGN and TEST. Below you'll see a code example on how things might be implemented in the future. Model implementation: TContact = class(TInstantObject) {IOMETADATA stored; Address: Part(TAddress); Name: String(30); Phones: Parts(TPhone); } [IOATTRIBUTE(atPart, -1, TAddress)] _Address: TInstantPart; [IOATTRIBUTE(atString, 30, nil)] _Name: TInstantString; [IOATTRIBUTE(atParts, -1, TPhone)] _Phones: TInstantParts; private function GetAddress: TAddress; function GetName: string; function GetPhoneCount: Integer; function GetPhones(Index: Integer): TPhone; procedure SetAddress(Value: TAddress); procedure SetName(const Value: string); procedure SetPhones(Index: Integer; Value: TPhone); public function AddPhone(Phone: TPhone): Integer; procedure ClearPhones; procedure DeletePhone(Index: Integer); function IndexOfPhone(Phone: TPhone): Integer; procedure InsertPhone(Index: Integer; Phone: TPhone); function RemovePhone(Phone: TPhone): Integer; property PhoneCount: Integer read GetPhoneCount; property Phones[Index: Integer]: TPhone read GetPhones write SetPhones; published property Address: TAddress read GetAddress write SetAddress; property Name: string read GetName write SetName; end; Custom Attribute implementation: IOATTRIBUTE = class(TInstantRttiFieldAttribute) private FAttributeType: TInstantAttributeType; FDataSize: Integer; FRef: TInstantObjectClass; protected procedure InternalChange(AObject: TInstantObject; AField: TRttiField); override; public constructor Create(AAttributeType: TInstantAttributeType; ADataSize: Integer; ARef: TInstantObjectClass = nil); property AttributeType: TInstantAttributeType read FAttributeType write FAttributeType; property DataSize: Integer read FDataSize write FDataSize; property ARef: TInstantObjectClass read FRef write FRef; end; implementation { IOATTRIBUTE } constructor IOATTRIBUTE.Create(AAttributeType: TInstantAttributeType; ADataSize: Integer; ARef: TInstantObjectClass = nil); begin FAttributeType := AAttributeType; FDataSize := ADataSize; FRef := ARef; end; procedure IOATTRIBUTE.InternalChange(AObject: TInstantObject; AField: TRttiField); var Attribute: TInstantAttribute; begin inherited; Attribute := AField.GetValue(AObject).AsObject as TInstantAttribute; with Attribute.Metadata do begin AttributeType := FAttributeType; DataSize := FDataSize; if FAttributeType in [atPart, atParts, atReference, atReferences] then ObjectClassName := FRef.ClassName; end; end; Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas Added Paths: ----------- trunk/Source/Core/InstantRttiAttributes.pas Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2009-12-21 04:52:06 UTC (rev 879) +++ trunk/Source/Core/InstantPersistence.pas 2009-12-21 09:13:48 UTC (rev 880) @@ -1610,6 +1610,9 @@ {$ELSE} Mask, {$ENDIF} +{$IFDEF D14+} + RTTI, InstantRttiAttributes, +{$ENDIF} InstantUtils, {InstantRtti, }InstantDesignHook, InstantCode; var @@ -2440,7 +2443,48 @@ end; procedure TInstantAttribute.Initialize; + +{$IFDEF D14+} + procedure InitializeRttiAttributes; + + procedure InvokeRttiAttribute(RttiMember: TRttiMember); + var + CustomAttribute: TCustomAttribute; + begin + for CustomAttribute in RttiMember.GetAttributes do + if CustomAttribute is TInstantRttiAttribute then + TInstantRttiAttribute(CustomAttribute).Change(Self, RttiMember); + end; + + var + RttiContext: TRttiContext; + RttiType: TRttiType; + RttiField: TRttiField; + RttiMethod: TRttiMethod; + RttiProperty: TRttiProperty; + begin + RttiContext := TRttiContext.Create; + try + RttiType := RttiContext.GetType(Self.ClassType); + + for RttiField in RttiType.GetFields do + InvokeRttiAttribute(RttiField); + + for RttiMethod in RttiType.GetMethods do + InvokeRttiAttribute(RttiMethod); + + for RttiProperty in RttiType.GetProperties do + InvokeRttiAttribute(RttiProperty); + finally + RttiContext.Free + end; + end; +{$ENDIF} + begin +{$IFDEF D14+} + InitializeRttiAttributes; +{$ENDIF} end; procedure TInstantAttribute.ReadName(Reader: TInstantReader); Added: trunk/Source/Core/InstantRttiAttributes.pas =================================================================== --- trunk/Source/Core/InstantRttiAttributes.pas (rev 0) +++ trunk/Source/Core/InstantRttiAttributes.pas 2009-12-21 09:13:48 UTC (rev 880) @@ -0,0 +1,94 @@ +(* + * InstantObjects + * Delphi 2010 Custom Attributes framework + *) + +(* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is: Brian Andersen + * + * The Initial Developer of the Original Code is: Seleqt + * + * Portions created by the Initial Developer are Copyright (C) 2001-2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Brian Andersen + * + * ***** END LICENSE BLOCK ***** *) + +unit InstantRttiAttributes; + +interface + +uses + InstantPersistence, Rtti; + +type + TInstantRttiAttribute = class(TCustomAttribute) + public + procedure Change(AObject: TInstantObject; AMember: TRttiMember); virtual; abstract; + end; + + TInstantRttiAttributeClass = class of TInstantRttiAttribute; + + TInstantRttiFieldAttribute = class(TInstantRttiAttribute) + protected + procedure InternalChange(AObject: TInstantObject; AField: TRttiField); virtual; abstract; + public + procedure Change(AObject: TInstantObject; AMember: TRttiMember); override; + end; + + TInstantRttiMethodAttribute = class(TInstantRttiAttribute) + protected + procedure InternalChange(AObject: TInstantObject; AMethod: TRttiMethod); virtual; abstract; + public + procedure Change(AObject: TInstantObject; AMember: TRttiMember); override; + end; + + TInstantRttiPropertyAttribute = class(TInstantRttiAttribute) + protected + procedure InternalChange(AObject: TInstantObject; AProperty: TRttiProperty); virtual; abstract; + public + procedure Change(AObject: TInstantObject; AMember: TRttiMember); override; + end; + + +implementation + +{ TInstantRttiFieldAttribute } + +procedure TInstantRttiFieldAttribute.Change(AObject: TInstantObject; + AMember: TRttiMember); +begin + InternalChange(AObject, AMember as TRttiField); +end; + +{ TInstantRttiMethodAttribute } + +procedure TInstantRttiMethodAttribute.Change(AObject: TInstantObject; + AMember: TRttiMember); +begin + InternalChange(AObject, AMember as TRttiMethod); +end; + +{ TInstantRttiPropertyAttribute } + +procedure TInstantRttiPropertyAttribute.Change(AObject: TInstantObject; + AMember: TRttiMember); +begin + InternalChange(AObject, AMember as TRttiProperty); +end; + +end. \ No newline at end of file Property changes on: trunk/Source/Core/InstantRttiAttributes.pas ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native |
From: <dav...@us...> - 2009-12-21 04:52:22
|
Revision: 879 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=879&view=rev Author: davidvtaylor Date: 2009-12-21 04:52:06 +0000 (Mon, 21 Dec 2009) Log Message: ----------- * Fix memory leak with TInstantExposer that occurs if the exposer is destroyed with Subject changes pending. The exposer changes are now Undone and the Subject set to Nil in the exposer destructor. * Small optimization in TInstantConnector.GetClientCount to prevent the underlying list from being unnecessarily created when checking if the list is empty. Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas trunk/Source/Core/InstantPresentation.pas Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2009-12-19 16:27:18 UTC (rev 878) +++ trunk/Source/Core/InstantPersistence.pas 2009-12-21 04:52:06 UTC (rev 879) @@ -8711,7 +8711,10 @@ function TInstantConnector.GetClientCount: Integer; begin - Result := ClientList.Count; + if (assigned(FClientList)) then + Result := FClientList.Count + else + Result := 0; end; function TInstantConnector.GetClientList: TList; Modified: trunk/Source/Core/InstantPresentation.pas =================================================================== --- trunk/Source/Core/InstantPresentation.pas 2009-12-19 16:27:18 UTC (rev 878) +++ trunk/Source/Core/InstantPresentation.pas 2009-12-21 04:52:06 UTC (rev 879) @@ -2545,6 +2545,11 @@ destructor TInstantCustomExposer.Destroy; begin + // Ensure the Exposer is closed. Active will always be False + // for TInstantExposer since the Subject is already set to Nil + // (see TInstantExposer.Destroy for more details). + if Active then + Close; FNotifier.Free; DestroyAccessor; if (csDesigning in ComponentState) and Assigned(DesignModel) then @@ -4413,6 +4418,10 @@ destructor TInstantExposer.Destroy; begin + // Clear the Subject to Undo any pending changes and deactivate the + // Exposer. This prevents TDataSet.Destroy from causing the Subject + // be unexpectedly accessed later in the destruction sequence. + SetSubject(nil); FMasterLink.Free; inherited; end; |
From: <wp...@us...> - 2009-12-19 16:27:27
|
Revision: 878 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=878&view=rev Author: wp2udk Date: 2009-12-19 16:27:18 +0000 (Sat, 19 Dec 2009) Log Message: ----------- Delphi 2010 Extension: When including Custom Attributes in an IO Model the code parser failed and you got a message saying that Txxx class was not registered when running the application. The fix simply moves the parser beyond the Custom Attributes. This is not a specific implementation for D2010 (no compiler directives are included). It should compile into older versions of D2010 without any problems. If you are using a Delphi version prior to D2010 the IDE will simply throw a Syntax error if you try to use Custom Attributes. A code example: TAddress = class(TInstantObject) {IOMETADATA City: String(30); PostalCode: String(8); Street: String(30); } [MyAttr('x')] <--- D2010 Custom Attribute _City: TInstantString; _PostalCode: TInstantString; _Street: TInstantString; private [MyAttr('x')] <--- D2010 Custom Attribute function GetCity: string; function GetPostalCode: string; function GetStreet: string; procedure SetCity(const Value: string); procedure SetPostalCode(const Value: string); procedure SetStreet(const Value: string); published property City: string read GetCity write SetCity; property PostalCode: string read GetPostalCode write SetPostalCode; property Street: string read GetStreet write SetStreet; end; Modified Paths: -------------- trunk/Source/Core/InstantCode.pas Modified: trunk/Source/Core/InstantCode.pas =================================================================== --- trunk/Source/Core/InstantCode.pas 2009-10-14 05:53:23 UTC (rev 877) +++ trunk/Source/Core/InstantCode.pas 2009-12-19 16:27:18 UTC (rev 878) @@ -495,6 +495,12 @@ TInstantCodeContainerMethodFlag = (mfIndex, mfValue, mfResult); TInstantCodeContainerMethodFlags = set of TInstantCodeContainerMethodFlag; + TInstantCodeRttiAttribute = class(TInstantCodeMember) + protected + class function InternalAtInstance(Reader: TInstantCodeReader; out Name: string): Boolean; override; + procedure InternalRead(Reader: TInstantCodeReader); override; + end; + TInstantCodeAttributeTailor = class(TObject) private FAddMethod: TInstantCodeMethod; @@ -2858,13 +2864,15 @@ Result := TInstantCodeField.AtInstance(Reader) or TInstantCodeMethod.AtInstance(Reader) or - TInstantCodeProperty.AtInstance(Reader); + TInstantCodeProperty.AtInstance(Reader) or + TInstantCodeRttiAttribute.AtInstance(Reader); end; procedure TInstantCodeMembers.InternalRead(Reader: TInstantCodeReader); begin ReadObjects(Reader, - [TInstantCodeField, TInstantCodeMethod, TInstantCodeProperty]); + [TInstantCodeField, TInstantCodeMethod, TInstantCodeProperty, + TInstantCodeRttiAttribute]); end; procedure TInstantCodeMembers.InternalWrite(Writer: TInstantCodeWriter); @@ -3286,6 +3294,32 @@ FTypeLink.Name := Value; end; +{ TInstantCodeRttiAttribute } + +class function TInstantCodeRttiAttribute.InternalAtInstance( + Reader: TInstantCodeReader; out Name: string): Boolean; +begin + Result := Reader.ReadChar = '['; + if Result then + Name := Reader.ReadToken else + Name := ''; +end; + +procedure TInstantCodeRttiAttribute.InternalRead(Reader: TInstantCodeReader); +var + BracketCount: Integer; + C: Char; +begin + inherited; + + BracketCount := 0; + repeat + C := Reader.ReadChar; + if C = '[' then Inc(BracketCount) else + if C = ']' then Dec(BracketCount); + until BracketCount = 0; +end; + { TInstantCodeAttributeTailor } procedure TInstantCodeAttributeTailor.AddCountProp; @@ -9032,4 +9066,3 @@ DestroyTypeProcessors; end. - |
From: <dav...@us...> - 2009-10-14 05:53:30
|
Revision: 877 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=877&view=rev Author: davidvtaylor Date: 2009-10-14 05:53:23 +0000 (Wed, 14 Oct 2009) Log Message: ----------- * Add missing InstantTypes unit to the interface uses list Modified Paths: -------------- trunk/Demos/Test/BuildPrimerDatabase/UBuilder.pas Modified: trunk/Demos/Test/BuildPrimerDatabase/UBuilder.pas =================================================================== --- trunk/Demos/Test/BuildPrimerDatabase/UBuilder.pas 2009-10-14 05:52:11 UTC (rev 876) +++ trunk/Demos/Test/BuildPrimerDatabase/UBuilder.pas 2009-10-14 05:53:23 UTC (rev 877) @@ -3,7 +3,7 @@ interface uses - InstantPersistence, Classes; + InstantPersistence, InstantTypes, Classes; procedure BuildAndConnect(const ConnectionFileName, ConnectionName : string); procedure CreateRandomContacts(Count: Integer; LoadPictures : boolean = False; |
From: <dav...@us...> - 2009-10-14 05:52:20
|
Revision: 876 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=876&view=rev Author: davidvtaylor Date: 2009-10-14 05:52:11 +0000 (Wed, 14 Oct 2009) Log Message: ----------- * Fix for incorrect Currency values when using TInstantExposer under D2010. This change implements workarounds for Delphi QC 78576 and 78620 for D2010+ Modified Paths: -------------- trunk/Source/Core/InstantPresentation.pas Modified: trunk/Source/Core/InstantPresentation.pas =================================================================== --- trunk/Source/Core/InstantPresentation.pas 2009-10-12 20:19:53 UTC (rev 875) +++ trunk/Source/Core/InstantPresentation.pas 2009-10-14 05:52:11 UTC (rev 876) @@ -388,6 +388,7 @@ function AllocRecordBuffer: TRecordBuffer; override; procedure ClearCalcFields(Buffer: TRecordBuffer); override; procedure FreeRecordBuffer(var Buffer: TRecordBuffer); override; + function FieldDataSize(Field : TField): integer; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} procedure GetBookmarkData(Buffer: TRecordBuffer; Data: Pointer); override; function GetBookmarkFlag(Buffer: TRecordBuffer): TBookmarkFlag; override; function GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; @@ -2423,7 +2424,7 @@ if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then begin SaveFieldValue(Fields[I], @Buffer[Offset], AObject); - Inc(Offset, Fields[I].DataSize); + Inc(Offset, FieldDataSize(Fields[I])); end; end; end; @@ -2447,7 +2448,7 @@ begin LoadFieldParams(AObject, Fields[I]); LoadFieldValue(Fields[I], @Buffer[Offset], AObject); - Inc(Offset, Fields[I].DataSize); + Inc(Offset, FieldDataSize(Fields[I])); end; end; GetBookmarkData(Buffer, @BM); @@ -2534,7 +2535,7 @@ Result := 0; for I := 0 to Pred(FieldCount) do if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then - Inc(Result, Fields[I].DataSize); + Inc(Result, FieldDataSize(Fields[I])); end; procedure TInstantCustomExposer.DeleteObject(Index: Integer); @@ -2672,6 +2673,25 @@ Buffer := nil; end; +function TInstantCustomExposer.FieldDataSize(Field : TField): integer; +begin +{$IFDEF D14+} + // Workaround for DataSize bugs in D2010 RTM (QC 78620 and 78620) + if (not Assigned(Field)) or (Field is TBlobField) then + Result := 0 + else + if Field is TBCDField then + Result := SizeOf(TBcd) // D2010 returns Sizeof(System.Currency) + else + Result := Field.DataSize; +{$ELSE} + if Assigned(Field) then + Result := Field.DataSize + else + Result := 0; +{$ENDIF} +end; + function TInstantCustomExposer.GetAccessor: TInstantAccessor; begin if not Assigned(FAccessor) then @@ -2759,7 +2779,7 @@ D: TDateTimeRec; begin if Assigned(Buffer) then - Move(CurrentBuffer[GetFieldOffset(Field)], Buffer^, Field.DataSize); + Move(CurrentBuffer[GetFieldOffset(Field)], Buffer^, FieldDataSize(Field)); // Show null dates as blanks if (Field is TDateTimeField) and Assigned(Buffer) then begin @@ -2780,7 +2800,7 @@ Result := 0; for I := 0 to Pred(Field.Index) do if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then - Inc(Result, Fields[I].DataSize); + Inc(Result, FieldDataSize(Fields[I])); end; end; @@ -3610,13 +3630,13 @@ case Field.DataType of ftString: begin - FillChar(Buffer^, Field.DataSize, 0); + FillChar(Buffer^, FieldDataSize(Field), 0); if not Empty then begin S := AnsiString(Value); Len := Length(S); - if Len >= Field.DataSize then - Len := Pred(Field.DataSize); + if Len >= FieldDataSize(Field) then + Len := Pred(FieldDataSize(Field)); if Len > 0 then Move(S[1], Buffer^, Len); end; @@ -3648,14 +3668,14 @@ if Empty or (Value = 0) then D.Date := 0 else D.Date := Value + DateDelta; - Move(D, Buffer^, Field.DataSize); + Move(D, Buffer^, FieldDataSize(Field)); end; ftTime: begin if Empty or (Value = 0) then D.Time := 0 else D.Time := Value * MSecsPerDay; - Move(D, Buffer^, Field.DataSize); + Move(D, Buffer^, FieldDataSize(Field)); end; ftDateTime: begin @@ -3665,7 +3685,7 @@ T := DateTimeToTimeStamp(Value); D.DateTime := TimeStampToMSecs(T); end; - Move(D, Buffer^, Field.DataSize); + Move(D, Buffer^, FieldDataSize(Field)); end; ftBoolean: begin @@ -3999,7 +4019,7 @@ case Field.DataType of ftString: begin - P := {$IFDEF UNICODE}AnsiStrAlloc{$ELSE}StrAlloc{$ENDIF}(Field.DataSize); + P := {$IFDEF UNICODE}AnsiStrAlloc{$ELSE}StrAlloc{$ENDIF}(FieldDataSize(Field)); try StrCopy(P, Buffer); S := P; @@ -4027,7 +4047,7 @@ end; ftDate: begin - Move(Buffer^, D, Field.DataSize); + Move(Buffer^, D, FieldDataSize(Field)); if D.Date = 0 then Value := 0 else @@ -4035,12 +4055,12 @@ end; ftTime: begin - Move(Buffer^, D, Field.DataSize); + Move(Buffer^, D, FieldDataSize(Field)); Value := D.Time / MSecsPerDay; end; ftDateTime: begin - Move(Buffer^, D, Field.DataSize); + Move(Buffer^, D, FieldDataSize(Field)); if (D.Date = 0) and (D.Time = 0) then Value := 0 else begin @@ -4114,9 +4134,9 @@ procedure TInstantCustomExposer.SetFieldData(Field: TField; Buffer: Pointer); begin if Assigned(Buffer) then - Move(Buffer^, CurrentBuffer[GetFieldOffset(Field)], Field.DataSize) + Move(Buffer^, CurrentBuffer[GetFieldOffset(Field)], FieldDataSize(Field)) else - FillChar(CurrentBuffer[GetFieldOffset(Field)], Field.DataSize, 0); + FillChar(CurrentBuffer[GetFieldOffset(Field)], FieldDataSize(Field), 0); if not (State in [dsCalcFields, dsInternalCalc, dsFilter, dsNewValue]) and not FInSetFieldData then begin |
From: <dav...@us...> - 2009-10-12 20:20:02
|
Revision: 875 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=875&view=rev Author: davidvtaylor Date: 2009-10-12 20:19:53 +0000 (Mon, 12 Oct 2009) Log Message: ----------- * Modified AnyDAC broker to include additional units implicitly required by TADQuery. These units were previously not automatically added to a minimal InstantObjects application containing only a TADConnection and TInstantAnyDACConnector. The absence of these units resulted in runtime exceptions due to missing class factories in AnyDAC uADStanAsync and uADDAptManager units. Modified Paths: -------------- trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas Modified: trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas =================================================================== --- trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas 2009-10-11 05:56:00 UTC (rev 874) +++ trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas 2009-10-12 20:19:53 UTC (rev 875) @@ -50,7 +50,8 @@ uses Classes, Db, InstantPersistence, InstantCommand, InstantDBBuild, InstantBrokers, InstantMetadata, InstantTypes, uADCompClient, - uADStanOption, uADStanParam, uADStanIntf, uADStanConst + uADStanOption, uADStanParam, uADStanIntf, uADStanConst, + uADDAptIntf, uADStanAsync, uADDAptManager, uADCompDataSet {$IFDEF D10+}, DBCommonTypes{$ENDIF}; type |
From: <dav...@us...> - 2009-10-11 05:56:07
|
Revision: 874 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=874&view=rev Author: davidvtaylor Date: 2009-10-11 05:56:00 +0000 (Sun, 11 Oct 2009) Log Message: ----------- * Define TRecordBuffer type for D2007 and earlier for compatibility with type in D2009+ * Eliminate most {$IFDEF D12+} conditional logic in InstantPresentation by using TRecordBuffer type + Implement missing bookmark logic for D2009+ (Delphi Bookmark changed from Pointer to dynamic byte array) + Implement D10_OR_D11 define to cleanup messy conditional logic for IProviderSupport in TInstantCustomExposer + Implement InstantAllocMem and InstantFreeMem in InstantUtils unit for use in TInstantCustomExposer class + Add IO_MEM_OVERRUN_CHECK define and conditional guard block checking to catch DataSet record buffer overruns + Add define SUPPORTS_INLINE for D9+ to indicate "inline" keyword is supported by the compiler * Fix for nasty BufferOverrun/memory corruption problem in TInstantCustomExposer caused by a change to TBlobField in D2010. TBlobField.GetDataSize now returns the size of the blob contents rather than zero as in previous Delphi versions. TInstantExposer was originally coded assuming DataSize is always zero for blob fields. New logic explicitly excludes blob fields from RecordBuffer operations. Modified Paths: -------------- trunk/Source/Core/InstantPresentation.pas trunk/Source/Core/InstantUtils.pas trunk/Source/InstantDefines.inc Modified: trunk/Source/Core/InstantPresentation.pas =================================================================== --- trunk/Source/Core/InstantPresentation.pas 2009-10-11 05:34:05 UTC (rev 873) +++ trunk/Source/Core/InstantPresentation.pas 2009-10-11 05:56:00 UTC (rev 874) @@ -25,7 +25,7 @@ * * Contributor(s): * Carlo Barazzetta, Andrea Petrelli, Nando Dessena, Joao Morais, - * Steven Mitchell, Brian Andersen + * Steven Mitchell, Brian Andersen, David Taylor * * ***** END LICENSE BLOCK ***** *) @@ -44,6 +44,11 @@ InstantMetadata, InstantUtils; type +{$IFNDEF D12+} + // Replacement for type added in D2009+ + TRecordBuffer = PChar; +{$ENDIF} + TInstantAddClassFieldDefEvent = procedure (const FieldName : string; var BreakProcess : boolean) of object; TInstantChangeType = (ctAppearance, ctData); TInstantAccessMode = (amObject, amContent); @@ -288,11 +293,7 @@ FContentBuffer: TInstantContentBuffer; FContentChanged: Boolean; FFieldOptions: TInstantFieldOptions; - {$IFDEF D12+} FFilterBuffer: TRecordBuffer; - {$ELSE} - FFilterBuffer: PChar; - {$ENDIF} FInSetFieldData: Boolean; FIsOpen: Boolean; FLimited: Boolean; @@ -352,19 +353,11 @@ procedure InitFields; function IsSelfField(Field: TField): Boolean; procedure ObjectChanged(AObject: TInstantObject); - {$IFDEF D12+} procedure ClearData(Buffer: TRecordBuffer); procedure ClearRecord(Buffer: TRecordBuffer); function GetCurrentBuffer: TRecordBuffer; function GetRecInfo(Buffer: TRecordBuffer): PRecInfo; procedure PutObject(Buffer: TRecordBuffer; AObject: TObject; Append: Boolean); - {$ELSE} - procedure ClearData(Buffer: PChar); - procedure ClearRecord(Buffer: PChar); - function GetCurrentBuffer: PChar; - function GetRecInfo(Buffer: PChar): PRecInfo; - procedure PutObject(Buffer: PChar; AObject: TObject; Append: Boolean); - {$ENDIF} procedure SetContainerName(const Value: string); procedure SetFieldOptions(Value: TInstantFieldOptions); procedure SetLimited(Value: Boolean); @@ -379,15 +372,11 @@ protected { IProviderSupport } procedure PSGetAttributes(List: TList); override; - {$IFDEF D10+} - {$IFNDEF D12+} + {$IFDEF D10_OR_D11} function PSGetTableNameW: WideString; override; - {$ELSE} + {$ELSE} function PSGetTableName: string; override; - {$ENDIF} - {$ELSE} - function PSGetTableName: string; override; - {$ENDIF} + {$ENDIF} procedure PSReset; override; protected procedure AddClassFieldDefs(const FieldName: string; AClass: TClass); overload; @@ -395,7 +384,6 @@ function AddFieldDef(const Prefix: string; PropInfo: PPropInfo): TFieldDef; overload; function AddFieldDef(const FieldName: string; FieldType: TFieldType; FieldSize: Integer; FieldAttribs: TFieldAttributes): TFieldDef; overload; - {$IFDEF D12+} function AddNewObject(Buffer: TRecordBuffer; Append: Boolean): TObject; function AllocRecordBuffer: TRecordBuffer; override; procedure ClearCalcFields(Buffer: TRecordBuffer); override; @@ -407,6 +395,7 @@ procedure InitRecord(Buffer: TRecordBuffer); override; procedure InternalInitRecord(Buffer: TRecordBuffer); override; procedure InternalSetToRecord(Buffer: TRecordBuffer); override; + procedure ConvertToInstantBookmark(Bookmark : TBookmark; var BookmarkOut : TInstantBookmark); procedure SetBookmarkData(Buffer: TRecordBuffer; Data: Pointer); override; procedure SetBookmarkFlag(Buffer: TRecordBuffer; Value: TBookmarkFlag); override; procedure CopyObjectToBuffer(AObject: TObject; Buffer: TRecordBuffer); @@ -415,27 +404,6 @@ function InternalGetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: Boolean): TGetResult; virtual; procedure CopyBufferToObject(Buffer: TRecordBuffer; AObject: TObject); - {$ELSE} - function AddNewObject(Buffer: PChar; Append: Boolean): TObject; - function AllocRecordBuffer: PChar; override; - procedure ClearCalcFields(Buffer: PChar); override; - procedure FreeRecordBuffer(var Buffer: PChar); override; - procedure GetBookmarkData(Buffer: PChar; Data: Pointer); override; - function GetBookmarkFlag(Buffer: PChar): TBookmarkFlag; override; - function GetRecord(Buffer: PChar; GetMode: TGetMode; - DoCheck: Boolean): TGetResult; override; - procedure InitRecord(Buffer: PChar); override; - procedure InternalInitRecord(Buffer: PChar); override; - procedure InternalSetToRecord(Buffer: PChar); override; - procedure SetBookmarkData(Buffer: PChar; Data: Pointer); override; - procedure SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag); override; - procedure CopyObjectToBuffer(AObject: TObject; Buffer: PChar); - function FindObjectBuffer(AObject: TObject): PChar; - procedure LoadRecord(RecNo: Integer; Buffer: PChar); - function InternalGetRecord(Buffer: PChar; GetMode: TGetMode; - DoCheck: Boolean): TGetResult; virtual; - procedure CopyBufferToObject(Buffer: PChar; AObject: TObject); - {$ENDIF} procedure AutoDispose(AObject: TObject); procedure AutoStore(AObject: TObject); function CreateAccessor: TInstantAccessor; virtual; @@ -485,6 +453,7 @@ procedure InternalReleaseObject(AObject: TObject); virtual; function InternalRemoveObject(AObject: TObject): Integer; virtual; procedure InternalReset; virtual; + function IsBlobField(Field: TField): Boolean; function IsCalcField(Field: TField): Boolean; function IsCursorOpen: Boolean; override; function IsNested: Boolean; @@ -514,11 +483,7 @@ property CanDispose: Boolean read GetCanDispose; property ContainerName: string read FContainerName write SetContainerName; property ContentBuffer: TInstantContentBuffer read GetContentBuffer; - {$IFDEF D12+} property CurrentBuffer: TRecordBuffer read GetCurrentBuffer; - {$ELSE} - property CurrentBuffer: PChar read GetCurrentBuffer; - {$ENDIF} property DesignClass: TInstantCodeClass read GetDesignClass; property HasCurrentBuffer: Boolean read GetHasCurrentBuffer; property InContent: Boolean read GetInContent; @@ -2297,13 +2262,8 @@ end; end; -{$IFDEF D12+} function TInstantCustomExposer.AddNewObject(Buffer: TRecordBuffer; Append: Boolean): TObject; -{$ELSE} -function TInstantCustomExposer.AddNewObject(Buffer: PChar; - Append: Boolean): TObject; -{$ENDIF} begin Result := CreateObject; if not (eoDeferInsert in Options) then @@ -2324,17 +2284,10 @@ end; end; -{$IFDEF D12+} function TInstantCustomExposer.AllocRecordBuffer: TRecordBuffer; begin - Result := PByte(AnsiStrAlloc(FRecBufSize)); + Result := InstantAllocMem(FRecBufSize); end; -{$ELSE} -function TInstantCustomExposer.AllocRecordBuffer: PChar; -begin - Result := StrAlloc(FRecBufSize); -end; -{$ENDIF} procedure TInstantCustomExposer.ApplyChanges; begin @@ -2382,12 +2335,7 @@ var BM: TInstantBookmark; begin - {$IFDEF D12+} - { TODO : D2009_PORT } - //BM := TInstantBookmark(Bookmark^); - {$ELSE} - BM := TInstantBookmark(Bookmark^); - {$ENDIF} + ConvertToInstantBookmark(Bookmark,BM); UpdateBookmark(BM); Result := BM.RecNo > 0; end; @@ -2418,29 +2366,17 @@ Refresh; end; -{$IFDEF D12+} procedure TInstantCustomExposer.ClearCalcFields(Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.ClearCalcFields(Buffer: PChar); -{$ENDIF} begin FillChar(Buffer[RecordSize], CalcFieldsSize, 0); end; -{$IFDEF D12+} procedure TInstantCustomExposer.ClearData(Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.ClearData(Buffer: PChar); -{$ENDIF} begin FillChar(Buffer^, RecordSize, 0); end; -{$IFDEF D12+} procedure TInstantCustomExposer.ClearRecord(Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.ClearRecord(Buffer: PChar); -{$ENDIF} begin ClearData(Buffer); with GetRecInfo(Buffer)^ do @@ -2461,14 +2397,8 @@ Result := 0; Exit; end; - {$IFDEF D12+} - { TODO : D2009_PORT } - //BM1 := TInstantBookmark(Bookmark1^); - //BM2 := TInstantBookmark(Bookmark2^); - {$ELSE} - BM1 := TInstantBookmark(Bookmark1^); - BM2 := TInstantBookmark(Bookmark2^); - {$ENDIF} + ConvertToInstantBookmark(Bookmark1,BM1); + ConvertToInstantBookmark(Bookmark2,BM2); UpdateBookmark(BM1); UpdateBookmark(BM2); if BM1.RecNo < BM2.RecNo then @@ -2479,13 +2409,8 @@ Result := 0; end; -{$IFDEF D12+} procedure TInstantCustomExposer.CopyBufferToObject(Buffer: TRecordBuffer; AObject: TObject); -{$ELSE} -procedure TInstantCustomExposer.CopyBufferToObject(Buffer: PChar; - AObject: TObject); -{$ENDIF} var I, Offset: Integer; begin @@ -2495,7 +2420,7 @@ Offset := 0; for I := 0 to Pred(FieldCount) do begin - if not IsCalcField(Fields[I]) then + if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then begin SaveFieldValue(Fields[I], @Buffer[Offset], AObject); Inc(Offset, Fields[I].DataSize); @@ -2503,13 +2428,8 @@ end; end; -{$IFDEF D12+} procedure TInstantCustomExposer.CopyObjectToBuffer(AObject: TObject; Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.CopyObjectToBuffer(AObject: TObject; - Buffer: PChar); -{$ENDIF} var I, Offset: Integer; BM: TInstantBookmark; @@ -2523,7 +2443,7 @@ Offset := 0; for I := 0 to Pred(FieldCount) do begin - if not IsCalcField(Fields[I]) then + if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then begin LoadFieldParams(AObject, Fields[I]); LoadFieldValue(Fields[I], @Buffer[Offset], AObject); @@ -2613,7 +2533,7 @@ begin Result := 0; for I := 0 to Pred(FieldCount) do - if not IsCalcField(Fields[I]) then + if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then Inc(Result, Fields[I].DataSize); end; @@ -2731,11 +2651,7 @@ Result := FindMetadata(ObjectClass); end; -{$IFDEF D12+} function TInstantCustomExposer.FindObjectBuffer(AObject: TObject): TRecordBuffer; -{$ELSE} -function TInstantCustomExposer.FindObjectBuffer(AObject: TObject): PChar; -{$ENDIF} var I: Integer; BM: TInstantBookmark; @@ -2750,19 +2666,11 @@ Result := nil; end; -{$IFDEF D12+} procedure TInstantCustomExposer.FreeRecordBuffer(var Buffer: TRecordBuffer); begin - StrDispose(PAnsiChar(Buffer)); + InstantFreeMem(Buffer); Buffer := nil; end; -{$ELSE} -procedure TInstantCustomExposer.FreeRecordBuffer(var Buffer: PChar); -begin - StrDispose(Buffer); - Buffer := nil; -end; -{$ENDIF} function TInstantCustomExposer.GetAccessor: TInstantAccessor; begin @@ -2776,22 +2684,13 @@ Result := eoAutoApply in Options; end; -{$IFDEF D12+} procedure TInstantCustomExposer.GetBookmarkData(Buffer: TRecordBuffer; Data: Pointer); -{$ELSE} -procedure TInstantCustomExposer.GetBookmarkData(Buffer: PChar; Data: Pointer); -{$ENDIF} begin Move(Buffer[FBookmarkOfs], Data^, BookmarkSize); end; -{$IFDEF D12+} function TInstantCustomExposer.GetBookmarkFlag( Buffer: TRecordBuffer): TBookmarkFlag; -{$ELSE} -function TInstantCustomExposer.GetBookmarkFlag( - Buffer: PChar): TBookmarkFlag; -{$ENDIF} begin Result := GetRecInfo(Buffer).BookmarkFlag; end; @@ -2816,11 +2715,7 @@ Result := FContentBuffer; end; -{$IFDEF D12+} function TInstantCustomExposer.GetCurrentBuffer: TRecordBuffer; -{$ELSE} -function TInstantCustomExposer.GetCurrentBuffer: PChar; -{$ENDIF} begin case State of dsCalcFields: @@ -2884,7 +2779,7 @@ begin Result := 0; for I := 0 to Pred(Field.Index) do - if not IsCalcField(Fields[I]) then + if not (IsBlobField(Fields[I]) or IsCalcField(Fields[I])) then Inc(Result, Fields[I].DataSize); end; end; @@ -3018,11 +2913,7 @@ Result := FOnProgress; end; -{$IFDEF D12+} function TInstantCustomExposer.GetRecInfo(Buffer: TRecordBuffer): PRecInfo; -{$ELSE} -function TInstantCustomExposer.GetRecInfo(Buffer: PChar): PRecInfo; -{$ENDIF} begin Result := PRecInfo(Buffer + FRecInfoOfs); end; @@ -3042,13 +2933,8 @@ Result := FRecordBuffer; end; -{$IFDEF D12+} function TInstantCustomExposer.GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: Boolean): TGetResult; -{$ELSE} -function TInstantCustomExposer.GetRecord(Buffer: PChar; GetMode: TGetMode; - DoCheck: Boolean): TGetResult; -{$ENDIF} var Accept: Boolean; SaveState: TDataSetState; @@ -3296,11 +3182,7 @@ end; end; -{$IFDEF D12+} procedure TInstantCustomExposer.InitRecord(Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.InitRecord(Buffer: PChar); -{$ENDIF} var BM: TInstantBookmark; begin @@ -3398,13 +3280,8 @@ FRecNo := 0; end; -{$IFDEF D12+} function TInstantCustomExposer.InternalGetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: Boolean): TGetResult; -{$ELSE} -function TInstantCustomExposer.InternalGetRecord(Buffer: PChar; - GetMode: TGetMode; DoCheck: Boolean): TGetResult; -{$ENDIF} begin case GetMode of gmNext: @@ -3493,11 +3370,7 @@ SortFieldDefs; end; -{$IFDEF D12+} procedure TInstantCustomExposer.InternalInitRecord(Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.InternalInitRecord(Buffer: PChar); -{$ENDIF} begin end; @@ -3613,15 +3486,17 @@ end; end; -{$IFDEF D12+} procedure TInstantCustomExposer.InternalSetToRecord(Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.InternalSetToRecord(Buffer: PChar); -{$ENDIF} begin InternalGotoBookmark(Buffer + FBookmarkOfs); end; +function TInstantCustomExposer.IsBlobField(Field: TField): Boolean; +begin + Result := Assigned(Field) and + Field.IsBlob; +end; + function TInstantCustomExposer.IsCalcField(Field: TField): Boolean; begin Result := Assigned(Field) and @@ -3719,7 +3594,7 @@ T: TTimeStamp; L: WordBool; begin - if not Assigned(AObject) or IsCalcField(Field) then + if not Assigned(AObject) or IsBlobField(Field) or IsCalcField(Field) then Exit; try if IsSelfField(Field) then @@ -3802,11 +3677,7 @@ end; end; -{$IFDEF D12+} procedure TInstantCustomExposer.LoadRecord(RecNo: Integer; Buffer: TRecordBuffer); -{$ELSE} -procedure TInstantCustomExposer.LoadRecord(RecNo: Integer; Buffer: PChar); -{$ENDIF} var BM: TInstantBookmark; Obj: TObject; @@ -3908,7 +3779,7 @@ procedure TInstantCustomExposer.PostField(Field: TField); begin - if IsCalcField(Field) then + if IsBlobField(Field) or IsCalcField(Field) then Exit; DoBeforePostField(Field); SaveField(Field); @@ -3920,15 +3791,11 @@ begin end; -{$IFDEF D10+} -{$IFNDEF D12+} +{$IFDEF D10_OR_D11} function TInstantCustomExposer.PSGetTableNameW: WideString; {$ELSE} function TInstantCustomExposer.PSGetTableName: string; {$ENDIF} -{$ELSE} -function TInstantCustomExposer.PSGetTableName: string; -{$ENDIF} begin Result := ObjectClassName; end; @@ -3938,13 +3805,8 @@ Reset; end; -{$IFDEF D12+} procedure TInstantCustomExposer.PutObject(Buffer: TRecordBuffer; AObject: TObject; Append: Boolean); -{$ELSE} -procedure TInstantCustomExposer.PutObject(Buffer: PChar; AObject: TObject; - Append: Boolean); -{$ENDIF} var BM: TInstantBookmark; begin @@ -3990,11 +3852,7 @@ function TInstantCustomExposer.RefreshObjectBuffer(AObject: TObject): Boolean; var - {$IFDEF D12+} Buffer: TRecordBuffer; - {$ELSE} - Buffer: PChar; - {$ENDIF} Editing: Boolean; begin if not Active then @@ -4136,7 +3994,7 @@ L: WordBool; Value: Variant; begin - if not Assigned(AObject) or IsSelfField(Field) or IsCalcField(Field) then + if not Assigned(AObject) or IsSelfField(Field) or IsBlobField(Field) or IsCalcField(Field) then Exit; case Field.DataType of ftString: @@ -4214,24 +4072,31 @@ inherited; end; +procedure TInstantCustomExposer.ConvertToInstantBookmark(Bookmark : TBookmark; + var BookmarkOut : TInstantBookmark); +begin {$IFDEF D12+} -procedure TInstantCustomExposer.SetBookmarkData(Buffer: TRecordBuffer; - Data: Pointer); + // TBookmark is a dynamic byte array for D2009+ + if (Length(Bookmark) = sizeof(TBookmark)) then + Move(Bookmark[0], BookmarkOut, sizeof(BookmarkOut)) + else + fillchar(BookmarkOut, sizeof(BookmarkOut), 0); {$ELSE} -procedure TInstantCustomExposer.SetBookmarkData(Buffer: PChar; - Data: Pointer); + if (Assigned(Bookmark)) then + BookmarkOut := TInstantBookmark(Bookmark^) + else + fillchar(BookmarkOut, sizeof(BookmarkOut), 0); {$ENDIF} +end; + +procedure TInstantCustomExposer.SetBookmarkData(Buffer: TRecordBuffer; + Data: Pointer); begin Move(Data^, Buffer[FBookmarkOfs], BookmarkSize); end; -{$IFDEF D12+} procedure TInstantCustomExposer.SetBookmarkFlag(Buffer: TRecordBuffer; Value: TBookmarkFlag); -{$ELSE} -procedure TInstantCustomExposer.SetBookmarkFlag(Buffer: PChar; - Value: TBookmarkFlag); -{$ENDIF} begin GetRecInfo(Buffer)^.BookmarkFlag := Value; end; Modified: trunk/Source/Core/InstantUtils.pas =================================================================== --- trunk/Source/Core/InstantUtils.pas 2009-10-11 05:34:05 UTC (rev 873) +++ trunk/Source/Core/InstantUtils.pas 2009-10-11 05:56:00 UTC (rev 874) @@ -50,6 +50,8 @@ Major, Minor, Release, Build: Word; end; +function InstantAllocMem(Size: Cardinal): Pointer; +procedure InstantFreeMem(P: Pointer); function InstantCompareObjects(Obj1, Obj2: TObject; PropName: string; Options: TInstantCompareOptions): Integer; overload; function InstantCompareObjects(Obj1, Obj2: TObject; PropNames: TStrings; @@ -108,6 +110,90 @@ {$ENDIF} {$IFDEF D6+}Variants,{$ENDIF} InstantConsts, InstantRtti; + +{$IFDEF IO_MEM_OVERRUN_CHECK} +const + IO_MEM_SIGNATURE = Longint($BCFEEFCB); + +type + PInstantAllocGuard = ^TInstantAllocGuard; + TInstantAllocGuard = packed array[0..3] of Longint; + + PInstantAllocHeader = ^TInstantAllocHeader; + TInstantAllocHeader = packed record + Signature : Longint; + GuardPtr : PInstantAllocGuard; + UserData : record end; + end; + +function InstantAllocMem(Size: Cardinal): Pointer; +var + Header: PInstantAllocHeader; + GuardPtr: PAnsiChar; + I: integer; +begin + if (Size > 0) then + begin + // Pad the allocation block with a header and guard area + Header := AllocMem(sizeof(TInstantAllocHeader) + Size + sizeof(TInstantAllocGuard)); + Result := @Header.UserData; + + // Initialize the block header signature and guard pointer + Header.Signature := IO_MEM_SIGNATURE; + GuardPtr := PAnsiChar(@Header.UserData); + inc(GuardPtr,Size); + Header.GuardPtr := PInstantAllocGuard(GuardPtr); + + // Initialize the guard area with a known signature + for I := low(Header.GuardPtr^) to high(Header.GuardPtr^) do + Header.GuardPtr^[I] := IO_MEM_SIGNATURE; + end else + begin + Result := nil; + end; +end; + +procedure InstantFreeMem(P: Pointer); +var + BlockPtr: PAnsiChar; + Header: PInstantAllocHeader; + I: integer; +begin + if Assigned(P) then + begin + BlockPtr := PAnsiChar(P); + dec(BlockPtr, sizeof(TInstantAllocHeader)); + Header := PInstantAllocHeader(BlockPtr); + + // Ensure the header signature is intact + if (Header.Signature <> IO_MEM_SIGNATURE) then + raise EInvalidPointer.Create('InstantFreeMem - header signature is invalid'); + + // Ensure the guard pointer is not null + if (Header.GuardPtr = nil) then + raise EInvalidPointer.Create('InstantFreeMem - header guard pointer is invalid'); + + // Ensure the block guard area has not been modified + for I := low(Header.GuardPtr^) to high(Header.GuardPtr^) do + if (Header.GuardPtr^[I] <> IO_MEM_SIGNATURE) then + raise EInvalidPointer.Create('InstantFreeMem - memory overrun corruption detected'); + + FreeMem(BlockPtr); + end; +end; +{$ELSE} // IO_MEM_OVERRUN_CHECK disabled + +function InstantAllocMem(Size: Cardinal): Pointer; +begin + Result := AllocMem(Size); +end; + +procedure InstantFreeMem(P: Pointer); +begin + FreeMem(P); +end; +{$ENDIF} + function InstantCompareObjects(Obj1, Obj2: TObject; PropName: string; Options: TInstantCompareOptions): Integer; var Modified: trunk/Source/InstantDefines.inc =================================================================== --- trunk/Source/InstantDefines.inc 2009-10-11 05:34:05 UTC (rev 873) +++ trunk/Source/InstantDefines.inc 2009-10-11 05:56:00 UTC (rev 874) @@ -32,6 +32,7 @@ {$DEFINE D9+} {$DEFINE D10} {$DEFINE D10+} + {$DEFINE D10_OR_D11} {$ENDIF} {$IFDEF VER185} @@ -40,6 +41,7 @@ {$DEFINE D7+} {$DEFINE D9+} {$DEFINE D10+} + {$DEFINE D10_OR_D11} {$DEFINE D11} {$DEFINE D11+} {$ENDIF} @@ -150,7 +152,22 @@ {$WARN UNSAFE_CAST OFF} {$ENDIF} +// "inline" keyword is available for D2005+ +{$IFDEF D9+} + {$DEFINE SUPPORTS_INLINE} +{$ENDIF} + { + Define this symbol to cause InstantAllocMem and InstantFreeMem to pad + allocated memory blocks with a guard area to detect buffer overruns. + When this define is enabled. InstantFreeMem will check if the signature + in the guard area has been changed and will raise an exception indicating + memory corruption has occured. This was implemented to aid in identification + of issues in the record buffer management in the InstantPresentation unit. +} +{.$DEFINE IO_MEM_OVERRUN_CHECK} + +{ Define this symbol to enable logging of all SQL statements to the debug console (via OutputDebugString - only on Windows) and to the procedure pointed by the InstantBrokers.InstantLogProc global variable. |
From: <dav...@us...> - 2009-10-11 05:34:14
|
Revision: 873 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=873&view=rev Author: davidvtaylor Date: 2009-10-11 05:34:05 +0000 (Sun, 11 Oct 2009) Log Message: ----------- + Add CorePackages project group for Delphi 2010 Added Paths: ----------- trunk/Source/PackageGroups/D2010/CorePackages.groupproj Added: trunk/Source/PackageGroups/D2010/CorePackages.groupproj =================================================================== --- trunk/Source/PackageGroups/D2010/CorePackages.groupproj (rev 0) +++ trunk/Source/PackageGroups/D2010/CorePackages.groupproj 2009-10-11 05:34:05 UTC (rev 873) @@ -0,0 +1,108 @@ + <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectGuid>{BF17374A-C537-4CFB-A0D4-41C4565CB15A}</ProjectGuid> + </PropertyGroup> + <ItemGroup> + <Projects Include="..\..\Core\D2010\IOCore.dproj"> + <Dependencies/> + </Projects> + <Projects Include="..\..\Design\D2010\DclIOCore.dproj"> + <Dependencies/> + </Projects> + <Projects Include="..\..\Brokers\BDE\D2010\IOBDE.dproj"> + <Dependencies/> + </Projects> + <Projects Include="..\..\Brokers\BDE\D2010\DclIOBDE.dproj"> + <Dependencies/> + </Projects> + <Projects Include="..\..\Brokers\XML\D2010\IOXML.dproj"> + <Dependencies/> + </Projects> + <Projects Include="..\..\Brokers\XML\D2010\DclIOXML.dproj"> + <Dependencies/> + </Projects> + <Projects Include="..\..\..\Tests\TestIO_D2009.dproj"> + <Dependencies/> + </Projects> + </ItemGroup> + <ProjectExtensions> + <Borland.Personality>Default.Personality.12</Borland.Personality> + <Borland.ProjectType/> + <BorlandProject> + <Default.Personality/> + </BorlandProject> + </ProjectExtensions> + <Target Name="IOCore"> + <MSBuild Projects="..\..\Core\D2010\IOCore.dproj"/> + </Target> + <Target Name="IOCore:Clean"> + <MSBuild Targets="Clean" Projects="..\..\Core\D2010\IOCore.dproj"/> + </Target> + <Target Name="IOCore:Make"> + <MSBuild Targets="Make" Projects="..\..\Core\D2010\IOCore.dproj"/> + </Target> + <Target Name="DclIOCore"> + <MSBuild Projects="..\..\Design\D2010\DclIOCore.dproj"/> + </Target> + <Target Name="DclIOCore:Clean"> + <MSBuild Targets="Clean" Projects="..\..\Design\D2010\DclIOCore.dproj"/> + </Target> + <Target Name="DclIOCore:Make"> + <MSBuild Targets="Make" Projects="..\..\Design\D2010\DclIOCore.dproj"/> + </Target> + <Target Name="IOBDE"> + <MSBuild Projects="..\..\Brokers\BDE\D2010\IOBDE.dproj"/> + </Target> + <Target Name="IOBDE:Clean"> + <MSBuild Targets="Clean" Projects="..\..\Brokers\BDE\D2010\IOBDE.dproj"/> + </Target> + <Target Name="IOBDE:Make"> + <MSBuild Targets="Make" Projects="..\..\Brokers\BDE\D2010\IOBDE.dproj"/> + </Target> + <Target Name="DclIOBDE"> + <MSBuild Projects="..\..\Brokers\BDE\D2010\DclIOBDE.dproj"/> + </Target> + <Target Name="DclIOBDE:Clean"> + <MSBuild Targets="Clean" Projects="..\..\Brokers\BDE\D2010\DclIOBDE.dproj"/> + </Target> + <Target Name="DclIOBDE:Make"> + <MSBuild Targets="Make" Projects="..\..\Brokers\BDE\D2010\DclIOBDE.dproj"/> + </Target> + <Target Name="IOXML"> + <MSBuild Projects="..\..\Brokers\XML\D2010\IOXML.dproj"/> + </Target> + <Target Name="IOXML:Clean"> + <MSBuild Targets="Clean" Projects="..\..\Brokers\XML\D2010\IOXML.dproj"/> + </Target> + <Target Name="IOXML:Make"> + <MSBuild Targets="Make" Projects="..\..\Brokers\XML\D2010\IOXML.dproj"/> + </Target> + <Target Name="DclIOXML"> + <MSBuild Projects="..\..\Brokers\XML\D2010\DclIOXML.dproj"/> + </Target> + <Target Name="DclIOXML:Clean"> + <MSBuild Targets="Clean" Projects="..\..\Brokers\XML\D2010\DclIOXML.dproj"/> + </Target> + <Target Name="DclIOXML:Make"> + <MSBuild Targets="Make" Projects="..\..\Brokers\XML\D2010\DclIOXML.dproj"/> + </Target> + <Target Name="TestIO_D2009"> + <MSBuild Projects="..\..\..\Tests\TestIO_D2009.dproj"/> + </Target> + <Target Name="TestIO_D2009:Clean"> + <MSBuild Targets="Clean" Projects="..\..\..\Tests\TestIO_D2009.dproj"/> + </Target> + <Target Name="TestIO_D2009:Make"> + <MSBuild Targets="Make" Projects="..\..\..\Tests\TestIO_D2009.dproj"/> + </Target> + <Target Name="Build"> + <CallTarget Targets="IOCore;DclIOCore;IOBDE;DclIOBDE;IOXML;DclIOXML;TestIO_D2009"/> + </Target> + <Target Name="Clean"> + <CallTarget Targets="IOCore:Clean;DclIOCore:Clean;IOBDE:Clean;DclIOBDE:Clean;IOXML:Clean;DclIOXML:Clean;TestIO_D2009:Clean"/> + </Target> + <Target Name="Make"> + <CallTarget Targets="IOCore:Make;DclIOCore:Make;IOBDE:Make;DclIOBDE:Make;IOXML:Make;DclIOXML:Make;TestIO_D2009:Make"/> + </Target> + <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/> + </Project> Property changes on: trunk/Source/PackageGroups/D2010/CorePackages.groupproj ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native |
From: <dav...@us...> - 2009-10-11 05:30:46
|
Revision: 872 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=872&view=rev Author: davidvtaylor Date: 2009-10-11 05:30:38 +0000 (Sun, 11 Oct 2009) Log Message: ----------- * Update AnyDAC broker to support RemObjects Fall 2009 release * Change usage of Connected property to Open and Close to address Delphi 7 compiler bug * Add _D14 suffix to AnyDAC package references * Changes tested with D7, D2007, D2009 and D2010 Modified Paths: -------------- trunk/Source/Brokers/AnyDAC/D2010/DclIOAnyDAC.dproj trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dpk trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dproj trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas trunk/Source/Brokers/AnyDAC/InstantAnyDACCatalog.pas Modified: trunk/Source/Brokers/AnyDAC/D2010/DclIOAnyDAC.dproj =================================================================== --- trunk/Source/Brokers/AnyDAC/D2010/DclIOAnyDAC.dproj 2009-09-04 01:42:48 UTC (rev 871) +++ trunk/Source/Brokers/AnyDAC/D2010/DclIOAnyDAC.dproj 2009-10-11 05:30:38 UTC (rev 872) @@ -1,6 +1,6 @@ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> - <ProjectGuid>{A2BC22CD-E13F-451F-B150-873A254827A7}</ProjectGuid> + <ProjectGuid>{059CEAC8-4093-4818-83AE-1FC4E6F35177}</ProjectGuid> <MainSource>DclIOAnyDAC.dpk</MainSource> <Config Condition="'$(Config)'==''">Debug</Config> <DCC_DCCCompiler>DCC32</DCC_DCCCompiler> Modified: trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dpk =================================================================== --- trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dpk 2009-09-04 01:42:48 UTC (rev 871) +++ trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dpk 2009-10-11 05:30:38 UTC (rev 872) @@ -30,9 +30,9 @@ requires IOCore, xmlrtl, - AnyDAC_Phys, - AnyDAC_ComI, - AnyDAC_Comp; + AnyDAC_Phys_D14, + AnyDAC_ComI_D14, + AnyDAC_Comp_D14; contains InstantAnyDAC in '..\InstantAnyDAC.pas', Modified: trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dproj =================================================================== --- trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dproj 2009-09-04 01:42:48 UTC (rev 871) +++ trunk/Source/Brokers/AnyDAC/D2010/IOAnyDAC.dproj 2009-10-11 05:30:38 UTC (rev 872) @@ -1,6 +1,6 @@ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> - <ProjectGuid>{B2FCAE40-1DA4-401B-878A-1D0C9AB45191}</ProjectGuid> + <ProjectGuid>{CD800962-5B25-4949-8D83-1261EE4A4203}</ProjectGuid> <MainSource>IOAnyDAC.dpk</MainSource> <Config Condition="'$(Config)'==''">Debug</Config> <DCC_DCCCompiler>DCC32</DCC_DCCCompiler> @@ -48,9 +48,9 @@ </DelphiCompile> <DCCReference Include="IOCore.dcp"/> <DCCReference Include="xmlrtl.dcp"/> - <DCCReference Include="AnyDAC_Phys.dcp"/> - <DCCReference Include="AnyDAC_ComI.dcp"/> - <DCCReference Include="AnyDAC_Comp.dcp"/> + <DCCReference Include="AnyDAC_Phys_D14.dcp"/> + <DCCReference Include="AnyDAC_ComI_D14.dcp"/> + <DCCReference Include="AnyDAC_Comp_D14.dcp"/> <DCCReference Include="..\InstantAnyDAC.pas"/> <DCCReference Include="..\InstantAnyDACCatalog.pas"/> <DCCReference Include="..\InstantAnyDACConnectionDefEdit.pas"> Modified: trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas =================================================================== --- trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas 2009-09-04 01:42:48 UTC (rev 871) +++ trunk/Source/Brokers/AnyDAC/InstantAnyDAC.pas 2009-10-11 05:30:38 UTC (rev 872) @@ -430,7 +430,7 @@ begin if (HasConnection) then begin - FConnection.Connected := False; + FConnection.Close; FConnection.TxOptions.AutoCommit := true; FConnection.TxOptions.Isolation := xiReadCommitted; FConnection.OnLogin := DoLogin; @@ -558,9 +558,9 @@ begin AssignLoginOptions; try - Connection.Connected := True; + Connection.Open; Result := True; - Connection.Connected := False; + Connection.Close; except // TODO Fixup database detection logic for AnyDAC - Exception approach may not work well // on E : EZSQLException do @@ -607,7 +607,7 @@ procedure TInstantAnyDACConnector.InternalConnect; begin CheckConnection; - FConnection.Connected := true; + FConnection.Open; end; procedure TInstantAnyDACConnector.InternalCreateDatabase; @@ -620,7 +620,7 @@ procedure TInstantAnyDACConnector.InternalDisconnect; begin if (HasConnection) then - FConnection.Connected := false; + FConnection.Close; end; procedure TInstantAnyDACConnector.InternalRollbackTransaction; Modified: trunk/Source/Brokers/AnyDAC/InstantAnyDACCatalog.pas =================================================================== --- trunk/Source/Brokers/AnyDAC/InstantAnyDACCatalog.pas 2009-09-04 01:42:48 UTC (rev 871) +++ trunk/Source/Brokers/AnyDAC/InstantAnyDACCatalog.pas 2009-10-11 05:30:38 UTC (rev 872) @@ -230,7 +230,7 @@ with Connector.Connection do begin if not Connected then - Connected := true; + Open; RefreshMetadataCache; GetTableNames('','','',Tables,[osMy],[tkTable]); end; |
From: <dav...@us...> - 2009-09-04 01:43:10
|
Revision: 871 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=871&view=rev Author: davidvtaylor Date: 2009-09-04 01:42:48 +0000 (Fri, 04 Sep 2009) Log Message: ----------- * Changed the new Bytes property of TInstantBlob from published to public for D5 compatibility Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2009-09-03 09:13:11 UTC (rev 870) +++ trunk/Source/Core/InstantPersistence.pas 2009-09-04 01:42:48 UTC (rev 871) @@ -472,9 +472,9 @@ procedure Reset; override; procedure SaveDataToStream(AStream: TStream); function WriteBuffer(const Buffer; Position, Count: Integer): Integer; + property Bytes: TInstantBytes read GetBytes write SetBytes; property Size: Integer read GetSize; published - property Bytes: TInstantBytes read GetBytes write SetBytes; property Value: string read GetValue write SetValue; end; |
From: <dav...@us...> - 2009-09-03 09:13:22
|
Revision: 870 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=870&view=rev Author: davidvtaylor Date: 2009-09-03 09:13:11 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Fix for problem inserting and updating Blob attributes + Added new type TInstantBytes to mirror the new TBytes type in D12+ + Added Bytes property to TInstantBlob to provide access to raw stream data as a byte array * Modified AddBlobAttributeParam to properly handle data assignment for D12+ Modified Paths: -------------- trunk/Source/Core/InstantBrokers.pas trunk/Source/Core/InstantPersistence.pas trunk/Source/Core/InstantTypes.pas Modified: trunk/Source/Core/InstantBrokers.pas =================================================================== --- trunk/Source/Core/InstantBrokers.pas 2009-08-29 07:57:59 UTC (rev 869) +++ trunk/Source/Core/InstantBrokers.pas 2009-09-03 09:13:11 UTC (rev 870) @@ -2831,7 +2831,11 @@ if Attribute.IsNull then LParam.Clear else - LParam.AsMemo := (Attribute as TInstantBlob).Value; + {$IFDEF D12+} + LParam.AsBytes := (Attribute as TInstantBlob).Bytes; + {$ELSE} + LParam.AsBlob := (Attribute as TInstantBlob).Value; + {$ENDIF} end; procedure AddBooleanAttributeParam; Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2009-08-29 07:57:59 UTC (rev 869) +++ trunk/Source/Core/InstantPersistence.pas 2009-09-03 09:13:11 UTC (rev 870) @@ -446,6 +446,8 @@ function GetStream: TMemoryStream; property Stream: TMemoryStream read GetStream; protected + function GetBytes: TInstantBytes; + procedure SetBytes(const AValue: TInstantBytes); function GetValue: string; virtual; procedure SetValue(const AValue: string); virtual; class function AttributeType: TInstantAttributeType; override; @@ -472,6 +474,7 @@ function WriteBuffer(const Buffer; Position, Count: Integer): Integer; property Size: Integer read GetSize; published + property Bytes: TInstantBytes read GetBytes write SetBytes; property Value: string read GetValue write SetValue; end; @@ -3458,6 +3461,13 @@ Result := Value; end; +function TInstantBlob.GetBytes: TInstantBytes; +begin + SetLength(Result, Size); + if Size > 0 then + Read(Result[0], 0, Size); +end; + function TInstantBlob.GetSize: Integer; begin Result := Stream.Size; @@ -3556,6 +3566,21 @@ end; end; +procedure TInstantBlob.SetBytes(const AValue: TInstantBytes); +var + L: Integer; +begin + L := length(AValue); + if L > 0 then + begin + Stream.Clear; + WriteBuffer(AValue[0], 0, L); + Stream.Size := L; + end + else + Clear; +end; + procedure TInstantBlob.SetValue(const AValue: string); var L: Integer; Modified: trunk/Source/Core/InstantTypes.pas =================================================================== --- trunk/Source/Core/InstantTypes.pas 2009-08-29 07:57:59 UTC (rev 869) +++ trunk/Source/Core/InstantTypes.pas 2009-09-03 09:13:11 UTC (rev 870) @@ -40,6 +40,11 @@ interface +{$IFDEF D12+} +uses + Sysutils; // TBytes +{$ENDIF} + type {$IFNDEF D6+} IInterface = interface (IUnknown) @@ -89,6 +94,12 @@ TTime = type TDateTime; TDate = type TDateTime; + {$IFDEF D12+} + TInstantBytes = TBytes; + {$ELSE} + TInstantBytes = array of Byte; + {$ENDIF} + implementation end. |
From: <na...@us...> - 2009-08-29 07:58:11
|
Revision: 869 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=869&view=rev Author: nandod Date: 2009-08-29 07:57:59 +0000 (Sat, 29 Aug 2009) Log Message: ----------- * Fixed regression: XML object output was not encoding entities such as " correctly. TestIO updated. Modified Paths: -------------- trunk/Source/Core/InstantClasses.pas trunk/Tests/TestXMLBroker.pas Modified: trunk/Source/Core/InstantClasses.pas =================================================================== --- trunk/Source/Core/InstantClasses.pas 2009-08-28 07:36:34 UTC (rev 868) +++ trunk/Source/Core/InstantClasses.pas 2009-08-29 07:57:59 UTC (rev 869) @@ -1470,7 +1470,7 @@ Esc := 'gt'; end; Esc := Format(EscStr, [Esc]); - LString := LString + EscStr; + LString := LString + Esc; end else LString := LString + C; Modified: trunk/Tests/TestXMLBroker.pas =================================================================== --- trunk/Tests/TestXMLBroker.pas 2009-08-28 07:36:34 UTC (rev 868) +++ trunk/Tests/TestXMLBroker.pas 2009-08-29 07:57:59 UTC (rev 869) @@ -164,7 +164,7 @@ procedure TTestXMLBroker.TestStoreAndRetrieveContact; const - DEF_NAME = 'Mike Art\xF9'; + DEF_NAME = 'Mike "Art\xF9"'; DEF_CITY = 'Milan (\x80)'; var c: TContact; @@ -196,8 +196,8 @@ try AssertNotNull('Object not retrieved', c); AssertEquals(old_id, c.Id); - AssertEquals(c.Name, DEF_NAME); - AssertEquals(c.Address.City, DEF_CITY); + AssertEquals(DEF_NAME, c.Name); + AssertEquals(DEF_CITY, c.Address.City); AssertNotNull(c.Address); AssertEquals(2, c.PhoneCount); finally |