GH Freebrary is a general purpose class library for modern versions of Delphi. This is a beta version, all units compile in Delphi XE7.
Pascal
Latest commit 70a057a Nov 20, 2016 @algonzalez74 committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
GHF.ClassList.pas Add files via upload Nov 16, 2016
GHF.Component.pas Add files via upload Nov 16, 2016
GHF.ControlledObserver.pas Add files via upload Nov 16, 2016
GHF.CustomAttr.pas Add files via upload Nov 16, 2016
GHF.CustomEnumerator.pas Add files via upload Nov 16, 2016
GHF.CustomRetrieve.pas Add files via upload Nov 16, 2016
GHF.Design.PersistentListCountProp.pas Add files via upload Nov 16, 2016
GHF.Design.PersistentListDesigner.pas Add files via upload Nov 16, 2016
GHF.Design.PersistentListItemProp.pas Add files via upload Nov 16, 2016
GHF.Design.PersistentListProp.pas Add files via upload Nov 16, 2016
GHF.Design.pas Add files via upload Nov 16, 2016
GHF.Design.res Add files via upload Nov 16, 2016
GHF.Dic.pas Add files via upload Nov 16, 2016
GHF.ENLang.pas Add files via upload Nov 16, 2016
GHF.FDConnection.pas Add files via upload Nov 16, 2016
GHF.Form.pas Add files via upload Nov 16, 2016
GHF.InterfacedObj.pas Add files via upload Nov 16, 2016
GHF.InterfacedSingleton.pas Add files via upload Nov 16, 2016
GHF.KeyRetrieve.pas Add files via upload Nov 16, 2016
GHF.Lang.pas Add files via upload Nov 16, 2016
GHF.LatinScriptLang.pas Add files via upload Nov 16, 2016
GHF.List.pas Add files via upload Nov 16, 2016
GHF.ListDic.pas Add files via upload Nov 16, 2016
GHF.MutableObjExt.pas Add files via upload Nov 16, 2016
GHF.ObjExt.pas Add files via upload Nov 16, 2016
GHF.ObjList.pas Add files via upload Nov 16, 2016
GHF.Obs.pas Add files via upload Nov 16, 2016
GHF.ObsEx.pas Add files via upload Nov 16, 2016
GHF.Observer.pas Add files via upload Nov 16, 2016
GHF.OpenXMLPart.pas Add files via upload Nov 16, 2016
GHF.OpenXMLRels.pas Add files via upload Nov 16, 2016
GHF.OpenXMLSpreadsheet.pas Add files via upload Nov 16, 2016
GHF.OpenXMLSpreadsheetStrs.pas Add files via upload Nov 16, 2016
GHF.OwnedCollection.pas Add files via upload Nov 16, 2016
GHF.Persistent.pas Add files via upload Nov 16, 2016
GHF.PersistentList.pas Add files via upload Nov 16, 2016
GHF.RTTI.pas Add files via upload Nov 16, 2016
GHF.RTTIInstanceType.pas Add files via upload Nov 16, 2016
GHF.SQL.pas Add files via upload Nov 16, 2016
GHF.Singleton.pas Add files via upload Nov 16, 2016
GHF.StrList.pas Add files via upload Nov 16, 2016
GHF.Sys.pas Add files via upload Nov 16, 2016
GHF.SysEx.pas Add files via upload Nov 16, 2016
GHF.TypeListDic.pas Add files via upload Nov 16, 2016
GHF.VCL.pas Add files via upload Nov 16, 2016
GHF.VCLObjList.pas Add files via upload Nov 16, 2016
GHF.Win.pas Add files via upload Nov 16, 2016
GHF.XMLDoc.pas Add files via upload Nov 16, 2016
License.txt Add files via upload Nov 16, 2016
README.md Update README.md Nov 20, 2016

README.md

GH Freebrary

GH Freebrary is a general purpose class library for modern versions of Delphi. This is a beta release, all units compile in Delphi XE7.

Compare the following two code blocks (the first one borrowed from stackoverflow.com).

(1) A method to get a hypothetical DisplayLabel RTTI attribute of a given class, NOT using GH Freebrary:

implementation

uses
  Rtti;

class function TArtifactInspector.DisplayLabelFor(AClass: TClass): string;
var
  RttiContext: TRttiContext;
  RttiType: TRttiType;
  Attribute: TCustomAttribute;
begin
  RttiContext := TRttiContext.Create;
  try
    RttiType := RttiContext.GetType(AClass);
    for Attribute in RttiType.GetAttributes do
      if Attribute is DisplayLabelAttribute then
        Exit(DisplayLabelAttribute(Attribute).Text);
    Result := '';
  finally
    RttiContext.Free;
  end;
end;

(2) Same method using GH Freebrary:

implementation

uses
  GHF.SysEx, GHF.RTTI;

class function TArtifactInspector.DisplayLabelFor(AClass: TClass): string;
var
  Attribute: DisplayLabelAttribute;
begin
  if AClass.ghClassInfo.ghGetAttr<DisplayLabelAttribute>(Attribute) then
    Result := Attribute.Text
  else
    Result := '';
end;

When I was 16 years old, Professor De Lira revealed to me that in Turbo Pascal there was a file type called unit. Since then I write .pas code that aims to make life easier. And I still feel the same emotion when I see the results!

Use GHF if you agree that most of the code written for a complex software solution should be located below the layer that such a solution represents, not inside it.

Any suggestions or contributions will be greatly appreciated.

Al Gonzalez.