-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2645fc2
commit 7dc2020
Showing
8 changed files
with
196 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
unit Horse.OctetStream.Config; | ||
|
||
{$IF DEFINED(FPC)} | ||
{$MODE DELPHI}{$H+} | ||
{$ENDIF} | ||
|
||
interface | ||
|
||
uses | ||
{$IF DEFINED(FPC)} | ||
SysUtils, | ||
Classes, | ||
{$ELSE} | ||
System.SysUtils, | ||
System.Classes, | ||
{$ENDIF} | ||
Generics.Collections; | ||
|
||
type | ||
TAcceptContentType = class(TList<string>) | ||
end; | ||
|
||
THorseOctetStreamConfig = class | ||
strict private | ||
class var FInstance: THorseOctetStreamConfig; | ||
function GetAcceptContentType: TAcceptContentType; | ||
var FAcceptContentType: TAcceptContentType; | ||
protected | ||
class function GetDefaultInstance: THorseOctetStreamConfig; | ||
public | ||
constructor Create; | ||
destructor Destroy; override; | ||
class function GetInstance: THorseOctetStreamConfig; | ||
class destructor OnDestroy; | ||
property AcceptContentType: TAcceptContentType read GetAcceptContentType; | ||
end; | ||
|
||
implementation | ||
|
||
constructor THorseOctetStreamConfig.Create; | ||
begin | ||
if not Assigned(FAcceptContentType) then | ||
FAcceptContentType := TAcceptContentType.Create; | ||
end; | ||
|
||
destructor THorseOctetStreamConfig.Destroy; | ||
begin | ||
if Assigned(FAcceptContentType) then | ||
FreeAndNil(FAcceptContentType); | ||
inherited; | ||
end; | ||
|
||
function THorseOctetStreamConfig.GetAcceptContentType: TAcceptContentType; | ||
begin | ||
Result := FAcceptContentType; | ||
end; | ||
|
||
class function THorseOctetStreamConfig.GetDefaultInstance: THorseOctetStreamConfig; | ||
begin | ||
if not Assigned(FInstance) then | ||
FInstance := THorseOctetStreamConfig.Create; | ||
Result := FInstance; | ||
end; | ||
|
||
class function THorseOctetStreamConfig.GetInstance: THorseOctetStreamConfig; | ||
begin | ||
Result := THorseOctetStreamConfig.GetDefaultInstance; | ||
end; | ||
|
||
class destructor THorseOctetStreamConfig.OnDestroy; | ||
begin | ||
if Assigned(FInstance) then | ||
FreeAndNil(FInstance); | ||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters