OSDN Git Service

・EnumThread をプログラム本体に任せるようになった。
authoryoffy <yoffy>
Sat, 15 Nov 2003 17:51:23 +0000 (17:51 +0000)
committeryoffy <yoffy>
Sat, 15 Nov 2003 17:51:23 +0000 (17:51 +0000)
res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr
res/ExternalBoardPlugIn/ShitarabaPlugIn.dpr

index 4b2d821..29f12f0 100644 (file)
@@ -77,7 +77,7 @@ const
        PLUGIN_NAME                             = 'MachiBBSPlugIn';
        MAJOR_VERSION                   = 1;
        MINOR_VERSION                   = 0;
-       RELEASE_VERSION         = 'develop';
+       RELEASE_VERSION         = 'alpha';
        REVISION_VERSION        = 1;
 
 // =========================================================================
@@ -140,90 +140,6 @@ begin
        Result := ForceDirectoriesEx(ExtractFilePath(Dir)) and CreateDir(Dir);
 end;
 
-(*************************************************************************
- *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
- *************************************************************************)
-function RemoveToken(var s: string; delimiter: string): string;
-var
-       p: Integer;
-begin
-       p := AnsiPos(delimiter, s);
-       if p = 0 then
-               Result := s
-       else
-               Result := Copy(s, 1, p - 1);
-       s := Copy(s, Length(Result) + Length(delimiter) + 1, Length(s));
-end;
-
-(*************************************************************************
- *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
- *************************************************************************)
-function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
-var
-       i: Integer;
-begin
-       Result := '';
-       for i := 0 to index do
-               Result := RemoveToken(s, delimiter);
-end;
-
-(*************************************************************************
- *\95\8e\9a\97ñ\90\94\8e\9a\83`\83F\83b\83N
- *************************************************************************)
-function IsNumeric(s: string): boolean;
-var
-       e: integer;
-       v: integer;
-begin
-       Val(s, v, e);
-       Result := e = 0;
-end;
-
-(*************************************************************************
- *\83T\83u\83W\83F\83N\83g\88ê\8ds\82ð\95ª\8a\84
- *************************************************************************)
-function DivideSubject(Line: string): TSubjectRec;
-var
-       i: integer;
-       ws: WideString;
-       Delim: string;
-       LeftK: string;
-       RightK: string;
-begin
-       Result.FCount := 0;
-
-       if Pos('<>', Line) = 0 then
-               Delim := ','
-       else
-               Delim := '<>';
-
-       Result.FFileName := GetTokenIndex(Line, Delim, 0);
-       Result.FTitle := GetTokenIndex(Line, Delim, 1);
-
-       ws := Trim(Result.FTitle);
-
-       if Copy(ws, Length(ws), 1) = ')' then begin
-               LeftK := '(';
-               RightK := ')';
-       end else if Copy(ws, Length(ws), 1) = '\81j' then begin
-               LeftK := '\81i';
-               RightK := '\81j';
-       end else if Copy(ws, Length(ws), 1) = '<' then begin
-               LeftK := '<';
-               RightK := '>';
-       end;
-
-       for i := Length(ws) - 1 downto 1 do begin
-               if ws[i] = LeftK then begin
-                       ws := Copy(ws, i + 1, Length(ws) - i - 1);
-                       if IsNumeric(ws) then
-                               Result.FCount := StrToInt(ws);
-                       Result.FTitle := Trim(StringReplace(Result.FTitle, LeftK + ws + RightK, '', [rfReplaceAll]));
-                       break;
-               end;
-       end;
-end;
-
 
 
 // =========================================================================
@@ -480,8 +396,6 @@ begin
                        // dat \82Ì\93Ç\82Ý\8d\9e\82Ý
                        FDat                    := TStringList.Create;
                        FDat.LoadFromFile( FilePath );
-
-                       AllResCount := FDat.Count; // \96{\93\96\82Í\82±\82±\82Å\82â\82é\82×\82«\82Å\82Í\82È\82¢\82ª\8eÀ\8c±\82Ì\82½\82ß\82Ì\88ê\8e\9e\93I\82È\82à\82Ì
                end else begin
                        // \83\8d\83O\82É\91\8dÝ\82µ\82È\82¢\82Ì\82Å\82±\82Ì\82Ü\82Ü\8fI\97¹
                        Result := '';
@@ -824,9 +738,6 @@ procedure   TMachiBBSBoardItem.EnumThread(
 var
        uri                                     : TIdURI;
        uriList                 : TStringList;
-       rec                                     : TSubjectRec;
-       i                                               : Integer;
-       isContinue      : Boolean;
 const
        SUBJECT_NAME    = 'subject.txt';
 begin
@@ -854,21 +765,8 @@ begin
                        end;
                end;
 
-               for i := 0 to FDat.Count - 1 do begin
-                       rec                                             := DivideSubject( FDat[i] );
-                       rec.FFileName   := Trim(rec.FFileName);
-                       if (rec.FTitle = '') and (rec.FCount = 0) then
-                               Continue;
-
-                       isContinue := inCallBack(
-                               Instance,
-                               PChar( ToThreadURL( rec.FFileName ) ),
-                               PChar( rec.FTitle ),
-                               DWORD( rec.FCount ) );
-
-                       if ( not isContinue ) then
-                               Break;
-               end;
+               // \93Æ\8e©\82É\83t\83B\83\8b\83^\83\8a\83\93\83O\82ð\8ds\82í\82È\82¢\8fê\8d\87\82Í EnumThread \82É\94C\82¹\82é\82±\82Æ\82ª\8fo\97\88\82é
+               inherited EnumThread( inCallBack, FDat.Text );
        except
        end;
 
index 1655678..7c68fc4 100644 (file)
@@ -78,8 +78,8 @@ const
        PLUGIN_NAME                             = 'ShitarabaPlugIn';
        MAJOR_VERSION                   = 1;
        MINOR_VERSION                   = 0;
-       RELEASE_VERSION         = 'develop';
-       REVISION_VERSION        = 2;
+       RELEASE_VERSION         = 'alpha';
+       REVISION_VERSION        = 1;
 
 // =========================================================================
 // \8eG\97p\8aÖ\90\94
@@ -141,90 +141,6 @@ begin
        Result := ForceDirectoriesEx(ExtractFilePath(Dir)) and CreateDir(Dir);
 end;
 
-(*************************************************************************
- *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
- *************************************************************************)
-function RemoveToken(var s: string; delimiter: string): string;
-var
-       p: Integer;
-begin
-       p := AnsiPos(delimiter, s);
-       if p = 0 then
-               Result := s
-       else
-               Result := Copy(s, 1, p - 1);
-       s := Copy(s, Length(Result) + Length(delimiter) + 1, Length(s));
-end;
-
-(*************************************************************************
- *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
- *************************************************************************)
-function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
-var
-       i: Integer;
-begin
-       Result := '';
-       for i := 0 to index do
-               Result := RemoveToken(s, delimiter);
-end;
-
-(*************************************************************************
- *\95\8e\9a\97ñ\90\94\8e\9a\83`\83F\83b\83N
- *************************************************************************)
-function IsNumeric(s: string): boolean;
-var
-       e: integer;
-       v: integer;
-begin
-       Val(s, v, e);
-       Result := e = 0;
-end;
-
-(*************************************************************************
- *\83T\83u\83W\83F\83N\83g\88ê\8ds\82ð\95ª\8a\84
- *************************************************************************)
-function DivideSubject(Line: string): TSubjectRec;
-var
-       i: integer;
-       ws: WideString;
-       Delim: string;
-       LeftK: string;
-       RightK: string;
-begin
-       Result.FCount := 0;
-
-       if Pos('<>', Line) = 0 then
-               Delim := ','
-       else
-               Delim := '<>';
-
-       Result.FFileName := GetTokenIndex(Line, Delim, 0);
-       Result.FTitle := GetTokenIndex(Line, Delim, 1);
-
-       ws := Trim(Result.FTitle);
-
-       if Copy(ws, Length(ws), 1) = ')' then begin
-               LeftK := '(';
-               RightK := ')';
-       end else if Copy(ws, Length(ws), 1) = '\81j' then begin
-               LeftK := '\81i';
-               RightK := '\81j';
-       end else if Copy(ws, Length(ws), 1) = '<' then begin
-               LeftK := '<';
-               RightK := '>';
-       end;
-
-       for i := Length(ws) - 1 downto 1 do begin
-               if ws[i] = LeftK then begin
-                       ws := Copy(ws, i + 1, Length(ws) - i - 1);
-                       if IsNumeric(ws) then
-                               Result.FCount := StrToInt(ws);
-                       Result.FTitle := Trim(StringReplace(Result.FTitle, LeftK + ws + RightK, '', [rfReplaceAll]));
-                       break;
-               end;
-       end;
-end;
-
 
 
 // =========================================================================
