OSDN Git Service

DivideStrLineを共通関数に
authorh677 <h677>
Mon, 22 Aug 2005 14:23:37 +0000 (14:23 +0000)
committerh677 <h677>
Mon, 22 Aug 2005 14:23:37 +0000 (14:23 +0000)
GikoSystem.pas
MojuUtils.pas

index 897081b..e34cced 100644 (file)
@@ -14,7 +14,7 @@ uses
 {$IFEND}
        {HttpApp,} YofUtils, URLMon, IdGlobal, IdURI, {Masks,}
        Setting, BoardGroup, gzip, Dolib, bmRegExp, AbonUnit,
-       MojuUtils, ExternalBoardManager, ExternalBoardPlugInMain,
+       ExternalBoardManager, ExternalBoardPlugInMain,
        Sort, GikoBayesian;
 
 type
@@ -165,7 +165,6 @@ type
                function AddAnchorTag(s: string): string;
 
                function DivideSubject(Line: string): TSubjectRec;
-               function DivideStrLine(Line: string): TResRec;
 
                property Setting: TSetting read FSetting write FSetting;
                property Dolib: TDolib read FDolib write FDolib;
@@ -186,7 +185,6 @@ type
 
                procedure MenuFont(Font: TFont);
 
-               function RemoveToken(var s:string; const delimiter:string):string;
                function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
                function DeleteLink(const s: string): string;
 
@@ -269,7 +267,7 @@ const
 implementation
 
 uses
-       Giko, RoundData, Favorite, Registry, HTMLCreate;
+       Giko, RoundData, Favorite, Registry, HTMLCreate, MojuUtils;
 
 const
        FOLDER_INDEX_VERSION                                    = '1.01';
@@ -1160,39 +1158,6 @@ begin
        end;
 end;
 
