C++ Classes that Support the Object Pascal Language

From Appmethod Topics
Jump to: navigation, search

Go Up to Language Support for the Appmethod Libraries (C++)

Some Object Pascal data types and language constructs that do not have a built-in C++ counterpart are implemented in C++ as classes or structs. Class templates are also used to implement data types as well as Object Pascal language constructs, like set, from which a specific type can be declared. The declarations for these are found in the following header files:

Header File    Classes Defined

SmallString and ShortString (fixed-character strings)
AnsiStringT, AnsiString and UTF8String (single-byte strings)


WideString (BSTR wrapper for interfacing with COM)


Macros and C++ stream operators (>) for some Object Pascal types (AnsiString, UnicodeString, SmallString, Currency, TDateTime, and Variant)

syscomp.h Comp (floating-point type for backwards compatibility)
syscurr.h Currency (for monetary values)
sysdyn.h DynamicArray (generic resizable Object Pascal-style array type)

Contains macros designed for the Object Pascal compilers to use when compiling the Appmethod libraries: PACKAGE, PASCALIMPLEMENTATION, DELPHICLASS, DYNAMIC, HIDESBASEDYNAMIC and HIDESBASE, DECLSPEC_DRTTI, DECLSPEC_DRECORD, BEGIN MESSAGE MAP, the class StaticArray (to allow Object Pascal code to return arrays from functions)

sysopen.h OpenArray type and OPENARRAY(), ARRAYOFCONST(), EXISTINGARRAY(), ARRAYSIZE() and SLICE() macros (to pass open array arguments to Object Pascal)
sysset.h Set (Object Pascal-compatible typed bitset class)
systdate.h TDateTime (type to store date/time, with supplemental methods for easy consumption and conversion)
systobj.h TObject (ultimate base class for Object Pascal-style classes), DelphiInterface (general-purpose smart-pointer for interfaces), interface_cast (to cast between different interfaces or between interfaces and objects), TInterfacedObject, TCppInterfacedObject, TAgreggatedObject, TCppAgreggatedObject, TContainedObject (base classes for classes that implement interfaces), TCustomAttribute (base class for custom Object Pascal attributes)
systvar.h TVarRec (Object Pascal open array support; don't use manually, use OPENARRAY() and ARRAYOFCONST() macros)
systvari.h OleVariant (encapsulates COM Variant type) and Variant (encapsulates the Object Pascal Variant type)
ustring.h UnicodeString (UTF-16 string type)

The classes implemented in these header files were created to support native types used in Object Pascal routines. They are intended to be used when calling these routines in Appmethod library-based code.

See Also