Unit rtcInfo

Description
Uses
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Constants
Variables

Description

Information Objects - Copyright 2004-2018 (c) Teppi Technology (https://rtc.teppi.net)

This unit defines easy-to-use helper classes for handling user-defined data structures (native Values, Arrays, Records, DataSets, Linked Objects, etc).

Overview

Classes, Interfaces, Objects and Records

Name Description
Class ERtcInfo  
Class TRtcValueObject All RTC Value Objects extend this class
Class TRtcAbsValue Abstract Value Object
Class TRtcAbsRecord Abstract Record Object
Class TRtcAbsArray Abstract Array Object
Class TRtcValue Object to store and transport a single value of any kind
Class TRtcValueResult Object to store and transport one or more function call Results
Class TRtcRecord Object to store and transport data in record
Class TRtcArray Object to store and transport data in an array
Class TRtcDataRow Access to a single Row from a TRtcDataSet
Class TRtcDataSet Object to store and transport a DataSet
Class TRtcDataSetChanges DataSet Changes
Class TRtcFunctionInfo Object to store and transport information for a remote function call
Class TRtcInfo Advanced Information Object, used for storing multiple objects and values for local usage
Class TRtcSession Basic Session Information object
Class TRtcDataObject RTC "Data" object
Class TRtcHttpObject RTC "HTTP" object
Class TRtcHttpValues HTTP Values: Reading and writing HTTP Values
Class TRtcOffsetReaderStream  
Class TRtcFileReaderStreamInValues  
Class TRtcBodyReaderStreamInValues  
Class TRtcHttpHeader HTTP Header: Basic Request/Response wrapper
Class TRtcRequestFilePath  
Class TRtcRequest Basic Http Request wrapper
Class TRtcResponse Basic Http Response wrapper
Class TRtcObjectCall TRtcValue with "xName" and "Manager" properties
Class TRtcObjectManager RTC Object Manager definition / abstract class
Class TRtcObjectLink RTC Object Link definition / abstract class

Functions and Procedures

function Curr2Str(v:Currency):RtcString;
function Str2Curr(const s:RtcString):Currency;
function Str2Float(const s:RtcString):rtcFloat;
function Float2Str(v:rtcFloat):RtcString;
function DateTime2Str3(v:TDateTime):RtcString;
function DateTime2Str2(v:TDateTime):RtcString;
function DateTime2Str(v:TDateTime):RtcString;
function Str2DateTime(s:RtcString):TDateTime;
function DateTime2ISOStr(v:TDateTime;withMS:boolean=False):RtcString;
function ISOStr2DateTime(s:RtcString):TDateTime;
function isSimpleValueType(typ:TRtcValueTypes):boolean;
function isSimpleValue(obj:TRtcValueObject):boolean;
function isXMLString(const s:RtcString):boolean; overload;
function isXMLString(const s:RtcByteArray):boolean; overload;
function isJSONString(const s:RtcString):boolean; overload;
function isJSONString(const s:RtcByteArray):boolean; overload;
function rtcCombineTypes(const type1,type2:TRtcValueTypes):TRtcValueTypes;
function rtcTypeName(const type1:TRtcValueTypes):RtcString;
function SetRtcObjectManager(const xManager:TRtcObjectManager):TRtcObjectManager;
function GetRtcObjectManager:TRtcObjectManager;
function CheckRtcObjectManager:TRtcObjectManager;
procedure RegisterRtcObjectConstructor(const xClassName:RtcWideString; xProc:TRtcObjectConstructor);
procedure UnregisterRtcObjectConstructor(const xClassName:RtcWideString);
function FindRtcObjectConstructor(const xClassName:RtcWideString):TRtcObjectConstructor;
function HPACK_Encode(const Source:TRtcHttpHeader; usingSSL:boolean=False; DynTable:tRtcDynamicHeaderTable=nil; ClearDynTable:boolean=False; UpdateDynTableSize:Integer=-1):RtcByteArray;
function HPACK_Decode(const Source:RtcByteArray; Dest:TRtcHttpHeader; DynTable:tRtcDynamicHeaderTable=nil; From:Integer=0; Len:Integer=-1):Integer;

Types

TRtcObjectList = TList;
RtcWideString = rtcTypes.RtcWideString;
RtcWideChar = rtcTypes.RtcWideChar;
RtcString = rtcTypes.RtcString;
RtcChar = rtcTypes.RtcChar;
RtcByteArray = rtcTypes.RtcByteArray;
TRtcCompressLevel = (...);
TRtcCertStoreType = (...);
TRtcValueTypes = (...);
TRtcHeaderFieldTypes = (...);
RtcProtoHttp = (...);
TRtcDataFormat = (...);
TRtcDataReqMode = (...);
TRtcSessionsMode = (...);
TRtcDataFormatSupport = set of TRtcDataFormat;
TRtcDataReqModeSupport = set of TRtcDataReqMode;
TRtcSessionsModeSupport = set of TRtcSessionsMode;
TRtcFieldTypes = (...);
TRtcSessionLockType = (...);
rtcFloat = double;
rtcInteger = longint;
rtcCardinal = Cardinal;
rtcLargeInt = int64;
rtcByteStream = TMemoryStream;
TRtcDataSetAction = (...);
TRtcCustomEvent = procedure(Sender:TObject; Obj:TObject) of object;
TRtcCustomDataEvent = procedure(Sender:TObject; Obj:TObject; Data:TRtcValue) of object;
TRtcObjectCallEvent = procedure(Sender:TObject; Param:TRtcObjectCall) of object;
TRtcObjectLinkSupport = (...);
TRtcObjectConstructor = procedure(Sender:TObject; Param:TRtcObjectCall);

Constants

RTC_ERRORDATA_SPLITTER=#13#10#13#10'--=:eRr.dAtA:=--'#13#10#13#10;
RTC_PARSERS_MAXDEPTH=1000;
RTC_XMLRPC_DataSetFieldsName='RTC.DATASET.FIELDS';
RTC_XMLRPC_DataSetRowsName='RTC.DATASET.ROWS';
RTC_XMLRPC_ParamsAsArrayName='PARAMS';
RTC_JSON_ParamsAsArrayName='params';
RTC_JSON_DataSetFieldsName = '"\/dsfields"';
RTC_JSON_DataSetRowsName = '"\/dsrows"';
RTC_JSON_FunctionName = '"\/method"';
RTC_JSON_DateTimeStr = '"\/Date(';
RTC_JSON_DateTimeISOStr = '"\/date\/';
RTC_JSON_ByteStreamStr = '"\/base64\/';
RTC_JSON_ExceptionStr = '"\/error\/';
RTC_NIL_OBJECT_ID = 0;
RTC_NIL_OBJECT = nil;
rtc_HttpDefault = rtc_Http1;
RTC_BOOLEAN_TYPES=[rtc_Boolean, rtc_Variant];
RTC_EXCEPTION_TYPES=[rtc_Exception, rtc_Variant];
RTC_VARIABLE_TYPES=[rtc_Variable, rtc_Variant];
RTC_BYTESTREAM_TYPES=[rtc_ByteStream, rtc_ByteArray, rtc_String, rtc_Variant];
RTC_STRING_TYPES=[rtc_String, rtc_Text, rtc_WideString, rtc_Variant];
RTC_INTEGER_TYPES=[rtc_OID, rtc_Integer, rtc_LargeInt, rtc_Cardinal, rtc_Variant];
RTC_FLOAT_TYPES=[rtc_DateTime, rtc_Float, rtc_Currency, rtc_Variant];
RTC_RECORD_TYPES=[rtc_Record];
RTC_ARRAY_TYPES=[rtc_Array];
RTC_FUNCTION_TYPES=[rtc_Function];
RTC_DATASET_TYPES=[rtc_DataSet];
wf_Cont = 0;
wf_Text = 1;
wf_Binary = 2;
wf_Close = 8;
wf_Ping = 9;
wf_Pong = 10;
RTC_WSFRAME_OPCODES=[wf_Cont,wf_Text,wf_Binary,wf_Close,wf_Ping,wf_Pong];
RTC_TYPE2FULLNAME_CONV: array[TRtcValueTypes] of RtcString = ( 'Null', 'Variable', 'FunctionCall', 'Exception', 'Array', 'Record', 'DataSet', 'Text', 'String', 'WideString', 'Boolean', 'Integer', 'Cardinal', 'LargeInt', 'Float', 'Currency', 'DateTime', 'ByteStream', 'OID', 'ByteArray', 'Variant');

Variables

LOG_INFO_ERRORS:boolean=False;
RTC_REQUEST_COOKIE_MULTILINE:Boolean=False;
RTC_RESPONSE_COOKIE_MULTILINE:Boolean=True;
RTC_REQUEST_COOKIE_DELIMITER:RtcChar=';';
RTC_RESPONSE_COOKIE_DELIMITER:RtcChar=#13;
RTC_REQUEST_COOKIE_SEPARATOR:RtcString=' ';
RTC_RESPONSE_COOKIE_SEPARATOR:RtcString='';
RTC_REQUEST_COOKIE_NAME:RtcString='Cookie';
RTC_REQUEST_COOKIE_NAME_CS:RtcString='COOKIE';
RTC_RESPONSE_COOKIE_NAME:RtcString='Set-Cookie';
RTC_RESPONSE_COOKIE_NAME_CS:RtcString='SET-COOKIE';
RTC_FORMPOST_CACHESIZE:integer=16000;
RTC_FILEUPLOAD_COPYSIZE:integer=128000;
RTC_MIN_COMPRESS_SIZE:integer=256;
RTC_JSON_GenEscapeSlash:boolean=True;
RTC_JSON_GenTypedDateTime:boolean=False;
RTC_JSON_GenTypedException:boolean=False;
RTC_JSON_GenTypedByteStream:boolean=False;
RTC_JSON_GenTypedFunctions:boolean=False;
RTC_JSON_ParseTypedDateTime:boolean=False;
RTC_JSON_ParseTypedByteStream:boolean=False;
RTC_JSON_ParseTypedFunctions:boolean=False;
RTC_JSON_ParseMethodFunctions:boolean=False;
RTC_JSON_ParseRPC1:boolean=False;
RTC_JSON_ParseRPC2:boolean=False;
RTC_JSON_ParseRPC1Functions:boolean=False;
RTC_JSON_ParseRPC1Errors:boolean=False;
RTC_JSON_ParseRPC1Results:boolean=False;
RTC_JSON_ParseRPC2Functions:boolean=False;
RTC_JSON_ParseRPC2Errors:boolean=False;
RTC_JSON_ParseRPC2Results:boolean=False;
RTC_JSON_ParseTypedDataSet:boolean=False;
RTC_JSON_ParseTypedException:boolean=False;
RTC_XMLRPC_GreaterStringEscape:boolean=False;
RTC_HT_SchemeDefault:TRtcHeaderFieldTypes=ht_Default;
RTC_HT_MethodDefault:TRtcHeaderFieldTypes=ht_Default;
RTC_HT_URIDefault:TRtcHeaderFieldTypes=ht_Default;
RTC_HT_CookieDefault:TRtcHeaderFieldTypes=ht_Default;
RTC_HT_StatusDefault:TRtcHeaderFieldTypes=ht_Default;
RTC_HT_Default:TRtcHeaderFieldTypes=ht_Default;
RTC_HTTP2_HostIsAuthority:boolean=TRUE;

Description

Functions and Procedures

function Curr2Str(v:Currency):RtcString;

Convert a Currency value to a "RTC Currency String" (used internaly by RTC)

function Str2Curr(const s:RtcString):Currency;

Convert a "RTC Currency String" to a Currency value (used internaly by RTC)

function Str2Float(const s:RtcString):rtcFloat;

Convert a Floating-point value to a "RTC Floating-point String" (used internaly by RTC)

function Float2Str(v:rtcFloat):RtcString;

Convert a "RTC Floating-point String" to a Floating-point Value (used internaly by RTC)

function DateTime2Str3(v:TDateTime):RtcString;

Convert a DateTime value to a compact Date-Time format (used internaly by RTC)

function DateTime2Str2(v:TDateTime):RtcString;

Convert a DateTime value to a "RTC DateTime String" (used internaly by RTC)

function DateTime2Str(v:TDateTime):RtcString;

Convert a DateTime value to a "RTC DateTime String" (used internaly by RTC)

function Str2DateTime(s:RtcString):TDateTime;

Convert a "RTC DateTime String" to a DateTime value (used internaly by RTC)

function DateTime2ISOStr(v:TDateTime;withMS:boolean=False):RtcString;

Convert a DateTime value to a ISO Date Time String (used internaly by RTC)

function ISOStr2DateTime(s:RtcString):TDateTime;

Convert a ISO Date Time String to a DateTime value (used internaly by RTC)

function isSimpleValueType(typ:TRtcValueTypes):boolean;

Check if Type is a simple value type (not a FunctionInfo, Record, DataSet or Array)

function isSimpleValue(obj:TRtcValueObject):boolean;

Check if object contains a simple value type (not a FunctionInfo, Record, DataSet or Array)

function isXMLString(const s:RtcString):boolean; overload;

Check if 's' appears to be an XML String.

function isXMLString(const s:RtcByteArray):boolean; overload;

Check if 's' appears to be an XML String.

function isJSONString(const s:RtcString):boolean; overload;

Check if 's' appears to be an JSON-RPC or JSON-REST String.

function isJSONString(const s:RtcByteArray):boolean; overload;

Check if 's' appears to be an JSON-RPC or JSON-REST String.

function rtcCombineTypes(const type1,type2:TRtcValueTypes):TRtcValueTypes;

Combine two RTC types and return the best type to hold values from type1 and type2. Combining anything with a NIL type will return the not-NIL type. Combining anything with a String type will always return a String type.

function rtcTypeName(const type1:TRtcValueTypes):RtcString;

Return Type Name for rtc type

function SetRtcObjectManager(const xManager:TRtcObjectManager):TRtcObjectManager;

Set Current Thread's RTC Object Manager (call with "NIL" to clear). If there was a RTC Object Manager already set for the current thread, the old RTC Object Manager will be returned. If not, returns NIL.

function GetRtcObjectManager:TRtcObjectManager;

Get Current Thread's RTC Object Manager. Raises an exception if no RTC Object Manager was set for this thread.

function CheckRtcObjectManager:TRtcObjectManager;

Checks the Current Thread's RTC Object Manager. Returns NIL if no RTC Object Manager was set for this thread.

procedure RegisterRtcObjectConstructor(const xClassName:RtcWideString; xProc:TRtcObjectConstructor);

Client has to register constructors for all RTC Object types which can be created remotely. This HAS TO BE done from the "initialization" section of the unit implementing the RTC Object class.

procedure UnregisterRtcObjectConstructor(const xClassName:RtcWideString);

All registered RTC Object Constructors also have to be unregitered. This HAS TO BE done from the "finalization" section of the unit implementing the RTC Object class.

function FindRtcObjectConstructor(const xClassName:RtcWideString):TRtcObjectConstructor;

This function is used to find the appropriate RTC Object Constructor.

function HPACK_Encode(const Source:TRtcHttpHeader; usingSSL:boolean=False; DynTable:tRtcDynamicHeaderTable=nil; ClearDynTable:boolean=False; UpdateDynTableSize:Integer=-1):RtcByteArray;

Encode "Source" HTTP/2 Headers into a dynamic byte array, using HPACK encoding with "DynTable" (Dynamic Header Table). If "ClearDynTable=TRUE", "DynTable" will be cleared and Dynamic Table updates will be encoded, before encoding Header fields. If "UpdateDynTableSize>=0", "DynTable.MaxSize" will be updated and a Dynamic Table Size Update will be encoded, before encoding any Header fields. Returns the byte array containing HPACK-Encoded "Source" headers and updates "DynTable" (as needed).

function HPACK_Decode(const Source:RtcByteArray; Dest:TRtcHttpHeader; DynTable:tRtcDynamicHeaderTable=nil; From:Integer=0; Len:Integer=-1):Integer;

Decode "Source" byte array into "Dest" HTTP Headers, using HPACK decoding with "DynTable" (Dynamic Header Table). If successful, returns the number of bytes processed (>0). If decoding failed, returns 0 if no bytes were processed, or the number of bytes processed with a negative prefix, if some data was processed.

Types

TRtcObjectList = TList;
 
RtcWideString = rtcTypes.RtcWideString;

Unicode String

RtcWideChar = rtcTypes.RtcWideChar;

Unicode character

RtcString = rtcTypes.RtcString;

8-bit Character String (NOT UNICODE!)

RtcChar = rtcTypes.RtcChar;

8-bit Character (NOT UNICODE!)

RtcByteArray = rtcTypes.RtcByteArray;

Array of Bytes

TRtcCompressLevel = (...);

RTC Compression Level

Values
  • cNone: no compression
  • cFast: fastest compression (low compress rate)
  • cDefault: default compression
  • cMax: maximum compression (slow)
TRtcCertStoreType = (...);

SSL Certificate Store Type

Values
  • certAny: Accept any certificate (Ignore certificate errors)
  • certNone: Do not use any certificates
  • certCA: Certification Authority certificates
  • certMY: A certificate store that holds certificates with associated private keys
  • certROOT: Root Certificates
  • certSPC: Software Publisher Certificates
TRtcValueTypes = (...);

RTC Value Types

Values
  • rtc_Null: No value assigned
  • rtc_Variable: variable name: Check local or Session variables for a result
  • rtc_Function: Function call (Function will be called to get a result)
  • rtc_Exception: Exception message (returned as a Result from a function call which ended in an exception being raised)
  • rtc_Array: Array (starting from index 0)
  • rtc_Record: Record
  • rtc_DataSet: DataSet
  • rtc_Text: Unicode / Text String (Unicode String stored and transported using UTF-8 encoding)
  • rtc_String: "Ansi" String value (strings up to 2GB)
  • rtc_WideString: Wide String value (wide strings up to 2GB)
  • rtc_Boolean: Boolean value
  • rtc_Integer: Integer value
  • rtc_Cardinal: Cardinal value (32-bit unsigned integer)
  • rtc_LargeInt: Large Integer value (64-bit signed integer)
  • rtc_Float: Floating-point value (double)
  • rtc_Currency: Currency value
  • rtc_DateTime: Date and Time value
  • rtc_ByteStream: Byte Stream
  • rtc_OID: RTC Linked Object ID
  • rtc_ByteArray: Byte Array
  • rtc_Variant: Variant / Any Type
TRtcHeaderFieldTypes = (...);

Header Field types when using HTTP/2 (does NOT apply to HTTP/1)

Values
  • ht_Default: Can be Compressed and Indexed
  • ht_NotCompressed: Should NOT be Compressed (may be Indexed)
  • ht_NotValueCompressed: Value should NOT be Compressed (may be Indexed, Name may be Compressed)
  • ht_NotIndexed: Should NOT be Indexed (Name and Value may be Compressed)
  • ht_NotIndexedOrCompressed: Should NOT be Indexed or Compressed
  • ht_NotIndexedOrValueCompressed: Should NOT be Indexed or Value Compressed (Name may be Compressed)
  • ht_NeverIndexed: Should NEVER be Indexed (may be Compressed).
  • ht_NeverIndexedOrCompressed: Should NEVER be Indexed or Compressed
  • ht_NeverIndexedOrValueCompressed: Should NOT be Indexed or Value Compressed (Name may be Compressed)
RtcProtoHttp = (...);

HTTP Protocol version prefference

Values
  • rtc_Http1
  • rtc_Http2
TRtcDataFormat = (...);
 
Values
  • fmt_RTC: "RTC-RPC" format -> RTC objects in the Content body
  • fmt_XMLRPC: "XML-RPC" format -> XML-RPC objects in the Content body
  • fmt_JSONrpc1: "JSON-RPC 1.0" format -> JSON-RPC "1.0" objects in the Content body
  • fmt_JSONrpc2: "JSON-RPC 2.0" format -> JSON-RPC "2.0" objects in the Content body
  • fmt_JSON: Plain "JSON" format -> Parameters and Result in the Content Body using JSON format. When used with DataReqMode="req_ContentBodyALL", "FunctionName" will be sent as a parameter called "method" inside a record with all paramers as elements.
TRtcDataReqMode = (...);
 
Values
  • req_contentBodyALL: FunctionName and Parameters in the Content Body (default)
  • req_contentBodyOptional: FunctionName in the request 'FileName' (URI) with (optional) Parameters in the Content Body. If there are no Parameters, Content Body will be empty.
  • req_contentBodyParams: FunctionName in the request 'FileName' (URI) with (mandatory) Parameters in the Content Body. If there are no Parameters, Content Body will be a Record with no elements.
  • req_directJSON: FunctionName in the request 'FileName' (URI) directly followed by all parameters (no '/' separator), URL-Encoded and serialized as a single JSON object or a JSON array (stored in "params" array).
  • req_queryJSON: FunctionName in the Request 'FileName' (URI) with all Parameters in the request Query (URI, after '?') as a single JSON object or array.
  • req_queryNameJSON: FunctionName in the Request 'FileName' (URI) with each parameter in the request Query (URI, after '?') as 'Name=JSON' pair using UTF-8 and URL Encoding for 'Name' and 'JSON' values.
  • req_queryNameText: FunctionName in the Request 'FileName' (URI) with each parameter in the request Query (URI, after '?') as 'Name=Text' pairs using UTF-8 and URL Encoding for 'Name' and 'Text' values.
  • req_uriParamsJSON: FunctionName in the request 'URI' (FileName / FilePath) with each parameter separated by '/' and represented as JSON using UTF-8 and URL Encoding. All parameters SHOULD be in the "params" array, starting from 0. If NOT, all parameters will be serialized into a single JSON object on the Client and deserialized back to named parameters on the Server.
  • req_uriParamsText: FunctionName in the request 'URI' (FileName / FilePath) with each parameter separated by '/' and stored as plain Text using UTF-8 and URL Encoding. This "Request Mode" is NOT suitable for sending named parameters! All parameters SHOULD BE in the "params" array, starting from 0. If NOT, all parameters will be serialized into a single String on the Client and received as a single String inside the "params" array on the Server.
TRtcSessionsMode = (...);
 
Values
  • rsm_Query: "Session ID" will be sent in the Request "Query"
  • rsm_Cookie: "Session ID" will be sent in the Request "Cookie"
TRtcDataFormatSupport = set of TRtcDataFormat;
 
TRtcDataReqModeSupport = set of TRtcDataReqMode;
 
TRtcSessionsModeSupport = set of TRtcSessionsMode;
 
TRtcFieldTypes = (...);
 
Values
  • ft_Unknown
  • ft_String
  • ft_Smallint
  • ft_Integer
  • ft_Word
  • ft_Boolean
  • ft_Float
  • ft_Currency
  • ft_BCD
  • ft_Date
  • ft_Time
  • ft_DateTime
  • ft_Bytes
  • ft_VarBytes
  • ft_AutoInc
  • ft_Blob
  • ft_Memo
  • ft_Graphic
  • ft_FmtMemo
  • ft_ParadoxOle
  • ft_DBaseOle
  • ft_TypedBinary
  • ft_Cursor
  • ft_FixedChar
  • ft_WideString
  • ft_Largeint
  • ft_ADT
  • ft_Array
  • ft_Reference
  • ft_DataSet
  • ft_OraBlob
  • ft_OraClob
  • ft_Variant
  • ft_Interface
  • ft_IDispatch
  • ft_Guid
  • ft_TimeStamp
  • ft_FMTBcd
  • ft_FixedWideChar: <- D7
  • ft_WideMemo
  • ft_OraTimeStamp
  • ft_OraInterval
  • ft_LongWord: <- D2007
  • ft_Shortint
  • ft_Byte
  • ft_Extended
  • ft_Connection
  • ft_Params
  • ft_Stream
  • ft_TimeStampOffset: <- D2009
  • ft_Object
  • ft_Single
TRtcSessionLockType = (...);

Session lock type

Values
  • sesNoLock: Allow access to anyone. No client data will be used for identifying clients, which means that any client knowing which Session IDs are open, will have access to those sessions, regardless of its IP address or other header values.

    This setting is not recommended for Servers available on the Internet.
  • sesIPLock: Allow access to an opened Session only to Clients coming from the same IP as the client which has created the session.

    This setting is not recommended for Web Applications which need to be accessible by anyone, since people behind proxy servers with changing IP addresses will not be able to "stay logged in" (when their IP changes, they will lose access to their Session).
  • sesFwdLock: This is the default Session Lock setting, which should work for all clients. It will provide maximum security for clients which are NOT behind a proxy server, while still allowing access to clients behind proxy servers with changing IP addresses (the "X-FORWARDED-FOR" header has to be set by the proxy forwarding client requests).

    If the client opening the Session had the "X-FORWARDED-FOR" header set, any client with the same "X-FORWARDED-FOR" header will be allowed access to his Session (it just has to use the same Session ID as the client which has opened/created the session). If "X-FORWARDER-FOR" header was not set by the client creating the session, Peer IP address will be used for client identification.
  • sesIPFwdLock: Session will always be locked to the Peer IP address, *plus* to the "X-FORWARDED-FOR" request header, if it was set for the client which has opened the session.

    This setting is not recommended for Web Applications which need to be accessible to a wide public audience, since people behind proxy servers with changing IP addresses will NOT be able to "stay logged in". When their IP address changes, they will lose access to their Session data and need to log in again.
rtcFloat = double;

Type to use to store Floating-point values (default:double; could be changed to "extended" for maximum precision)

rtcInteger = longint;

Type to use to store Integer values (default:LongInt; could be changed to "int64" for maximum precision)

rtcCardinal = Cardinal;

Type to use to store Cardinal values (default:Cardinal)

rtcLargeInt = int64;

Type to use to store LargeInt values (default:int64)

rtcByteStream = TMemoryStream;

Type to use to store ByteStream data (default:TMemoryStream);

TRtcDataSetAction = (...);

Actions applied to a DataSet (Insert / Update / Delete)

Values
  • rds_None
  • rds_Insert
  • rds_Update
  • rds_Delete
TRtcCustomEvent = procedure(Sender:TObject; Obj:TObject) of object;

TRtcCustomEvent is the event handler type for custom-defined events.

TRtcCustomDataEvent = procedure(Sender:TObject; Obj:TObject; Data:TRtcValue) of object;

TRtcCustomDataEvent is the event handler type for custom-defined data events.

TRtcObjectCallEvent = procedure(Sender:TObject; Param:TRtcObjectCall) of object;
 
TRtcObjectLinkSupport = (...);

RTC Object Link support options

Values
  • ol_None: Object Manager never created (disabled)
  • ol_Manual: Object Manager has to be activated manually
  • ol_AutoServer: Object Manager auto-activated for creation of objects on the Server
  • ol_AutoClient: Object Manager auto-activated for creation of objects on the Client
  • ol_AutoBoth: Object Manager auto-activated for creation of objects on the Client or Server
TRtcObjectConstructor = procedure(Sender:TObject; Param:TRtcObjectCall);

Received request from "Sender" to create object for class "Param.xName" for the Object Manager "Param.Manager" using parameters stored in "Param"

Constants

RTC_ERRORDATA_SPLITTER=#13#10#13#10'--=:eRr.dAtA:=--'#13#10#13#10;

String used with 'fmt_RTC' and 'fmt_XMLRPC' to include "ErrorData" after "ErrorCode" and "ErrorMessage" when serializing Exception information.

RTC_PARSERS_MAXDEPTH=1000;

Maximum allowed nesting depth when parsing "JSON", "XML-RPC" and "RTC Code" input. "RTC_PARSERS_MAXDEPTH" (=1000) will be used as "MaxDepth" parameter in "FromCode", "ObjectFromCode", "from_Code", "FromJSON", "FromJSONrpc", "ObjectFromJSON", "from_JSON", "from_JSONrpc", "FromXMLrpc", "ObjectFromXMLrpc" and "from_XMLrpc" methods where "MaxDepth" paramerer is NOT specified, and ... in direct assignments to "asCode", "asJSON" and "asXMLrpc" properties.

RTC_XMLRPC_DataSetFieldsName='RTC.DATASET.FIELDS';

Member name used in XML-RPC <struct> to enumerate DataSet Fields

RTC_XMLRPC_DataSetRowsName='RTC.DATASET.ROWS';

Member name used in XML-RPC <struct> to enumerate DataSet Rows

RTC_XMLRPC_ParamsAsArrayName='PARAMS';

XML-RPC field name used when sending params to a function as an array rather than a record

RTC_JSON_ParamsAsArrayName='params';

JSON-RPC field name used when sending params to a function as an array rather than a record

RTC_JSON_DataSetFieldsName = '"\/dsfields"';

Reserved parameter name for keeping Field definitions when generating JSON for a DataSet object

RTC_JSON_DataSetRowsName = '"\/dsrows"';

Reserved parameter name for keeping Table rows when generating JSON for a DataSet object

RTC_JSON_FunctionName = '"\/method"';

Reserved parameter name for "FunctionName" when generating JSON for a FunctionInfo object

RTC_JSON_DateTimeStr = '"\/Date(';

Opening String for DateTime values encoded as milliseconds since 1970-01-01

RTC_JSON_DateTimeISOStr = '"\/date\/';

Opening String for DateTime values encoded using the ISO format

RTC_JSON_ByteStreamStr = '"\/base64\/';

Opening String for ByteStream objects encoded as Base64

RTC_JSON_ExceptionStr = '"\/error\/';

Opening String for Exception values

RTC_NIL_OBJECT_ID = 0;
 
RTC_NIL_OBJECT = nil;
 
rtc_HttpDefault = rtc_Http1;

Default HTTP Protocol is HTTP/1.x, for backwards compatibility

RTC_BOOLEAN_TYPES=[rtc_Boolean, rtc_Variant];
 
RTC_EXCEPTION_TYPES=[rtc_Exception, rtc_Variant];
 
RTC_VARIABLE_TYPES=[rtc_Variable, rtc_Variant];
 
RTC_BYTESTREAM_TYPES=[rtc_ByteStream, rtc_ByteArray, rtc_String, rtc_Variant];
 
RTC_STRING_TYPES=[rtc_String, rtc_Text, rtc_WideString, rtc_Variant];
 
RTC_INTEGER_TYPES=[rtc_OID, rtc_Integer, rtc_LargeInt, rtc_Cardinal, rtc_Variant];
 
RTC_FLOAT_TYPES=[rtc_DateTime, rtc_Float, rtc_Currency, rtc_Variant];
 
RTC_RECORD_TYPES=[rtc_Record];
 
RTC_ARRAY_TYPES=[rtc_Array];
 
RTC_FUNCTION_TYPES=[rtc_Function];
 
RTC_DATASET_TYPES=[rtc_DataSet];
 
wf_Cont = 0;

Web Socket - "Continuation" frame

wf_Text = 1;

Web Socket - "Text" frame

wf_Binary = 2;

Web Socket - "Binary" frame

wf_Close = 8;

Web Socket - connection "Close" frame

wf_Ping = 9;

Web Socket - "Ping" frame

wf_Pong = 10;

Web Socket - "Pong" frame

RTC_WSFRAME_OPCODES=[wf_Cont,wf_Text,wf_Binary,wf_Close,wf_Ping,wf_Pong];
 
RTC_TYPE2FULLNAME_CONV: array[TRtcValueTypes] of RtcString = ( 'Null', 'Variable', 'FunctionCall', 'Exception', 'Array', 'Record', 'DataSet', 'Text', 'String', 'WideString', 'Boolean', 'Integer', 'Cardinal', 'LargeInt', 'Float', 'Currency', 'DateTime', 'ByteStream', 'OID', 'ByteArray', 'Variant');

rtc_Null, rtc_Variable, rtc_Function, rtc_Exception, rtc_Array, rtc_Record, rtc_DataSet, rtc_Text, rtc_String, rtc_WideString, rtc_Boolean, rtc_Integer, rtc_Cardinal, rtc_LargeInt, rtc_Float, rtc_Currency, rtc_DateTime, rtc_ByteStream rtc_OID rtc_ByteArray Variant is NOT sent nor received

Variables

LOG_INFO_ERRORS:boolean=False;

Log errors raised from RTC Value object classes?

RTC_REQUEST_COOKIE_MULTILINE:Boolean=False;

Are Request Cookies allowed to spread across multiple lines?

RTC_RESPONSE_COOKIE_MULTILINE:Boolean=True;

Are Response Cookies allowed to spread across multiple lines?

RTC_REQUEST_COOKIE_DELIMITER:RtcChar=';';

Delimiter used to separate Cookies inside HTTP Request Headers

RTC_RESPONSE_COOKIE_DELIMITER:RtcChar=#13;

Delimiter used to separate Cookies inside HTTP Response Headers

RTC_REQUEST_COOKIE_SEPARATOR:RtcString=' ';

Additional separator for Cookies inside HTTP Request Headers (added after Delimiter)

RTC_RESPONSE_COOKIE_SEPARATOR:RtcString='';

Additional separator for Cookies inside HTTP Response Headers (added after Delimiter)

RTC_REQUEST_COOKIE_NAME:RtcString='Cookie';

Header Name used to send Cookies inside HTTP Requests

RTC_REQUEST_COOKIE_NAME_CS:RtcString='COOKIE';

UPPER-CASE version of the Header Name used to send Cookies inside HTTP Requests

RTC_RESPONSE_COOKIE_NAME:RtcString='Set-Cookie';

Header Name used to send Cookies inside HTTP Responses

RTC_RESPONSE_COOKIE_NAME_CS:RtcString='SET-COOKIE';

UPPER-CASE version of the Header Name used to send Cookies inside HTTP Responses

RTC_FORMPOST_CACHESIZE:integer=16000;

Default memory cache size when accepting FormPost data (Param property). When cache memory is full, data will start being written to a temporary file, to reduce memory usage. This temporary file is created and deleted automaticaly by RTC, to keep the usage of the Param property simple.

RTC_FILEUPLOAD_COPYSIZE:integer=128000;

Default memory size used by the GetFile method to copy uploaded file from temporary storage to your specified destination location. Keep this value low to minimize memory usage on the Server, or increase the value if to speed up copying at the cost of higher memory usage.

RTC_MIN_COMPRESS_SIZE:integer=256;

Minimum data size to be compressed when using automatic compression/decompression. Data smaller than this size will not be compressed, to reduce the CPU usage. Default value is 256. Values smaller than 32 bytes will only increase the CPU usage without having any positive effects, because very small data chunks can NOT be compressed (there are at least 10 bytes of header information needed in compressed data).

RTC_JSON_GenEscapeSlash:boolean=True;

JSON Generator: Should we escape the "/" character in JSON, converting it into "\/"? (default=TRUE)

If False, "/" will NOT be changed into "\/" when generating a JSON String. This would make the output String shorter, but it will also make it *impossible* for plain Strings to have a "\/" anywhere, because "/" will remain "/", but "\/" will be converted to "\\/".

If True, all "/" characters in a string or name will be sent as "\/".

RTC_JSON_GenTypedDateTime:boolean=False;

JSON Generator: Encode DateTime type as "\/Date(<milliseconds-since-1970-1-1>)\/" in JSON? (default=FALSE)

When False, asDateTime values will be stored as Strings in JSON, using the ISO DateTime format.

RTC_JSON_GenTypedException:boolean=False;

JSON Generator: Encode Exception type with a "\/error\/" prefix in front of the message string? (default=FALSE)

When False, asException values will be stored using the JSON-RPC format for Errors '{"error":{"code":...'.

RTC_JSON_GenTypedByteStream:boolean=False;

JSON Generator: Encode ByteStram data with a "\/base64\/" prefix in front of the Mime_Encoded stream? (default=FALSE)

When False, there will be no prefix, but asByteStream will still be stored as a String using Base64 encoding.

RTC_JSON_GenTypedFunctions:boolean=False;

JSON Generator: Include FunctionName as "\/method" parameter when encoding a Function object to JSON? (default=FALSE)

When False, asFunction objects will be serialized into JSON based on the "reqVer" parameter.
reqVer=0 -> using REST format, FunctionName is NOT serialized (it should be in the URL).
reqVer=1 -> serializes Function objects using the JSON-RPC 1.0 format.
reqVer=2 -> serializes Function objects using the JSON-RPC 2.0 format.
reqVer=3 -> serializes Function objects using a custom compact version of JSON-RPC (minimal overhead).

RTC_JSON_ParseTypedDateTime:boolean=False;

JSON Parser: Check for typed DateTime values in "\/date\/" and "\/Date(..)\/" and store them as DateTime fields? (default=FALSE)

RTC_JSON_ParseTypedByteStream:boolean=False;

JSON Parser: Check for typed ByteStream (starts with "\/base64\/") and store them as ByteStream objects? (default=FALSE)

RTC_JSON_ParseTypedFunctions:boolean=False;

JSON Parser: Check for typed Functions (FunctionName in "\/method") and store them as Function objects? (default=FALSE)

RTC_JSON_ParseMethodFunctions:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"method":"any-string" and store it as a RTC Function object. (default=FALSE)

RTC_JSON_ParseRPC1:boolean=False;

JSON Parser: Set this to TRUE if you want to enable support for automatic recognition of "JSON-RPC 1.0" objects (functions, errors and results) when using the "FromJSON" method or "asJSON" properties with "TRtcValue" objects (default=FALSE).

NOTE: Also check "RTC_JSON_ParseRPC1Functions", "RTC_JSON_ParseRPC1Errors" and "RTC_JSON_ParseRPC1Results" variables if you want to ENABLE "JSON-RPC 1.0" support when using "FromJSON" and/or "asJSON" directly with TRtcValue objects (default=FALSE).

RTC_JSON_ParseRPC2:boolean=False;

JSON Parser: Set this to TRUE if you want to enable support for automatic recognition of "JSON-RPC 2.0" objects (functions, errors and results) when using the "FromJSON" method or "asJSON" properties with "TRtcValue" objects (default=FALSE).

NOTE: Also check "RTC_JSON_ParseRPC2Functions", "RTC_JSON_ParseRPC2Errors" and "RTC_JSON_ParseRPC2Results" variables if you want to ENABLE "JSON-RPC 2.0" support when using "FromJSON" and/or "asJSON" directly with TRtcValue objects (default=FALSE).

RTC_JSON_ParseRPC1Functions:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"method":"any-string","params":' followed either by '[', '{' or 'null' and store it as a RTC Function object. (default=FALSE)

NOTE: In addition to this global variable, "RTC_JSON_ParseRPC1" should also be TRUE, or nested remote function calls received in "JSON-RPC 1.0" format will NOT be recognized by the "TRtcServerModule" and will be handled as plain records (passed as parameters).

RTC_JSON_ParseRPC1Errors:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"error":{' or '{"result":null,"error":{' followed either by '"code":', '"message":', '"data":' or '"errors":' and store it as a RTC Exception object. (default=FALSE)

NOTE: In addition to this global variable, "RTC_JSON_ParseRPC1" should also be TRUE, or nested "error" objects received in "JSON-RPC 1.0" format will be stored as plain records.

RTC_JSON_ParseRPC1Results:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"result":' - but NOT '{"result":null,"error":{' followed by '"code"', '"message"', '"data"' or '"errors"' (which would make it an Exception object) and store the contents behind "result" directly as a RTC Value object, instead of storing a RTC Record with a sub-record called "result". (default=FALSE)

NOTE: In addition to this global variable, "RTC_JSON_ParseRPC1" should also be TRUE, or nested "JSON-RPC 1.0" results received from the Server will be made accessible as plain records containing a "result" element (result data), "error" element (in case of an error on the Server) and an "id" element (containing the ID sent).

RTC_JSON_ParseRPC2Functions:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"jsonrpc":"2.0","method":"any-string","params":' followed either by '[', '{' or 'null' and store it as a RTC Function object. (default=FALSE)

NOTE: In addition to this global variable, "RTC_JSON_ParseRPC2" should also be TRUE, or nested remote function calls received in "JSON-RPC 2.0" format will NOT be recognized by the "TRtcServerModule" component and will be handled as records (passed as parameters).

RTC_JSON_ParseRPC2Errors:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"jsonrpc":"2.0","error":{' or '{"jsonrpc":"2.0","result":null,"error":{' followed either by '"code":', '"message":', '"data":' or '"errors"' and store it as a RTC Exception object. (default=FALSE)

NOTE: In addition to this global variable, "RTC_JSON_ParseRPC2" should also be TRUE, or nested "error" objects received in "JSON-RPC 2.0" format will be stored as records with elements named "jsonrpc", "error" and "id" instead of RTC Exception objects.

RTC_JSON_ParseRPC2Results:boolean=False;

JSON Parser: Set this to TRUE if you want the "FromJSON" method and "asJSON" properties to check if JSON contains '{"jsonrpc":"2.0","result":' - but NOT '{"jsonrpc":"2.0","result":null,"error":{' followed by '"code"', '"message"', '"data"' or '"errors"' (which would make it an Exception object) and store the contents behind "result" as a RTC Value object instead of a RTC Record with a sub-record called "result". (default=FALSE)

NOTE: In addition to this global variable, "RTC_JSON_ParseRPC2" should also be TRUE, or nested "JSON-RPC 2.0" results received from the Server will be made accessible as records containing a "jsonrpc" element ("2.0"), "result" element (result data), "error" element (in case of an error) and an "id" element (containing the ID sent).

RTC_JSON_ParseTypedDataSet:boolean=False;

JSON Parser: Check for typed DataSets ("\/dsfields" and "\/dsrows" in an record) and store them as DataSet objects? (default=FALSE)

RTC_JSON_ParseTypedException:boolean=False;

JSON Parser: Check for typed Exceptions (starts with "\/error\/") and store them as Exception type? (default=FALSE)

RTC_XMLRPC_GreaterStringEscape:boolean=False;

XML-RPC Encoder: Escape the >, " and ' characters inside XML-RPC Strings (NOT required by the XML-RPC specification). (default=FALSE)

RTC_HT_SchemeDefault:TRtcHeaderFieldTypes=ht_Default;

Default HTTP/2 Header Field Type for "Request.Scheme"

RTC_HT_MethodDefault:TRtcHeaderFieldTypes=ht_Default;

Default HTTP/2 Header Field Type for "Request.Method"

RTC_HT_URIDefault:TRtcHeaderFieldTypes=ht_Default;

Default HTTP/2 Header Field Type for "Request.URI"

RTC_HT_CookieDefault:TRtcHeaderFieldTypes=ht_Default;

Default HTTP/2 Header Field Type for "Request.Cookie" and "Response.Cookie"

RTC_HT_StatusDefault:TRtcHeaderFieldTypes=ht_Default;

Default HTTP/2 Header Field Type for "Response.StatusCode"

RTC_HT_Default:TRtcHeaderFieldTypes=ht_Default;

Default HTTP/2 Header Field Type for all other Header fields

RTC_HTTP2_HostIsAuthority:boolean=TRUE;

When using HTTP/2, if "RTC_HTTP2_HostIsAuthority" is set to TRUE (default), the "Host" header field will be encoded as the ":authority" pseudo-header field. Otherwise, the "Host" header field is encoded as "host" when using HTTP/2. NOTE: "host" and ":authority" fields have the same purpose in HTTP/2, but ... if the ":authority" header fields is present in a HTTP/2 header, the "host" header field will be IGNORED by most HTTP/2 implementations.


Generated by PasDoc 0.14.0.