@@ -443,8 +359,8 @@ begin
                                                                Count                                                           := Count + downResult.Count;
                                                                NewResCount                                     := downResult.Count;
                                                        end;
-            end else begin
-               Result := dsNotModify;
+                                               end else begin
+                                                       Result := dsNotModify;
                                                end;
                                        finally
                                                downResult.Free;
@@ -836,9 +752,6 @@ procedure   TShitarabaBoardItem.EnumThread(
 var
        uri                                     : TIdURI;
        uriList                 : TStringList;
-       rec                                     : TSubjectRec;
-       i                                               : Integer;
-       isContinue      : Boolean;
 const
        SUBJECT_NAME    = 'subject.txt';
 begin
@@ -866,21 +779,8 @@ begin
                        end;
                end;
 
-               for i := 0 to FDat.Count - 1 do begin
-                       rec                                             := DivideSubject( FDat[i] );
-                       rec.FFileName   := Trim(rec.FFileName);
-                       if (rec.FTitle = '') and (rec.FCount = 0) then
-                               Continue;
-
-                       isContinue := inCallBack(
-                               Instance,
-                               PChar( ToThreadURL( rec.FFileName ) ),
-                               PChar( rec.FTitle ),
-                               DWORD( rec.FCount ) );
-
-                       if ( not isContinue ) then
-                               Break;
-               end;
+               // \93Æ\8e©\82É\83t\83B\83\8b\83^\83\8a\83\93\83O\82ð\8ds\82í\82È\82¢\8fê\8d\87\82Í EnumThread \82É\94C\82¹\82é\82±\82Æ\82ª\8fo\97\88\82é
+               inherited EnumThread( inCallBack, FDat.Text );
        except
        end;