diff --git a/wst/trunk/base_service_intf.pas b/wst/trunk/base_service_intf.pas index 051a5c97a..f054b8d64 100644 --- a/wst/trunk/base_service_intf.pas +++ b/wst/trunk/base_service_intf.pas @@ -1425,7 +1425,8 @@ const FIELDS_STRING = '__FIELDS__'; function GetTypeRegistry():TTypeRegistry;{$IFDEF USE_INLINE}inline;{$ENDIF} - procedure RegisterStdTypes(); + procedure RegisterStdTypes();overload;{$IFDEF USE_INLINE}inline;{$ENDIF} + procedure RegisterStdTypes(ARegistry : TTypeRegistry);overload; procedure RegisterAttributeProperty( const ATypeInfo : PTypeInfo; // must be tkClass or tkRecord const AProperty : shortstring @@ -1466,11 +1467,16 @@ begin end; procedure RegisterStdTypes(); +begin + RegisterStdTypes(GetTypeRegistry()); +end; + +procedure RegisterStdTypes(ARegistry : TTypeRegistry); Var r : TTypeRegistry; ri : TTypeRegistryItem; begin - r := GetTypeRegistry(); + r := ARegistry; r.Register(sXSD_NS,TypeInfo(Integer),'int').AddPascalSynonym('Integer'); r.Register(sXSD_NS,TypeInfo(LongWord),'unsignedInt'); r.Register(sXSD_NS,TypeInfo(positiveInteger),'positiveInteger'); @@ -2947,22 +2953,20 @@ Var begin Result := Nil; i := IndexOf(ATypeInfo); - If ( i > -1 ) Then + if ( i > -1 ) then begin Result := Item[i] - Else If ( Not AExact ) And - Assigned(ATypeInfo) And - ( ATypeInfo^.Kind = tkClass ) - Then Begin + end else if ( not AExact ) and Assigned(ATypeInfo) and ( ATypeInfo^.Kind = tkClass ) then begin searchClass := GetTypeData(ATypeInfo)^.ClassType; - For i := 0 To Pred(Count) Do Begin + for i := Pred(Count) downto 0 do begin Result := Item[i]; - If ( Result.DataType^.Kind = tkClass ) And + if ( Result.DataType^.Kind = tkClass ) and searchClass.InheritsFrom(GetTypeData(Result.DataType)^.ClassType) - Then + then begin Exit; - End; + end; + end; Result := Nil; - End; + end; end; function TTypeRegistry.Find(const APascalTypeName: string): TTypeRegistryItem; diff --git a/wst/trunk/config_objects.pas b/wst/trunk/config_objects.pas index a2d6f822c..6a0e35213 100644 --- a/wst/trunk/config_objects.pas +++ b/wst/trunk/config_objects.pas @@ -68,6 +68,8 @@ type function wst_GetConfigObject() : TWstConfigurationObject; function wst_GetServiceConfig(const AName : string) : TwstConfigService ; function wst_GetServiceConfigText(const AName : string) : string ; + procedure wst_CreateDefaultFile();overload; + procedure wst_CreateDefaultFile(const AFileName : string);overload; procedure wst_CreateDefaultFile(ADest : TStream; AConfigObj : TWstConfigurationObject);overload; procedure wst_CreateDefaultFile(const AFileName : string; AConfigObj : TWstConfigurationObject);overload; @@ -99,7 +101,11 @@ end; function wst_GetConfigFileName():string; begin +{$IFDEF WINDOWS} + Result := ChangeFileExt(ParamStr(0),'.' + sCONFIG_FILE_NAME); +{$ELSE} Result := ChangeFileExt(GetAppConfigFile(False,True),'.' + sCONFIG_FILE_NAME); +{$ENDIF WINDOWS} end; procedure wst_LoadConfigObject(AConfig: TWstConfigurationObject; AStream : TStream);overload; @@ -152,6 +158,16 @@ begin end; end; +procedure wst_CreateDefaultFile(); +begin + wst_CreateDefaultFile(wst_GetConfigFileName()); +end; + +procedure wst_CreateDefaultFile(const AFileName : string); +begin + wst_CreateDefaultFile(AFileName,nil); +end; + procedure wst_CreateDefaultFile(ADest : TStream; AConfigObj : TWstConfigurationObject);overload; var locObj : TWstConfigurationObject; diff --git a/wst/trunk/object_serializer.pas b/wst/trunk/object_serializer.pas index e936c585f..a94781333 100644 --- a/wst/trunk/object_serializer.pas +++ b/wst/trunk/object_serializer.pas @@ -109,7 +109,7 @@ type ADataType : PTypeInfo; Const ADeclaredName : string = '' );override; - destructor Destroy(); + destructor Destroy();override; function GetSerializer() : TObjectSerializer;{$IFDEF USE_INLINE}inline;{$ENDIF} end; diff --git a/wst/trunk/ws_helper/source_utils.pas b/wst/trunk/ws_helper/source_utils.pas index d61a61ac1..901df14cd 100644 --- a/wst/trunk/ws_helper/source_utils.pas +++ b/wst/trunk/ws_helper/source_utils.pas @@ -66,7 +66,6 @@ Type ISavableSourceStream = Interface(ISourceStream) ['{B5F03006-FD33-4DA8-A2E7-168BDABE8832}'] procedure SaveToStream(AStream : TStream); - procedure SaveToFile(const APath : string); function GetStream(): TStream; end;