![]() |
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
Um ehrlich zu sein verstehe ich nur Bahnhof :-D
|
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
So etwas z.B.
Delphi-Quellcode:
unit Unit2;
interface uses System.IniFiles; type TEinstellungen = class abstract private procedure SetFoo( const Value: string ); function GetFoo: string; protected function GetValue( const Key: string ): string; virtual; abstract; procedure SetValue( const Key, Value: string ); virtual; abstract; public property Foo: string read GetFoo write SetFoo; end; TIniEinstellungen = class( TEinstellungen ) private FIniFile: TMemIniFile; protected function GetValue( const Key: string ): string; override; procedure SetValue( const Key: string; const Value: string ); override; public constructor Create( const IniFileName: string ); destructor Destroy; override; end; implementation { TEinstellungen } function TEinstellungen.GetFoo: string; begin Result := GetValue( 'foo' ); end; procedure TEinstellungen.SetFoo( const Value: string ); begin SetValue( 'foo', Value ); end; { TIniEinstellungen } constructor TIniEinstellungen.Create( const IniFileName: string ); begin inherited Create; FIniFile := TMemIniFile.Create( IniFileName ); end; destructor TIniEinstellungen.Destroy; begin FIniFile.Free; inherited; end; function TIniEinstellungen.GetValue( const Key: string ): string; begin Result := FIniFile.ReadString( 'Default', Key, '' ); end; procedure TIniEinstellungen.SetValue( const Key, Value: string ); begin FIniFile.WriteString( 'Default', Key, Value ); FIniFile.UpdateFile; end; end. |
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
Ok nun hab ich es kapiert!
Was in meinem Fall aber absolut schrecklich wäre ist folgendes:
Delphi-Quellcode:
Dafür habe ich zu viele Werte.
{ TEinstellungen }
function TEinstellungen.GetFoo: string; begin Result := GetValue( 'foo' ); end; procedure TEinstellungen.SetFoo( const Value: string ); begin SetValue( 'foo', Value ); end; Oder ich kapier den Sinn nicht. Ich glaube ich wechsle einfach zu TMemIniFile und gut ist. Klasse hin oder her, alles zu ver-komplizieren ist nicht mein Ding. |
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
Gibts hier was aktuelleres/neues ?
Ansonsten würd ich die Klasse evtl. selbst um ein/zwei Features erweitern :) |
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
Zitat:
|
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
hm...wenn ich mir die Source der Klassen angugg ist das schon ein ziemlicher Verhau. :-D
Aber im Moment reicht mir eine kleine Erweiterung aus. Evtl. werd ich mal auf Basis des eigentlich Wrappers mal noch was Übersichtliches Bauen :) |
AW: TSQLiteDatabase: A SQLite3 Database Wrapper
Für Interresenten:
unter ![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:37 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz