xml/detail/common.bi

Summary
xml/detail/common.bi
LicenseCopyright © 2007-2012, FreeBASIC Extended Library Development Group
Macros
FBEXT_XML_IS_WHITESPACEreturns true if character is a whitespace character.
Enumerations
charContains the ASCII characters that are special or must be escaped in XML.
Functions
encode_entitiesEncodes special characters in a string to their proper form.
decode_entitiesDecodes special characters in a string to their standard form.
encode_utf8Encodes a UTF-8 character to its string representation.
decode_utf8Decodes a UTF-8 character from its string representation.

License

Copyright © 2007-2012, FreeBASIC Extended Library Development Group

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com/p/fb-extended-lib/wiki/License

Macros

FBEXT_XML_IS_WHITESPACE

#define FBEXT_XML_IS_WHITESPACE(
   c
) ((c) = &h09 or (c) = &h0a or (c) = &h0d or (c) = &h20)

returns true if character is a whitespace character.

Enumerations

char

Contains the ASCII characters that are special or must be escaped in XML.

Functions

encode_entities

declare function encode_entities(byref text as const string) as string

Encodes special characters in a string to their proper form.

Parameters

texttext to encode entities in.

Returns

string containing the properly formatted special characters.

decode_entities

declare function decode_entities(byref text as const string) as string

Decodes special characters in a string to their standard form.

Parameters

texttext to decode entities in.

Returns

string containing the unescaped characters.

encode_utf8

declare function encode_utf8(byval u as integer) as zstring ptr

Encodes a UTF-8 character to its string representation.

Parameters

uinteger representation of the desired UTF-8 character.

Returns

zstring ptr, the encoded UTF-8 character.

decode_utf8

declare function decode_utf8(byval src as zstring ptr,
byref u as integer) as integer

Decodes a UTF-8 character from its string representation.

Parameters

srczstring ptr containing the encoded UTF-8 character.
uinteger representation of the encoded UTF-8 character is returned via this parameter.

Returns

integer, the number of characters the UTF-8 character occupied while encoded.

#define FBEXT_XML_IS_WHITESPACE(
   c
) ((c) = &h09 or (c) = &h0a or (c) = &h0d or (c) = &h20)
returns true if character is a whitespace character.
declare function encode_entities(byref text as const string) as string
Encodes special characters in a string to their proper form.
declare function decode_entities(byref text as const string) as string
Decodes special characters in a string to their standard form.
declare function encode_utf8(byval u as integer) as zstring ptr
Encodes a UTF-8 character to its string representation.
declare function decode_utf8(byval src as zstring ptr,
byref u as integer) as integer
Decodes a UTF-8 character from its string representation.