Daraja HTTP Framework 3.0.7-SNAPSHOT
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjContext Class Reference

Handles requests within a specific context path. More...

Inheritance diagram for TdjContext:
IContext IWriteableConfig IWriteableConfig

Public Member Functions

 TdjContext (const string ContextPath)
 Initializes a new context with the specified path.

Protected Member Functions

 Add (const string Key, const string Value)
 Adds a key-value pair to configuration.
IContextConfig GetContextConfig ()
 Get the context configuration.
string GetContextPath ()
 Get the context path.
string GetInitParameter (const string Key)
 Gets the value of an initialization parameter.
TdjStrings GetInitParameterNames ()
 Gets all initialization parameter names.
 Init (const IContextConfig Config)
 Initializes the context with the given configuration.
 Log (const string Msg)
 Logs a message to the configured logging system.
 SetContext (const IContext Context)
 Sets the context for this configuration.

Detailed Description

Handles requests within a specific context path.

Manages initialization parameters and context configuration.

Constructor & Destructor Documentation

◆ TdjContext()

TdjContext::TdjContext ( const string ContextPath)

Initializes a new context with the specified path.

Parameters
ContextPathThe path for this context.
Exceptions
EWebComponentExceptionIf the context path contains invalid characters.

Member Function Documentation

◆ Add()

TdjContext::Add ( const string Key,
const string Value )
protected

Adds a key-value pair to configuration.

Parameters
KeyParameter name
ValueParameter value

Implements IWriteableConfig.

◆ GetContextConfig()

IContextConfig TdjContext::GetContextConfig ( )
protected

Get the context configuration.

Returns
the context configuration

Implements IContext.

◆ GetContextPath()

string TdjContext::GetContextPath ( )
protected

Get the context path.

Returns
the context path.

Implements IContext.

◆ GetInitParameter()

string TdjContext::GetInitParameter ( const string Key)
protected

Gets the value of an initialization parameter.

Parameters
KeyThe parameter name.
Returns
The parameter value or empty string if not found.

Implements IContext.

◆ GetInitParameterNames()

TdjStrings TdjContext::GetInitParameterNames ( )
protected

Gets all initialization parameter names.

Returns
A list containing all parameter names.

Implements IContext.

◆ Init()

TdjContext::Init ( const IContextConfig Config)
protected

Initializes the context with the given configuration.

Parameters
ConfigThe context configuration to use.

Implements IContext.

◆ Log()

TdjContext::Log ( const string Msg)
protected

Logs a message to the configured logging system.

Parameters
MsgThe message to log.

Implements IContext.

◆ SetContext()

TdjContext::SetContext ( const IContext Context)
protected

Sets the context for this configuration.

Parameters
ContextContext to set
Exceptions
EWebComponentExceptionif the context is nil or if the context is already set and differs from the new context.

Implements IWriteableConfig.