Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 15-03-2009
JXJ JXJ is offline
Miembro
 
Registrado: abr 2005
Posts: 2.475
Poder: 22
JXJ Va por buen camino
si asi es....es un arrary de pchar..

estoy convirtiendo la version modificada de synedit.
el synedit Studio..

para que sea compatible con delphi 2009 win32

http://yaoqiaofeng.blog.163.com/blog...7101974839201/

de aqui lo descargas.

http://www.box.net/shared/jt3hcg79zr

LongWord(pc^) := $3D3D3D3D;

es el archivo simplexml.pas
hasta donde he logrado convertir a delphi 2009 win32
por que una vez compilado e instalador pasare a su uso y ver si todo va bien.

la unidad con la definicion de pchars

Código Delphi [-]

unit SimpleXML;

{$I SynUniHighlighter.inc}

interface

uses
  Windows, SysUtils, Classes;

const
  BinXmlSignatureSize = Length('< binary-xml >');
  BinXmlSignature: String = '< binary-xml >';

  BINXML_USE_WIDE_CHARS = 1;
  BINXML_COMPRESSED = 2;

  XSTR_NULL = '{{null}}';
  
  NODE_INVALID = $00000000;
  NODE_ELEMENT = $00000001;
  NODE_ATTRIBUTE = $00000002;
  NODE_TEXT = $00000003;
  NODE_CDATA_SECTION = $00000004;
  NODE_ENTITY_REFERENCE = $00000005;
  NODE_ENTITY = $00000006;
  NODE_PROCESSING_INSTRUCTION = $00000007;
  NODE_COMMENT = $00000008;
  NODE_DOCUMENT = $00000009;
  NODE_DOCUMENT_TYPE = $0000000A;
  NODE_DOCUMENT_FRAGMENT = $0000000B;
  NODE_NOTATION = $0000000C;


implementation

uses
{$IFDEF SYN_COMPILER_6_UP}
  Variants, DateUtils;
{$ELSE}
  SimpleXML_D5Emulate;
{$ENDIF}


function IsXmlDataString(const aData: String): Boolean;
var
  i: Integer;
begin
  Result := Copy(aData, 1, BinXmlSignatureSize) = BinXmlSignature;
  if not Result then begin
    i := 1;
    while (i <= Length(aData)) and (aData[i] in [#10, #13, #9, ' ']) do
      Inc(i);
    Result := Copy(aData, i, Length(')) = ';
  end;
end;

function XmlIsInBinaryFormat(const aData: String): Boolean;
begin
  Result := Copy(aData, 1, BinXmlSignatureSize) = BinXmlSignature
end;

var
  Base64Map: array [0..63] of Char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

type
  PChars = ^TChars;
  TChars = packed record a, b, c, d: Char end;
  POctet = ^TOctet;
  TOctet = packed record a, b, c: Byte; end;

procedure OctetToChars(po: POctet; aCount: Integer; pc: PChars);

var
  o: Integer;
begin
  if aCount = 1 then begin
    o := po.a shl 16;
    LongWord(pc^) := $3D3D3D3D;
    pc.a := Base64Map[(o shr 18) and $3F];
    pc.b := Base64Map[(o shr 12) and $3F];
  end
  else if aCount = 2 then begin
    o := po.a shl 16 or po.b shl 8;
    LongWord(pc^) := $3D3D3D3D;
    pc.a := Base64Map[(o shr 18) and $3F];
    pc.b := Base64Map[(o shr 12) and $3F];
    pc.c := Base64Map[(o shr 6) and $3F];
  end
  else if aCount > 2 then begin
    o := po.a shl 16 or po.b shl 8 or po.c;
    LongWord(pc^) := $3D3D3D3D;
    pc.a := Base64Map[(o shr 18) and $3F];
    pc.b := Base64Map[(o shr 12) and $3F];
    pc.c := Base64Map[(o shr 6) and $3F];
    pc.d := Base64Map[o and $3F];
  end;
end;

function BinToBase64(const aBin; aSize, aMaxLineLength: Integer): String;
var
  o: POctet;
  c: PChars;
  aCount: Integer;
  i: Integer;
begin
  o := @aBin;
  aCount := aSize;
  SetLength(Result, ((aCount + 2) div 3)*4);
  c := PChars(Result);
  while aCount > 0 do begin
    OctetToChars(o, aCount, c);
    Inc(o);
    Inc(c);
    Dec(aCount, 3);
  end;
  if aMaxLineLength > 0 then begin
    i := aMaxLineLength;
    while i <= Length(Result) do begin
      Insert(#13#10, Result, i);
      Inc(i, 2 + aMaxLineLength);
    end
  end;
end;

function CharTo6Bit(c: Char): Byte;
begin
  if (c >= 'A') and (c <= 'Z') then
    Result := Ord(c) - Ord('A')
  else if (c >= 'a') and (c <= 'z') then
    Result := Ord(c) - Ord('a') + 26
  else if (c >= '0') and (c <= '9') then
    Result := Ord(c) - Ord('0') + 52
  else if c = '+' then
    Result := 62
  else if c = '/' then
    Result := 63
  else
    Result := 0
end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
February 2009 Release de Delphi Prism 2009 rruz Noticias 1 12-03-2009 21:43:11
delphi 2009 win32 JXJ La Taberna 2 03-02-2009 01:25:42
Evento Delphi 2009 y C++ Builder 2009 en Guadalajara y Mexico con David poliburro Noticias 14 15-09-2008 01:03:58
Llamada a Servicios Web desde Delphi 2006 (Delphi for Microsoft Win32) lacovera Internet 2 27-06-2007 16:54:29
Migración de Delphi win32 a Asp.Net amigojar .NET 3 28-09-2006 22:04:19


La franja horaria es GMT +2. Ahora son las 07:43:35.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi