rttih.inc 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2014 by Maciej Izak
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. {$IF DEFINED(CPU8) OR DEFINED(CPU16)}
  11. { disable the extended RTTI for the RTL/FCL on these targets; the user can of
  12. course still enable it for their own classes if needed (and published
  13. properties and methods are accessible using the legacy RTTI as well) }
  14. {$DEFINE SMALLRTTI}
  15. {$ENDIF}
  16. {$PUSH}
  17. {$MINENUMSIZE 1 this saves a lot of memory }
  18. type
  19. { If you change one of the following enumeration types you have also to
  20. change the compiler and unit typeinfo in an appropriate way!
  21. Also if you add managed types you'll need to update tkManagedTypes in
  22. rtti.inc }
  23. TTypeKind = (tkUnknown,tkInteger,tkChar,tkEnumeration,tkFloat,
  24. tkSet,tkMethod,tkSString,tkLString,tkAString,
  25. tkWString,tkVariant,tkArray,tkRecord,tkInterface,
  26. tkClass,tkObject,tkWChar,tkBool,tkInt64,tkQWord,
  27. tkDynArray,tkInterfaceRaw,tkProcVar,tkUString,tkUChar,
  28. tkHelper,tkFile,tkClassRef,tkPointer);
  29. TVisibilityClass = (vcPrivate, vcProtected, vcPublic, vcPublished);
  30. TVisibilityClasses = set of TVisibilityClass;
  31. {$MINENUMSIZE DEFAULT}
  32. const
  33. {$IFNDEF SMALLRTTI}
  34. DefaultFieldRttiVisibility = [vcPrivate..vcPublished];
  35. DefaultMethodRttiVisibility = [vcPublic..vcPublished];
  36. DefaultPropertyRttiVisibility = [vcPublic..vcPublished];
  37. {$ELSE SMALLRTTI}
  38. DefaultFieldRttiVisibility = [];
  39. DefaultMethodRttiVisibility = [];
  40. DefaultPropertyRttiVisibility = [];
  41. {$ENDIF SMALLRTTI}
  42. {$POP}
  43. const
  44. { some Delphi-compatible aliases }
  45. tkAnsiChar = tkChar;
  46. tkWideChar = tkWChar;
  47. tkShortString = tkSString;
  48. tkAnsiString = tkAString;
  49. tkWideString = tkWString;
  50. tkUnicodeString = tkUString;
  51. {$ifdef FPC_HAS_FEATURE_RTTI}
  52. procedure InitializeArray(p, typeInfo: Pointer; count: SizeInt);
  53. procedure FinalizeArray(p, typeInfo: Pointer; count: SizeInt);
  54. procedure CopyArray(dest, source, typeInfo: Pointer; count: SizeInt);
  55. {$endif FPC_HAS_FEATURE_RTTI}