xmlstring.inc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. (*
  2. * Summary: set of routines to process strings
  3. * Description: type and interfaces needed for the internal string handling
  4. * of the library, especially UTF8 processing.
  5. *
  6. * Copy: See Copyright for the status of this software.
  7. *
  8. * Author: Daniel Veillard
  9. *)
  10. {$IFDEF POINTER}
  11. xmlCharPtr = pchar;
  12. xmlCharPtrPtr = ^xmlCharPtr;
  13. {$ENDIF}
  14. {$IFDEF TYPE}
  15. (**
  16. * xmlChar:
  17. *
  18. * This is a basic byte in an UTF-8 encoded string.
  19. * It's unsigned allowing to pinpoint case where char * are assigned
  20. * to xmlChar * (possibly making serialization back impossible).
  21. *)
  22. xmlChar = cchar;
  23. {$ENDIF}
  24. {$IFDEF FUNCTION}
  25. (**
  26. * BAD_CAST:
  27. *
  28. * Macro to cast a string to an xmlChar * when one know its safe.
  29. *)
  30. function BAD_CAST(str: pchar): xmlCharPtr; inline;
  31. function BAD_CAST(str: string): xmlCharPtr; inline;
  32. (*
  33. * xmlChar handling
  34. *)
  35. function xmlStrdup(cur: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
  36. function xmlStrndup(cur: xmlCharPtr; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  37. function xmlCharStrndup(cur: pchar; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  38. function xmlCharStrdup(cur: pchar): xmlCharPtr; XMLCALL; XMLPUBFUN;
  39. function xmlStrsub(str: xmlCharPtr; start: cint; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  40. function xmlStrchr(str: xmlCharPtr; val: xmlChar): xmlCharPtr; XMLCALL; XMLPUBFUN;
  41. function xmlStrstr(str: xmlCharPtr; val: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
  42. function xmlStrcasestr(str: xmlCharPtr; val: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
  43. function xmlStrcmp(str1: xmlCharPtr; str2: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  44. function xmlStrncmp(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): cint; XMLCALL; XMLPUBFUN;
  45. function xmlStrcasecmp(str1: xmlCharPtr; str2: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  46. function xmlStrncasecmp(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): cint; XMLCALL; XMLPUBFUN;
  47. function xmlStrEqual(str1: xmlCharPtr; str2: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  48. function xmlStrQEqual(pref: xmlCharPtr; name: xmlCharPtr; str: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  49. function xmlStrlen(str: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  50. function xmlStrcat(cur: xmlCharPtr; add: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
  51. function xmlStrncat(cur: xmlCharPtr; add: xmlCharPtr; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  52. function xmlStrncatNew(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  53. function xmlStrPrintf(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; args: array of const): cint; XMLCDECL; XMLPUBFUN;
  54. function xmlStrVPrintf(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; ap: va_list): cint; XMLCALL; XMLPUBFUN;
  55. function xmlGetUTF8Char(utf: pchar; len: pcint): cint; XMLCALL; XMLPUBFUN;
  56. function xmlCheckUTF8(utf: pchar): cint; XMLCALL; XMLPUBFUN;
  57. function xmlUTF8Strsize(utf: xmlCharPtr; len: cint): cint; XMLCALL; XMLPUBFUN;
  58. function xmlUTF8Strndup(utf: xmlCharPtr; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  59. function xmlUTF8Strpos(utf: xmlCharPtr; pos: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  60. function xmlUTF8Strloc(utf: xmlCharPtr; utfchar: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  61. function xmlUTF8Strsub(str: xmlCharPtr; start: cint; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
  62. function xmlUTF8Strlen(utf: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  63. function xmlUTF8Size(utf: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  64. function xmlUTF8Charcmp(utf1: xmlCharPtr; utf2: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
  65. {$ENDIF}