Just follow these coding styles (for now).
Use unit name as the filename, e.g.
unit foobar;
interface
implementation
end.
File containing above code should be named foobar.pp
.
Put class files in ./src/class/, and and specifically routing class files in ./src/route/.
Class files should be called HB[class name here].pp
.
Routing class files should be called as same as normal class files, e.g.
unit HBFoobar;
interface
uses
HBRoute;
type
TRouteFoobar = class(TRouteBase)
protected
procedure Job(); override;
end;
var
RouteFoobar: TRouteFoobar;
implementation
procedure TRouteFoobar.Job();
begin
// Do stuffs here
end;
end.
File containing above code should be named HBFoobar.pp
, in directory ./src/route/.
Initializing routing rules and registering them should be done in ./src/HighballServer.pp.
They should be always Name: Type
.
Fields should be declared before methods.
Always put (
and )
, even if they don't take any arguments.
Do not use indent for them, simply put them in the beginning of the line.
Put a blank line between them like:
unit foobar;
interface
uses
HBDatabase;
procedure DoSomething();
procedure DoSomething2();
implementation
uses
FPJSON;
procedure DoSomething();
begin
// Do something...
end;
procedure DoSomething2();
begin
// Do something...
end;
end.