Menu

Commit [r335]  Maximize  Restore  History

Added new TCategoryInfo record that fully describes a category. Has Assign and Init methods.

delphidabbler 2009-09-20

changed /trunk/Src/USnippets.pas
/trunk/Src/USnippets.pas Diff Switch to side-by-side view
--- a/trunk/Src/USnippets.pas
+++ b/trunk/Src/USnippets.pas
@@ -157,6 +157,22 @@
     Desc: string;     // Description of categpry
     procedure Assign(const Src: TCategoryData);
       {Sets this record's fields to be same as another TCategoryData record.
+        @param Src [in] Record containing fields to be copied.
+      }
+    procedure Init;
+      {Initialises record to nul values.
+      }
+  end;
+
+  {
+  TCategoryInfo:
+    Record that fully describes a category, i.e. contains all the required data.
+  }
+  TCategoryInfo = record
+    Name: string;         // Name (unique id) of category
+    Data: TCategoryData;  // Category's properties
+    procedure Assign(const Src: TCategoryInfo);
+      {Sets this record's fields to be same as another TCategoryInfo record.
         @param Src [in] Record containing fields to be copied.
       }
     procedure Init;
@@ -2533,6 +2549,25 @@
   Desc := '';
 end;
 
+{ TCategoryInfo }
+
+procedure TCategoryInfo.Assign(const Src: TCategoryInfo);
+  {Sets this record's fields to be same as another TCategoryInfo record.
+    @param Src [in] Record containing fields to be copied.
+  }
+begin
+  Name := Src.Name;
+  Data.Assign(Src.Data);
+end;
+
+procedure TCategoryInfo.Init;
+  {Initialises record to nul values.
+  }
+begin
+  Name := '';
+  Data.Init;
+end;
+
 { TSnippetIDListEx }
 
 constructor TSnippetIDListEx.Create(const Routines: TRoutineList);
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.