* PChar -> PAnsiChar

This commit is contained in:
Michaël Van Canneyt 2023-01-13 23:44:50 +01:00
parent 4a15ca0cbe
commit 9c680b6669
9 changed files with 31 additions and 31 deletions

View File

@ -375,7 +375,7 @@ begin
if (ALine<>'') then
S:=StringOfChar(' ',FIndent)+ALine;
S:=S+sLineBreak;
FStream.WriteBuffer(S[1],Length(s)*SizeOf(Char));
FStream.WriteBuffer(S[1],Length(s)*SizeOf(AnsiChar));
end;
procedure TCustomPasGenerator.Line(const Fmt: String; Args: array of const);

View File

@ -150,7 +150,7 @@ type
{$IFDEF USE_UNICODE}
TSDOChar = WideChar;
{$ELSE USE_UNICODE}
TSDOChar = Char;
TSDOChar = AnsiChar;
{$ENDIF USE_UNICODE}
{$ENDIF HAS_SDO_CHAR}
{$IFDEF HAS_SDO_CURRENCY}
@ -300,13 +300,13 @@ type
['{76F00A3A-A6F8-4D78-8514-570207853453}']
{ getName returns the name of the type
*
* This method returns a const char* name of the type.
* This method returns a const AnsiChar* name of the type.
}
function getName() : string;
{ getAlias returns the n'th alias
*
* This method returns a const char* corresponding to the
* This method returns a const AnsiChar* corresponding to the
* alias at index n of the list of aliases. Use getAliasCount to
* discover the size of the list.
}
@ -434,7 +434,7 @@ type
{ getAlias returns the n'th alias
*
* This method returns a const char* corresponding to the
* This method returns a const AnsiChar* corresponding to the
* alias at index n of the list of aliases. Use getAliasCount to
* discover the size of the list.
}
@ -851,7 +851,7 @@ type
procedure setBoolean(const APropertyIndex : PtrUInt; const AValue : TSDOBoolean); overload;
procedure setBoolean(const AProperty : ISDOProperty; const AValue : TSDOBoolean); overload;
{ getByte returns a char by path, index or property
{ getByte returns a AnsiChar by path, index or property
*
* Returns the value of a property of either this object or an object
* reachable from it, as identified by the specified path.
@ -912,7 +912,7 @@ type
procedure setBytes(const AProperty : ISDOProperty; AValue : TSDOBytes);overload;
{$ENDIF HAS_SDO_BYTES}
{ getString returns a wide char buffer
{ getString returns a wide AnsiChar buffer
*
* A DataObject of type String holds an array of wide characters as its value. These
* methods transfer the contents of that buffer into an array of wchar_t allocated
@ -1068,11 +1068,11 @@ type
* just a place to store anything for later retrieval.
}
{virtual SDO_API void setUserData(const char* path,void* value) = 0;
{virtual SDO_API void setUserData(const AnsiChar* path,void* value) = 0;
virtual SDO_API void setUserData(unsigned int propertyIndex, void* value) = 0;
virtual SDO_API void setUserData(const Property& property, void* value) = 0;
virtual SDO_API void setUserData(void* value) = 0;
virtual SDO_API void* getUserData(const char* path) = 0;
virtual SDO_API void* getUserData(const AnsiChar* path) = 0;
virtual SDO_API void* getUserData(unsigned int propertyIndex) = 0;
virtual SDO_API void* getUserData(const Property& property) = 0;
virtual SDO_API void* getUserData() = 0;
@ -1085,7 +1085,7 @@ type
}
{virtual SDO_API SequencePtr getSequence() = 0;
virtual SDO_API SequencePtr getSequence(const char* path) = 0;
virtual SDO_API SequencePtr getSequence(const AnsiChar* path) = 0;
virtual SDO_API SequencePtr getSequence(unsigned int propertyIndex) = 0;
virtual SDO_API SequencePtr getSequence(const Property& property) = 0;
}
@ -1155,7 +1155,7 @@ type
* object from the root data object of the graph.
}
//virtual SDO_SPI const char* objectToXPath() = 0;
//virtual SDO_SPI const AnsiChar* objectToXPath() = 0;
end;

View File

@ -531,7 +531,7 @@ end;
//--------------- END: Byte procs -----------------------------
{$IFDEF HAS_SDO_BYTES}
//--------------- START : Char procs -----------------------------
//--------------- START : AnsiChar procs -----------------------------
procedure listUndo_append_bytes(const AList : ISDODataObjectList; const AItm : TManyValuePropRecordData);
begin
if not AList.getCursor().MoveLast() then
@ -574,7 +574,7 @@ end;
{$ENDIF HAS_SDO_BYTES}
{$IFDEF HAS_SDO_CHAR}
//--------------- START : Char procs -----------------------------
//--------------- START : AnsiChar procs -----------------------------
procedure listUndo_append_char(const AList : ISDODataObjectList; const AItm : TManyValuePropRecordData);
begin
if not AList.getCursor().MoveLast() then
@ -613,7 +613,7 @@ begin
raise ESDOInvalidStateOperationException.Create('listUndo_change_char');
AList.setCharacter(AItm.Index,AItm.Value.CharValue);
end;
//--------------- END: Char procs -----------------------------
//--------------- END: AnsiChar procs -----------------------------
{$ENDIF HAS_SDO_CHAR}
{$IFDEF HAS_SDO_CURRENCY}

View File

@ -244,7 +244,7 @@ var
buffer : string;
bufferPos, bufferLen : Integer;
function ReadInt(out AValue : Integer; const ASeparatorAtEnd : Char) : Boolean;
function ReadInt(out AValue : Integer; const ASeparatorAtEnd : AnsiChar) : Boolean;
var
locStartPos : Integer;
begin
@ -482,7 +482,7 @@ var
buffer : string;
bufferPos, bufferLen : Integer;
function ReadInt(out AValue : Integer; const ASeparatorAtEnd : Char) : Boolean;
function ReadInt(out AValue : Integer; const ASeparatorAtEnd : AnsiChar) : Boolean;
var
locStartPos : Integer;
begin
@ -650,7 +650,7 @@ function xsd_TryStrToDuration(
out AResult : TDurationRec
) : Boolean;
var
pc : PChar;
pc : PAnsiChar;
locIntBuffer : array[dpYear..dpFractionalSecond] of PtrUInt;
i, bufferLength, lastPos : PtrInt;
localBuffer : string;
@ -662,7 +662,7 @@ begin
bufferLength := Length(ABuffer);
if ( bufferLength < 3 ) then
Exit;
pc := PChar(ABuffer);
pc := PAnsiChar(ABuffer);
i := 1;
isNeg := False;
if ( pc^ = '-' ) then begin

View File

@ -159,7 +159,7 @@ function StringToVarBytes(const AValue : string) : TSDOBytes;
var
c : Integer;
begin
c := Length(AValue) * SizeOf(Char);
c := Length(AValue) * SizeOf(AnsiChar);
SetLength(Result,c);
if ( c > 0 ) then
Move(AValue[1],Result[Low(Result)],c);

View File

@ -106,7 +106,7 @@ uses StrUtils, sdo_rtti_filters;
const LANGAGE_TOKEN : array[0..127] of string = (
'ABSOLUTE', 'ABSTRACT', 'AND', 'ARRAY', 'AS', 'ASM',
'BEGIN', 'BOOLEAN', 'BYTE',
'CASE', 'CDECL', 'CHAR', 'CLASS', 'COMP', 'CONST', 'CONSTRUCTOR', 'CONTAINS',
'CASE', 'CDECL', 'AnsiChar', 'CLASS', 'COMP', 'CONST', 'CONSTRUCTOR', 'CONTAINS',
'CURRENCY', 'DEFAULT', 'DEPRECATED', 'DESTRUCTOR', 'DISPINTERFACE', 'DISPOSE', 'DIV', 'DO',
'DOUBLE', 'DOWNTO', 'DYNAMIC', 'END', 'EXCEPT', 'EXIT', 'EXPORT', 'EXPORTS',
'EXTERNAL', 'FALSE', 'FAR', 'FILE', 'FINALIZATION', 'FINALLY', 'FOR',
@ -116,7 +116,7 @@ const LANGAGE_TOKEN : array[0..127] of string = (
'LABEL', 'LIBRARY', 'LOCAL', 'LONGINT', 'LONGWORD',
'MOD', 'NEAR', 'NEW', 'NIL', 'NODEFAULT', 'NOT',
'OBJECT', 'OF', 'OLEVARIANT', 'ON', 'OPERATOR', 'OR', 'OUT', 'OVERLOAD',
'OVERRIDE','PACKAGE', 'PACKED', 'PASCAL', 'PCHAR', 'PRIVATE', 'PROCEDURE',
'OVERRIDE','PACKAGE', 'PACKED', 'PASCAL', 'PAnsiChar', 'PRIVATE', 'PROCEDURE',
'PROGRAM', 'PROPERTY', 'PROTECTED', 'PUBLIC', 'PUBLISHED',
'RAISE', 'READ', 'REAL', 'RECORD', 'REGISTER', 'REINTRODUCE', 'REPEAT',
'REQUIRES', 'RESOURCESTRING', 'RESULT', 'SAFECALL', 'SELF', 'SET', 'SHL',
@ -128,8 +128,8 @@ const LANGAGE_TOKEN : array[0..127] of string = (
const SDO_RESERVED_TOKEN : array[0..1] of string = ( 'Item', 'Item' );
function IsReservedKeyWord(const AValue : string):Boolean ;
begin
Result := AnsiMatchText(AValue,LANGAGE_TOKEN) or
AnsiMatchText(AValue,SDO_RESERVED_TOKEN);
Result := MatchText(AValue,LANGAGE_TOKEN) or
MatchText(AValue,SDO_RESERVED_TOKEN);
end;
function IsStrEmpty(Const AStr : String):Boolean;
@ -212,11 +212,11 @@ end;
function DecodeLineBreak(const AInStr : string) : string;
var
i, c : PtrInt;
pc : PChar;
pc : PAnsiChar;
tmp, res : string;
begin
res := '';
pc := PChar(AInStr);
pc := PAnsiChar(AInStr);
i := 1;
c := Length(AInStr);
while ( i <= c ) do begin
@ -238,7 +238,7 @@ begin
tmp := res;
res := '';
pc := PChar(tmp);
pc := PAnsiChar(tmp);
i := 1;
c := Length(tmp);
while ( i <= c ) do begin

View File

@ -734,7 +734,7 @@ end;
constructor TSDOCharacterType.Create(const AOwner : ISDODataFactory);
begin
inherited Create(AOwner, 'Character',sdo_namespace);
setAlias('Char');
setAlias('AnsiChar');
setAlias('WideChar');
setAlias('AnsiChar');
end;

View File

@ -88,9 +88,9 @@ begin
SetLength(Result,l);
for i := 1 to l do begin
case j of
1 : Result[i] := Char(RandomRange(Ord('a'),Ord('z')));
2 : Result[i] := Char(RandomRange(Ord('0'),Ord('9')));
3 : Result[i] := Char(RandomRange(Ord('A'),Ord('Z')));
1 : Result[i] := AnsiChar(RandomRange(Ord('a'),Ord('z')));
2 : Result[i] := AnsiChar(RandomRange(Ord('0'),Ord('9')));
3 : Result[i] := AnsiChar(RandomRange(Ord('A'),Ord('Z')));
end;
j := ( j + 1 );
if ( j > 3 ) then

View File

@ -682,7 +682,7 @@ end;
procedure TUtilsProc_Test.GetNextToken_test();
var
buffer, x : string;
sep : Char;
sep : AnsiChar;
begin
sep := ';';
buffer := '';