View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004358 | JEDI VCL | 00 JVCL Components | public | 2008-03-13 12:39 | 2008-05-28 13:38 |
Reporter | Kiriakos | Assigned To | jfudickar | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0004358: Add support for TWideStringList in JvAppStrorage | ||||
Description | Here are the changes required: In the interface section add: {$IFDEF COMPILER10_UP} { StringList item reader used by ReadWideStringList in the call to ReadList. } procedure ReadWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const Index: Integer; const ItemName: string); { StringList item writer used by WriteStringList in the call to WriteList. } procedure WriteWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const Index: Integer; const ItemName: string); { StringList item deleter used by WriteStringList in the call to WriteList. } procedure DeleteWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const First, Last: Integer; const ItemName: string); {$ENDIF} {$IFDEF COMPILER10_UP} { Retrieves a wide string list. The string list is optionally cleared before reading starts. The result value is the number of items read. Uses ReadList with internally provided methods to do the actual reading. } function ReadWideStringList(const Path: string; const SL: TWideStrings; const ClearFirst: Boolean = True; const ItemName: string = cItem): Integer; { Stores a WideString list. Uses WriteList with internally provided methods to do the actual storing. } procedure WriteWideStringList(const Path: string; const SL: TWideStrings; const ItemName: string = cItem); {$ENDIF} And in the implementation {$IFDEF COMPILER10_UP} procedure TJvCustomAppStorage.ReadWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const Index: Integer; const ItemName: string); begin if List is TWideStrings then TWideStrings(List).Add(Sender.ReadWideString(ConcatPaths([Path, ItemName + IntToStr(Index)]))); end; procedure TJvCustomAppStorage.WriteWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const Index: Integer; const ItemName: string); begin if List is TWideStrings then Sender.WriteWideString(ConcatPaths([Path, ItemName + IntToStr(Index)]), TWideStrings(List)[Index]); end; procedure TJvCustomAppStorage.DeleteWideStringListItem(Sender: TJvCustomAppStorage; const Path: string; const List: TObject; const First, Last: Integer; const ItemName: string); var I: Integer; begin if List is TWideStrings then for I := First to Last do Sender.DeleteValue(ConcatPaths([Path, ItemName + IntToStr(I)])); end; {$ENDIF} {$IFDEF COMPILER10_UP} function TJvCustomAppStorage.ReadWideStringList(const Path: string; const SL: TWideStrings; const ClearFirst: Boolean = True; const ItemName: string = cItem): Integer; begin if not ListStored(Path) and StorageOptions.DefaultIfValueNotExists then Result := SL.Count else begin SL.BeginUpdate; try if ClearFirst then SL.Clear; ReadPersistent(Path,SL,True,False); Result := ReadList(Path, SL, ReadWideStringListItem, ItemName); finally SL.EndUpdate; end; end; end; procedure TJvCustomAppStorage.WriteWideStringList(const Path: string; const SL: TWideStrings; const ItemName: string = cItem); begin WriteList(Path, SL, SL.Count, WriteWideStringListItem, DeleteWideStringListItem, ItemName); WritePersistent(Path,SL); end; {$ENDIF} | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2008-03-13 12:39 | Kiriakos | New Issue | |
2008-03-13 12:41 | Kiriakos | Note Added: 0014290 | |
2008-05-28 02:07 | jfudickar | Status | new => assigned |
2008-05-28 02:07 | jfudickar | Assigned To | => jfudickar |
2008-05-28 02:07 | jfudickar | Status | assigned => acknowledged |
2008-05-28 13:37 | jfudickar | Status | acknowledged => resolved |
2008-05-28 13:37 | jfudickar | Resolution | open => fixed |
2008-05-28 13:37 | jfudickar | Note Added: 0014312 |