mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 01:04:50 +01:00 
			
		
		
		
	lazutils: replaced TPASObjectWriter with TCompWriterPas
git-svn-id: trunk@56208 -
This commit is contained in:
		
							parent
							
								
									f7c4861200
								
							
						
					
					
						commit
						acd77c3bb0
					
				| @ -754,6 +754,8 @@ type | ||||
|                        const ClassContext, AncestorClassContext: TFindContext; | ||||
|                        {%H-}LFMNode: TLFMTreeNode; | ||||
|                        const IdentName: string; var IsDefined: boolean); | ||||
|     function UpdateComponentInit(Code: TCodeBuffer; const aClassName, | ||||
|           AccessClass, StartSignature, EndSignature, InitSrc: string): boolean; | ||||
| 
 | ||||
|     // register proc | ||||
|     function HasInterfaceRegisterProc(Code: TCodeBuffer; | ||||
| @ -5383,6 +5385,23 @@ begin | ||||
|   end; | ||||
| end; | ||||
| 
 | ||||
| function TCodeToolManager.UpdateComponentInit(Code: TCodeBuffer; | ||||
|   const aClassName, AccessClass, StartSignature, EndSignature, InitSrc: string | ||||
|   ): boolean; | ||||
| begin | ||||
|   Result:=false; | ||||
|   {$IFDEF CTDEBUG} | ||||
|   DebugLn(['TCodeToolManager.UpdateComponentInit A ',Code.Filename,' Class="'+aClassName+'" AccessClass="'+AccessClass+'" StartSignature="'+StartSignature+'" EndSignature="'+EndSignature+'" InitSrc={'+InitSrc+'}']); | ||||
|   {$ENDIF} | ||||
|   if not InitCurCodeTool(Code) then exit; | ||||
|   try | ||||
|     Result:=FCurCodeTool.UpdateComponentInit(aClassName,AccessClass, | ||||
|       StartSignature,EndSignature,InitSrc,SourceChangeCache); | ||||
|   except | ||||
|     on e: Exception do Result:=HandleException(e); | ||||
|   end; | ||||
| end; | ||||
| 
 | ||||
| function TCodeToolManager.FindCreateFormStatement(Code: TCodeBuffer; | ||||
|   StartPos: integer; | ||||
|   const AClassName, AVarName: string; | ||||
|  | ||||
| @ -124,6 +124,10 @@ type | ||||
|       const WithExpr: string; // if empty: collect Candidates | ||||
|       Candidates: TStrings; SourceChangeCache: TSourceChangeCache): boolean; | ||||
| 
 | ||||
|     function UpdateComponentInit(const aClassName, AccessClass, | ||||
|          StartSignature, EndSignature, InitSrc: string; | ||||
|          SourceChangeCache: TSourceChangeCache): boolean; | ||||
| 
 | ||||
|     procedure CalcMemSize(Stats: TCTMemStats); override; | ||||
|   end; | ||||
|    | ||||
| @ -1696,6 +1700,35 @@ begin | ||||
|   Result:=true; | ||||
| end; | ||||
| 
 | ||||
| function TExtractProcTool.UpdateComponentInit(const aClassName, AccessClass, | ||||
|   StartSignature, EndSignature, InitSrc: string; | ||||
|   SourceChangeCache: TSourceChangeCache): boolean; | ||||
| 
 | ||||
|   procedure E(TheID: int64; Msg: string); | ||||
|   begin | ||||
|     raise ECodeToolError.Create(Self,TheID,'TExtractProcTool.UpdateComponentInit: '+Msg); | ||||
|   end; | ||||
| 
 | ||||
| begin | ||||
|   Result:=false; | ||||
|   {$IFDEF VerbosePasStream} | ||||
|   debugln(['TExtractProcTool.UpdateComponentInit START ',MainFilename,' aClassName="'+aClassName+'" AccessClass="'+AccessClass+'" StartSignature={'+DbgStr(StartSignature)+'} EndSignature={'+dbgstr(EndSignature)+'} InitSrc={'+InitSrc+'}']); | ||||
|   {$ENDIF} | ||||
|   if aClassName='' then | ||||
|     E(20171025224428,'missing aClassName'); | ||||
|   if not IsValidIdent(aClassName) then | ||||
|     E(20171025224540,'invalid aClassName "'+aClassName+'"'); | ||||
|   if (AccessClass<>'') and not IsValidIdent(AccessClass) then | ||||
|     E(20171025224607,'invalid AccessClass "'+AccessClass+'"'); | ||||
|   if StartSignature='' then | ||||
|     E(20171025224636,'missing StartSignature'); | ||||
|   if EndSignature='' then | ||||
|     E(20171025224647,'missing EndSignature'); | ||||
| 
 | ||||
|   // find class | ||||
|   // ToDo | ||||
| end; | ||||
| 
 | ||||
| procedure TExtractProcTool.CalcMemSize(Stats: TCTMemStats); | ||||
| begin | ||||
|   inherited CalcMemSize(Stats); | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -6,7 +6,7 @@ uses | ||||
|   {$IFDEF UNIX}{$IFDEF UseCThreads} | ||||
|   cthreads, | ||||
|   {$ENDIF}{$ENDIF} | ||||
|   Classes, XMLStreaming, Unit1; | ||||
|   Classes, Unit1; | ||||
| 
 | ||||
| begin | ||||
|   StreamAsPasForm:=TStreamAsPasForm.Create(nil); | ||||
|  | ||||
| @ -5,7 +5,7 @@ unit Unit1; | ||||
| interface | ||||
| 
 | ||||
| uses | ||||
|   Classes, SysUtils, LCLProc, typinfo, CompWriterPas; | ||||
|   Classes, SysUtils, typinfo, CompWriterPas, LazLogger; | ||||
| 
 | ||||
| type | ||||
|   TMyEnum = (myEnum1, myEnum2, myEnum3); | ||||
| @ -199,7 +199,7 @@ begin | ||||
|     SetLength(s,ms.Size); | ||||
|     if s<>'' then | ||||
|       ms.Read(s[1],length(s)); | ||||
|     debugln(['TStreamAsPasForm.WriteComponents ',s]); | ||||
|     DebugLn(['TStreamAsPasForm.WriteComponents ',s]); | ||||
|   finally | ||||
|     ms.Free; | ||||
|   end; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 mattias
						mattias