[fpc-devel] bug report 20473: Please add a directive to define string=utf8string

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Thu Oct 13 10:23:12 CEST 2011


On Thu, Oct 13, 2011 at 10:17 AM, Marco van de Voort <marcov at stack.nl> wrote:
> How do you override classes that are declared in RTLString which might not
> be equal to utf8string?

I dont fully understand your question, but lets suppose this RTL file:

unit system;
{$mode string = banana}
type RTLString = string;

unit classes;
{$mode string = banana}
type
  TWhaeverClass = class
  procedure Do(Param: string); virtual;
  end;

unit mylazarusunit;
{$mode string = utf8string}
type
  TWhaeverClassOverride = class(TWhaeverClass)
  procedure Do(Param: RTLString); override;
  end;

I think that this would work,  because the signatures of the
procedures match perfectly.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-devel mailing list