XU XUv0.16.0

#encoding/xml

import: #encoding/xml

counts: 4 functions, 3 methods, 2 types, 4 constants, 0 method sets

Text escape and Decoder.token. No reflection unmarshal.

const TOK_START

XuAPI
pub const TOK_START = 1

Purpose

Constant TOK_START, defining protocol or algorithm parameters.

const TOK_END

XuAPI
pub const TOK_END = 2

Purpose

Constant TOK_END, defining protocol or algorithm parameters.

const TOK_CHAR

XuAPI
pub const TOK_CHAR = 3

Purpose

Constant TOK_CHAR, defining protocol or algorithm parameters.

const TOK_COMMENT

XuAPI
pub const TOK_COMMENT = 4

Purpose

Constant TOK_COMMENT, defining protocol or algorithm parameters.

struct Token

XuAPI
pub struct Token {
    pub kind int
    pub name string
    pub text string
    pub keys []string
    pub vals []string
}

Purpose

Structure encapsulating kind, name, text, keys, vals.

Public fields

kind int
kind tag
name string
name
text string
text
keys []string
field ([]string)
vals []string
field ([]string)

struct Decoder

XuAPI
pub struct Decoder {
    pub data string
    pub pos int
    pub pending_end string
}

Purpose

Structure encapsulating data, pos, pending_end.

Public fields

data string
data
pos int
field (int)
pending_end string
field (string)

new_decoder

XuAPI
pub fn new_decoder(src &string) Decoder

Purpose

Construct decoder.

Parameters

src &string
source (read-only borrow; caller keeps the original; type &string)

Returns

Decoder — a value of this type

(Decoder) input_offset

XuAPI
pub fn (d Decoder) input_offset() int

Purpose

Operation on Decoder: input offset.

Parameters

d Decoder
The Decoder instance used by this call (value receiver).

Returns

int — a value of this type

escape_text

XuAPI
pub fn escape_text(s &string) string

Purpose

Escape text.

Parameters

s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

escape_string

XuAPI
pub fn escape_string(s &string) string

Purpose

Escape special characters.

Parameters

s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

unescape_string

XuAPI
pub fn unescape_string(s &string) string

Purpose

Unescape escaped entity or character sequences.

Parameters

s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

($&Decoder) token

XuAPI
pub fn (d $&Decoder) token() Token

Purpose

Execute token on $&Decoder. Throws on failure; handle the error or propagate it to the caller.

Parameters

d $&Decoder
The Decoder instance used by this call (exclusive borrow).

Returns

Token — a value of this type

($&Decoder) skip

XuAPI
pub fn (d $&Decoder) skip() int

Purpose

Execute skip on $&Decoder. Throws on failure; handle the error or propagate it to the caller.

Parameters

d $&Decoder
The Decoder instance used by this call (exclusive borrow).

Returns

int — a value of this type