-(*************************************************************************
- * dat\83t\83@\83C\83\8b\82Ì\88ê\83\89\83C\83\93\82ð\95ª\89ð
- *************************************************************************)
-function TGikoSys.DivideStrLine(Line: string): TResRec;
-var
-       Delim: string;
-begin
-       if AnsiPos('<>', Line) = 0 then begin
-               //Delim := ',';
-               //Result.FType := glt2chOld;
-        Line := CustomStringReplace(Line, '<>', '&lt;&gt;');
-               Line := CustomStringReplace(Line, ',', '<>');
-               Line := CustomStringReplace(Line, '\81\97\81M', ',');
-       end;
-       Delim := '<>';
-       Result.FType := glt2chNew;
-       //Trim\82µ\82Ä\82Í\82¢\82¯\82È\82¢\8bC\82ª\82·\82é\81@by\82à\82\82ã
-       Result.FName := RemoveToken(Line, Delim);
-       Result.FMailTo := RemoveToken(Line, Delim);
-       Result.FDateTime := RemoveToken(Line, Delim);
-       Result.FBody := RemoveToken(Line, Delim);
-       //\8bó\82¾\82Æ\96â\91è\82ª\8bN\82«\82é\82©\82ç\81A\8bó\94\92\82ð\90Ý\92è\82·\82é
-       if Result.FBody = '' then begin
-               Result.FBody := '&nbsp;';
-       end else if ( Result.FBody[1] = ' ' ) then begin
-               //\82Q\82¿\82á\82ñ\82Ë\82é\82Æ\82©\82¾\82Æ\81A\96{\95\82Ì\90æ\93ª\82É\82P\82Â\94¼\8ap\8bó\94\92\82ª\93ü\82Á\82Ä\82¢\82é\82Ì\82Å\8dí\8f\9c\82·\82é
-               //\91¼\82Ì\8cf\8e¦\94Â\82Å\81A\83\8c\83X\8e©\91Ì\82Ì\8bó\94\92\82©\82à\82µ\82ê\82È\82¢\82¯\82Ç\82»\82ê\82Í\92ú\82ß\82é
-               Delete(Result.FBody, 1, 1);
-       end;
-       //Result.FTitle := Trim(RemoveToken(Line, Delim));
-       Result.FTitle := RemoveToken(Line, Delim);
-
-end;
 
 (*************************************************************************
  * URL\82©\82çBBSID\82ð\8eæ\93¾
@@ -1398,21 +1363,6 @@ begin
                Font.Style := Font.Style + [fsItalic];
 end;
 
-(*************************************************************************
- *
- *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
- *************************************************************************)
-function TGikoSys.RemoveToken(var s: string;const delimiter: string): string;
-var
-       p: Integer;
-begin
-       p := AnsiPos(delimiter, s);
-       if p = 0 then
-               Result := s
-       else
-               Result := Copy(s, 1, p - 1);
-       Delete(s, 1, Length(Result) + Length(delimiter));
-end;
 
 (*************************************************************************
  *
index d073ffb..5387f52 100644 (file)
@@ -14,7 +14,7 @@ unit MojuUtils;
 interface
 
 uses
-       Windows, Classes, SysUtils;
+       Windows, Classes, SysUtils, GikoSystem;
 
        function StrPosEx(StrStart, StrEnd, SubstrStart, SubstrEnd: PChar): PChar;
        function AnsiStrPosEx(StrStart, StrEnd, SubstrStart, SubstrEnd: PChar): PChar;
@@ -31,6 +31,8 @@ uses
        function IsNoValidID( inID :String): Boolean;
        //<font>\83^\83O\82ð\91S\82Ä\8dí\8f\9c\82·\82é
        function        DeleteFontTag( inSource : string) : string;
+       function DivideStrLine(Line: string): TResRec;
+       function RemoveToken(var s: string;const delimiter: string): string;
 
 implementation
 // \83|\83C\83\93\83^\81[\81\95\83A\83Z\83\93\83u\83\89\82É\82æ\82é\8d\82\91¬\83|\83X
@@ -43,7 +45,7 @@ asm
                MOV    ESI,ECX        { Point ESI to substr                  }
                MOV    EDI,EAX        { Point EDI to s                        }
 
-        MOV    ECX,EDX        { ECX = search length                  }
+               MOV    ECX,EDX        { ECX = search length                  }
         SUB    ECX,EAX
 
         MOV    EDX,SubstrEnd
@@ -335,5 +337,53 @@ begin
 end;
 // *************************************************************************
 
+(*************************************************************************
+ * dat\83t\83@\83C\83\8b\82Ì\88ê\83\89\83C\83\93\82ð\95ª\89ð
+ *************************************************************************)
+function DivideStrLine(Line: string): TResRec;
+var
+       Delim: string;
+begin
+       if AnsiPos('<>', Line) = 0 then begin
+               //Delim := ',';
+               //Result.FType := glt2chOld;
+               Line := CustomStringReplace(Line, '<>', '&lt;&gt;');
+               Line := CustomStringReplace(Line, ',', '<>');
+               Line := CustomStringReplace(Line, '\81\97\81M', ',');
+       end;
+       Delim := '<>';
+       Result.FType := glt2chNew;
+       //Trim\82µ\82Ä\82Í\82¢\82¯\82È\82¢\8bC\82ª\82·\82é\81@by\82à\82\82ã
+       Result.FName := RemoveToken(Line, Delim);
+       Result.FMailTo := RemoveToken(Line, Delim);
+       Result.FDateTime := RemoveToken(Line, Delim);
+       Result.FBody := RemoveToken(Line, Delim);
+       //\82Q\82¿\82á\82ñ\82Ë\82é\82Æ\82©\82¾\82Æ\81A\96{\95\82Ì\90æ\93ª\82É\82P\82Â\94¼\8ap\8bó\94\92\82ª\93ü\82Á\82Ä\82¢\82é\82Ì\82Å\8dí\8f\9c\82·\82é
+       //\91¼\82Ì\8cf\8e¦\94Â\82Å\81A\83\8c\83X\8e©\91Ì\82Ì\8bó\94\92\82©\82à\82µ\82ê\82È\82¢\82¯\82Ç\82»\82ê\82Í\92ú\82ß\82é
+       Result.FBody := TrimLeft(Result.FBody);
+       //\8bó\82¾\82Æ\96â\91è\82ª\8bN\82«\82é\82©\82ç\81A\8bó\94\92\82ð\90Ý\92è\82·\82é
+       if Result.FBody = '' then
+               Result.FBody := '&nbsp;';
+
+       Result.FTitle := RemoveToken(Line, Delim);
+
+end;
+
+(*************************************************************************
+ *
+ *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
+ *************************************************************************)
+function RemoveToken(var s: string;const delimiter: string): string;
+var
+       p: Integer;
+begin
+       p := AnsiPos(delimiter, s);
+       if p = 0 then
+               Result := s
+       else
+               Result := Copy(s, 1, p - 1);
+       Delete(s, 1, Length(Result) + Length(delimiter));
+end;
+
 
 end.