Daraja HTTP Framework 3.5.0-SNAPSHOT
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
djGlobal.pas File Reference

Functions

string GetServerBanner ()
 Returns the start-up banner: the word "daraja" as ASCII art, followed by a line with the framework description and DWF_SERVER_VERSION.
string HTMLEncode (const string AData)
 Escapes text for HTML: '<', '>', '&', '"' and ''' become <, >, &, " and &#39;.

Variables

const DWF_SERVER_COPYRIGHT = "Copyright (c) 2016 Michael Justin"
const DWF_SERVER_FULL_NAME = "Daraja HTTP Framework " + DWF_SERVER_VERSION
const DWF_SERVER_VERSION = "3.5.0-SNAPSHOT"

Function Documentation

◆ GetServerBanner()

string GetServerBanner ( )

Returns the start-up banner: the word "daraja" as ASCII art, followed by a line with the framework description and DWF_SERVER_VERSION.

Lines are separated by sLineBreak; the result ends with a line break.

Returns
the banner text

Referenced by HTMLEncode(), and TdjServer::RemoveConnector().

◆ HTMLEncode()

string HTMLEncode ( const string AData)

Escapes text for HTML: '<', '>', '&', '"' and ''' become <, >, &, " and &#39;.

The result is safe in HTML element text and in a quoted attribute value, single- or double-quoted. It is not safe in an unquoted attribute, or in a JavaScript, CSS or URL context; those need an encoder made for them.

Parameters
ADatathe text to escape
Returns
the escaped text; AData itself if nothing needed escaping

References DWF_SERVER_VERSION, GetServerBanner(), and HTMLEncode().

Referenced by HTMLEncode().

Variable Documentation

◆ DWF_SERVER_COPYRIGHT

const DWF_SERVER_COPYRIGHT = "Copyright (c) 2016 Michael Justin"

◆ DWF_SERVER_FULL_NAME

const DWF_SERVER_FULL_NAME = "Daraja HTTP Framework " + DWF_SERVER_VERSION

◆ DWF_SERVER_VERSION

const DWF_SERVER_VERSION = "3.5.0-SNAPSHOT"

Referenced by HTMLEncode().