| typedef unsigned char | xmlChar |
xmlChar:
This is a basic byte in an UTF-8 encoded string. It's unsigned allowing to pinpoint case where char * are assigned to xmlChar * (possibly making serialization back impossible).
xmlStrdup: a strdup for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
Returns a new xmlChar * or NULL
OOM: possible --> returns NULL for cur!=NULL and sets OOM flag
| Parameters | |
|---|---|
| cur | the input xmlChar * |
| XMLPUBFUN xmlChar *XMLCALL | xmlCharStrndup | ( | const char * | cur, |
| int | len | |||
| ) | ||||
xmlCharStrndup: a strndup for char's to xmlChar's
Returns a new xmlChar * or NULL
| Parameters | |
|---|---|
| cur | the input char * |
| len | the len of cur |
| XMLPUBFUN xmlChar *XMLCALL | xmlCharStrdup | ( | const char * | cur | ) |
xmlCharStrdup: a strdup for char's to xmlChar's
Returns a new xmlChar * or NULL
| Parameters | |
|---|---|
| cur | the input char * |
xmlStrsub: Extract a substring of a given string
Returns the xmlChar * for the first occurrence or NULL.
| Parameters | |
|---|---|
| str | the xmlChar * array (haystack) |
| start | the index of the first char (zero based) |
| len | the length of the substring |
xmlStrEqual: Check if both string are equal of have same content Should be a bit more readable and faster than xmlStrEqual()
Returns 1 if they are equal, 0 if they are different
OOM: never
| Parameters | |
|---|---|
| str1 | the first xmlChar * |
| str2 | the second xmlChar * |
xmlStrQEqual: Check if a QName is Equal to a given string
Returns 1 if they are equal, 0 if they are different
| Parameters | |
|---|---|
| pref | the prefix of the QName |
| name | the localname of the QName |
| str | the second xmlChar * |
| XMLPUBFUN int XMLCALL | xmlStrlen | ( | const xmlChar * | str | ) |
xmlStrlen: length of a xmlChar's string
Returns the number of xmlChar contained in the ARRAY.
| Parameters | |
|---|---|
| str | the xmlChar * array |
xmlStrcat: a strcat for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
Returns a new xmlChar* containing the concatenated string.
OOM: possible --> OOM flag is set
| Parameters | |
|---|---|
| cur | the original xmlChar* array |
| add | the xmlChar* array added |
xmlStrncat: a strncat for array of xmlChar's, it will extend cur with the len first bytes of add.
Returns a new xmlChar*, the original cur is reallocated if needed and should not be freed
OOM: possible --> OOM flag is set
| Parameters | |
|---|---|
| cur | the original xmlChar* array |
| add | the xmlChar* array added |
| len | the length of add |
xmlStrncatNew: same as xmlStrncat, but creates a new string. The original two strings are not freed.
Returns a new xmlChar* or NULL
OOM: possible --> returns NULL, sets OOM flag
| Parameters | |
|---|---|
| str1 | first xmlChar string |
| str2 | second xmlChar string |
| len | the len of str2 |
xmlStrPrintf: Formats msg and places result into buf.
Returns the number of characters written to buf or -1 if an error occurs.
| Parameters | |
|---|---|
| buf | the result buffer. |
| len | the result buffer length. |
| msg | the message with printf formatting. |
| extra parameters for the message. |
xmlStrVPrintf: Formats msg and places result into buf.
Returns the number of characters written to buf or -1 if an error occurs.
| Parameters | |
|---|---|
| buf | the result buffer. |
| len | the result buffer length. |
| msg | the message with printf formatting. |
| ap | extra parameters for the message. |
| XMLPUBFUN int XMLCALL | xmlGetUTF8Char | ( | const unsigned char * | utf, |
| int * | len | |||
| ) | ||||
xmlGetUTF8Char: Read one UTF8 Char from utf
Returns the char value or -1 in case of error, and updates *len with the number of bytes consumed
| Parameters | |
|---|---|
| utf | a sequence of UTF-8 encoded bytes |
| len | a pointer to bytes len |
| XMLPUBFUN int XMLCALL | xmlCheckUTF8 | ( | const unsigned char * | utf | ) |
xmlCheckUTF8: Checks utf for being valid UTF-8. utf is assumed to be null-terminated. This function is not super-strict, as it will allow longer UTF-8 sequences than necessary. Note that Java is capable of producing these sequences if provoked. Also note, this routine checks for the 4-byte maximum size, but does not check for 0x10ffff maximum value.
Return value: true if utf is valid.
| Parameters | |
|---|---|
| utf | Pointer to putative UTF-8 encoded string. |
| XMLPUBFUN int XMLCALL | xmlUTF8Strsize | ( | const xmlChar * | utf, |
| int | len | |||
| ) | ||||
xmlUTF8Strsize: storage size of an UTF8 string
Returns the storage size of the first 'len' characters of ARRAY
| Parameters | |
|---|---|
| utf | a sequence of UTF-8 encoded bytes |
| len | the number of characters in the array |
xmlUTF8Strloc: a function to provide the relative location of a UTF8 char
Returns the relative character position of the desired char or -1 if not found
| Parameters | |
|---|---|
| utf | the input UTF8 * |
| utfchar | the UTF8 character to be found |
xmlUTF8Strsub: Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars
Returns a pointer to a newly created string or NULL if any problem
| Parameters | |
|---|---|
| utf | a sequence of UTF-8 encoded bytes |
| start | relative pos of first char |
| len | total number to copy |
| XMLPUBFUN int XMLCALL | xmlUTF8Strlen | ( | const xmlChar * | utf | ) |
xmlUTF8Strlen: compute the length of an UTF8 string, it doesn't do a full UTF8 checking of the content of the string.
Returns the number of characters in the string or -1 in case of error
OOM: never
| Parameters | |
|---|---|
| utf | a sequence of UTF-8 encoded bytes |
| XMLPUBFUN int XMLCALL | xmlUTF8Size | ( | const xmlChar * | utf | ) |
xmlUTF8Size: calculates the internal size of a UTF8 character
returns the numbers of bytes in the character, -1 on format error
| Parameters | |
|---|---|
| utf | pointer to the UTF8 character |