OSDN Git Service

2ちゃんねるのトリップ仕様の拡張に対応
[gikonavigoeson/gikonavi.git] / BoardGroup.pas
index f189df0..752daa0 100644 (file)
@@ -279,7 +279,7 @@ type
        public
                constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; inURL : string ); overload;
                constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard;
-                                        inURL : string; inExist: Boolean; const inFilename: string ); overload;
+                                        const inURL : string; inExist: Boolean; const inFilename: string ); overload;
 
                destructor Destroy; override;
 
@@ -334,6 +334,12 @@ type
         property       BoardPlugIn     : TBoardPlugIn  read FBoardPlugIn write FBoardPlugIn;
     end;
 
+    // \93Á\8eê\97p\93r\97pTBoard
+    TSpecialBoard = class(TBoard)
+    public
+        function Add(item: TThreadItem): integer; overload;
+        procedure Clear; overload;
+    end;
 
        function        BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
        function        BBSsFindBoardFromURL( inURL : string ) : TBoard;
@@ -341,9 +347,13 @@ type
        function        BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
        function        ConvertDateTimeString( inDateTimeString : string) : TDateTime;
 
+    procedure    DestorySpecialBBS( inBBS : TBBS );
+
 var
        BBSs            : array of TBBS;
     BoardGroups : array of TBoardGroup;
+    SpecialBBS  : TBBS;
+    SpecialBoard: TSpecialBoard;
 
 implementation
 
@@ -529,6 +539,28 @@ begin
        end;
 
 end;
+{!
+\brief \93Á\8eê\97p\93rBBS\8dí\8f\9c
+\param bbs \8dí\8f\9c\82·\82é\93Á\8eê\97p\93rBBS
+}
+procedure DestorySpecialBBS( inBBS : TBBS );
+var
+    sCategory : TCategory;
+    sBoard    : TSpecialBoard;
+begin
+    if inBBS <> nil then begin
+        sCategory := inBBS.Items[0];
+        if sCategory <> nil then begin
+            sBoard := TSpecialBoard(sCategory.Items[0]);
+            if sBoard <> nil then begin
+                sBoard.Modified := False;
+                sBoard.Clear;
+                FreeAndNil(sBoard);
+            end;
+        end;
+        FreeAndNil(inBBS);
+    end;
+end;
 
 (*************************************************************************
  *\8b@\94\\96¼\81FTBBS\83R\83\93\83X\83g\83\89\83N\83^
@@ -1542,7 +1574,7 @@ end;
 constructor TThreadItem.Create(
        const inPlugIn : TBoardPlugIn;
        const inBoard : TBoard;
-       inURL : string;
+       const inURL : string;
        inExist: Boolean;
        const inFilename: string
 );
@@ -1557,7 +1589,7 @@ begin
                // dat \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
                FileName        := inFilename;
                IsLogFile       := inExist;
-               URL                             := GikoSys.Get2chBrowsableThreadURL( inURL );
+        URL                            := inURL;
        end else begin
                // \83v\83\89\83O\83C\83\93\82É TThreadItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
                inPlugIn.CreateThreadItem( DWORD( Self ) );
@@ -1830,6 +1862,19 @@ begin
 
 end;
 
+function TSpecialBoard.Add(item: TThreadItem): integer;
+begin
+    Result := inherited AddObject(Item.URL, Item);
+end;
+
+procedure TSpecialBoard.Clear;
+var
+       i: integer;
+begin
+    for i := Count - 1 downto 0 do
+               DeleteList(i);
+    Capacity := 0;
+end;
 
 end.