const tok_start
XuAPI
pub const tok_start = 1用途
公开常量 `tok_start`。 值为 `1`
参数
无
API
#encoding/xml文本转义与 Decoder.token。无反射 Unmarshal。
const tok_startpub const tok_start = 1公开常量 `tok_start`。 值为 `1`
无
const tok_endpub const tok_end = 2公开常量 `tok_end`。 值为 `2`
无
const tok_charpub const tok_char = 3公开常量 `tok_char`。 值为 `3`
无
const tok_commentpub const tok_comment = 4公开常量 `tok_comment`。 值为 `4`
无
struct Tokenpub struct Token {
pub kind int
pub name string
pub text string
pub keys []string
pub vals []string
}公开结构体 `Token`。
kind intname stringtext stringkeys []stringvals []stringstruct Decoderpub struct Decoder {
pub data string
pub pos int
pub pending_end string
}公开结构体 `Decoder`。
data stringpos intpending_end stringnew_decoderpub fn new_decoder(src &string) Decoder构造 decoder。
src &stringDecoder — 该类型的值
(Decoder) input_offsetpub fn (d Decoder) input_offset() int`Decoder` 上的方法:inputoffset。
d Decoderint — 该类型的值
escape_textpub fn escape_text(s &string) string转义文本。
s &stringstring — 结果字符串
escape_stringpub fn escape_string(s &string) string转义特殊字符。
s &stringstring — 结果字符串
unescape_stringpub fn unescape_string(s &string) string还原转义。
s &stringstring — 结果字符串
(&mut Decoder) tokenpub fn (d &mut Decoder) token() Token在 `&mut Decoder` 上调用 `token`。失败时 throw。
d &mut DecoderToken — 该类型的值
(&mut Decoder) skippub fn (d &mut Decoder) skip() int`&mut Decoder` 上的方法:跳过。失败时 throw。
d &mut Decoderint — 该类型的值