What's new in the Delphi (and C++Builder) run time library (or RTL) in XE7, compared to the classic Xe2 version? There is likely way more than you thought! While I don't have time to delve into each and every of these new features, this is a summary, based on a direct unit to unit comparison. Another reason to upgrade to XE7 taking advantage of the offers expiring in a week: www.embarcadero.com/radoffer. Now to the actual content...

The RTL in XE7

The Delphi Run-Time Library (or RTL) sees continuous enhancements from version to version. To offer an overview of what’s new in the recent versions, comparing the XE7 version with the XE2 version, I’ve compiled a list of what’s new in the RTL, listing the classes of brand new units (and describing their role) and new classes in existing unit.

New Units for Bluetooth Support

  • System.Bluetooth.pas: This unit has a new architecture for Bluetooth support. Classes include TBluetoothManager, TBluetoothAdapter, TBluetoothDevice, TBluetoothSocket, TBluetoothServerSocket
  • System.Android.Bluetooth.pas, System.Mac.Bluetooth.pas, System.Win.Bluetooth.pas: units implement Bluetooth support, by defining adapters for the specific platform
  • System.Bluetooth.Components.pas: Defines the Bluetooth LE component (TBluetoothLE)

New Units for Device Information Support

  • System.Devices.pas: Core TDeviceInfo structure used at design time by the multi-device designer and at run time for the physical device information
  • System.Android.Devices.pas, System.iOS.Devices.pas, System.Mac.Devices.pas, System.Win.Devices.pas: Units with platform specific device definitions

New Units for Sensors Support

  • System.Sensors.pas: Core sensor classes and architecture like TCustomSensor, TSensorManager, TCustomEnvironmentalSensor, TCustomMotionSensor, TCustomOrientationSensor, TCustomElectricalSensor, TCustomMechanicalSensor, TCustomBiometricSensor, TCustomLightSensor, TCustomScannerSensor, TGeocoder, TGpsStatus,
  • System.Android.Sensors.pas, System.iOS.Sensors.pas, System.Mac.Sensors.pas, System.Win.Sensors.pas: Platform specific sensors code with definitions of TPlatformSensorManager, TPlatformGeocoder, TPlatformGpsStatus and the platform specific sensors definitions
  • System.Sensors.Components.pas: This unit defines the components for various available sensors

New Units With “Moved” Code

  • System.Actions.pas: This unit contains the TBasicAction and TContainedActionList classes that are the core classes for Actions and the TActionList component that were originally in the VCL and are now shared between VCL and FMX.
  • System.JSON.pas: Include s large set of JSON processing classes (TJSONValue and inherited classes like TJSONObject and TJSONArray), previously found in the DBXJSON unit
  • System.NetEncoding.pas: a set of Internet-related encodings, previously found is separate units, spread out in different systems (SOAP, Indy, and so on). Classes in this unit include TBase64Encoding, TURLEncoding, and THTMLEncoding.
  • System.Math.Vectors.pas defines data structures that were originally in FireMonkey: the records TVector, TPoint3D, TMatrix, TVector3D, TMatrix3D, TQuaternion3D and other functions and types

New Units with Mobile Oriented Features

  • System.Messaging.pas: Defines the TMessageManager and TMessage<T> classes, used for example for the Push Notifications.
  • System.PushNotification.pas: Support for mobile push notifications, with TPushService, TPushServiceConnection, TPushServiceManager, and TPushServiceNotification
  • System.StartUpCopy.pas includes basic code to handle deployment of files in bundles of mobile applications

New Units with API Level Wrapping

  • System.Sqlite.pas includes low level SQLite3 database interfaces
  • System.Win.Taskbar.pas: The code behind the the taskbar button component, including the TWinTaskbar class
  • System.Win.TaskbarCore.pas: Core support code of the taskbar button, with classes like TTaskbarHandler, TPreviewClipRegion, TThumbButtonActionLink, and TThumbBarButtonListBase
  • There are 62 new units in the new android subfolder, all starting with Androidapi. I’m not even going to list them here, like those in the following groups
  • There are 21 new units in the new ios subfolder, all starting with iOSapi
  • There are 14 new units in the existing osx subfolder, all starting with Macapi
  • There is 1 new unit (Posix.NetinetUDP) in the posix subfolder
  • There are 18 new units in the existing win subfolder, all starting with Winapi. These are actually worth listing, given they are available also to VCL developers:
    • Winapi.Bluetooth.pas
    • Winapi.BluetoothLE.pas
    • Winapi.D3D10_1.pas
    • Winapi.D3D11.pas
    • Winapi.D3D11sdklayers.pas
    • Winapi.D3D11Shader.pas
    • Winapi.D3DCommon.pas
    • Winapi.Functiondiscovery.pas
    • Winapi.Locationapi.pas
    • Winapi.MLang.pas
    • Winapi.msxmlIntf.pas
    • Winapi.OpenGLext.pas
    • Winapi.PenInputPanel.pas
    • Winapi.Portabledevicetypes.pas
    • Winapi.Sensors.pas
    • Winapi.Sensorsapi.pas
    • Winapi.UserEnv.pas
    • Winapi.Wbem.pas

The Parallel Programming Library

  • System.Threading.pas: This unit is the home of the XE7 parallel programming library, defining parallel for, tasks, and futures. This has been covered extensively and a few lines won’t really explain it. Anyway, this unit defines interfaces like ITask and IFuture<T> and classes like TThreadPool, TThreadPoolMonitor, TWorkerData, TBaseWorkerThread, TTask, TFuture<T>, and TParallel. There is a lot more in this rather large unit, as I mentioned. A starting point for exploration could be community.embarcadero.com/index.php/blogs/entry/parallel-programming-using-the-new-rad-studio-xe7-runtime-library

New Classes, Records, and Types in Existing Units

  • In System.Characters.pas unit: new TCharHelper = record helper for Char
  • In System.Classes.pas unit: new attributes (inheriting from TCustomAttribute) like DefaultAttribute, NoDefaultAttribute, StoredAttribute, ObservableMemberAttribute
  • In System.Generics.Collections.pas: new classes TMoveArrayManager<T> and TManualArrayManager<T> supporting weak references, plus TThreadList<T>
  • In System.SysUtils.pas there is a TMarshaller record for API/operating system data marshaling, and there are many intrinsic type helpers like TSingleHelper, TDoubleHelper, TExtendedHelper, TByteHelper, TShortIntHelper, TSmallIntHelper, TWordHelper, TCardinalHelper, TIntegerHelper, TInt64Helper, TUInt64Helper, TNativeIntHelper, TNativeUIntHelper, TBooleanHelper, TByteBoolHelper, TWordBoolHelper, and TLongBoolHelper.
  • In System.pas there is the TCustomAttribute class, the TTypeKind enumeration (moved from another, lower unit), the TPtrWrapper (an opaque pointer wrapper), the TMarshal class (again for low-level, API call data marshaling)

That is all for now. I might follow up with another blog post linking to actual documentation and training videos about some of these features, but googling the unit names of their descriptions should provide enough information to get you started. 

 PS: Happy Christmas to those who celebrate this holiday