summaryrefslogtreecommitdiff
path: root/mystringlistunit.pas
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-12-09 12:58:54 +0100
committerErich Eckner <git@eckner.net>2015-12-09 12:58:54 +0100
commit92dd95e43f55bed097ff1f57c41b4462640b083a (patch)
tree81064862be1812dcdc0ea058789dee8655c705db /mystringlistunit.pas
parentfc0ce98c4bae0f6390f9af91be04ee5147da66bd (diff)
downloadunits-92dd95e43f55bed097ff1f57c41b4462640b083a.tar.xz
loadFromResource neu in mystringlistunit.pas
Diffstat (limited to 'mystringlistunit.pas')
-rw-r--r--mystringlistunit.pas13
1 files changed, 13 insertions, 0 deletions
diff --git a/mystringlistunit.pas b/mystringlistunit.pas
index 0a043a3..cdc0933 100644
--- a/mystringlistunit.pas
+++ b/mystringlistunit.pas
@@ -19,6 +19,7 @@ type
destructor destroy; override;
procedure loadFromFile(const s: ansiString); override;
procedure loadFromGz(const s: ansiString);
+ procedure loadFromResource(const s: ansiString);
procedure saveToGz(const s: ansiString);
function readln(out s: string): boolean; inline;
function metaReadln(out s: string; subRoutine: boolean): boolean; inline;
@@ -104,6 +105,18 @@ begin
gibAus(inttostr(count)+' Zeilen eingelesen',1);
end;
+procedure tMyStringlist.loadFromResource(const s: ansiString);
+var
+ st: tResourceStream;
+ buf: ansistring;
+begin
+ st:=tResourceStream.create(hInstance,s,RT_RCDATA);
+ setlength(buf,st.size);
+ st.readBuffer(buf[1],length(buf));
+ st.free;
+ text:=buf;
+end;
+
procedure tMyStringlist.saveToGz(const s: ansiString);
begin
fileunit.saveToGz(s,@(text[1]),length(text));