外观
lib-axon 库参考(第 2 部分)
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793652397/FIN+5.3.1+lib-axon+part+2 中文整理基于 FIN 5.3.1
导读: "foo bar".parseUri foo bar
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- def
- uriDecode(val, checked: true)
- uriEncode(val)
- uriExt(val)
- uriFrag(val)
- uriHost(val)
- uriIsDir(val)
- uriName(val)
- uriPath(val)
- uriPathStr(val)
- uriPlusSlash(val)
- uriPort(val)
- uriQueryStr(val)
- uriScheme(val)
- vals(dict)
- weekOfYear(val, startOfWeek: null)
- weekday(t)
- xstr(type, val)
- year(d)
- yesterday()
概述(中译)
uriDecode(val, checked: true)
根据 RFC 3986 将 ASCII 百分比编码字符串解析为 Uri。所有 %HH 转义序列都被转换为字节,然后字节序列被 UTF-8 解码为字符串。查询部分的 + 字符会被解析为空格。如果 checked 为 true,那么如果字符串是格式错误的 URI 或未正确编码,则抛出 ParseErr,否则返回 null。使用 parseUri() 从标准形式解析。有关标准形式和编码形式的详细讨论,请参见 Uri。
"foo bar".parseUri foo bar "foo%20bar".uriDecode foo bar
API 正文(英文)
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriEncode
uriEncode(val)
Return the percent encoded string for this Uri according to RFC 3986. Each section of the Uri is UTF-8 encoded into octects and then percent encoded according to its valid character set. Spaces in the query section are encoded as +.
Examples:
`foo bar`.uriEncode >> "foo%20bar"meta
| def | func:uriEncode |
| is | func |
| lib | lib:axon |
| name | uriEncode |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriExt
uriExt(val)
Get the URI extension of a Uri as a string or null.
meta
| def | func:uriExt |
| is | func |
| lib | lib:axon |
| name | uriExt |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriFrag
uriFrag(val)
Return if the fragment identifier portion of the a URI after hash symbol
meta
| def | func:uriFrag |
| is | func |
| lib | lib:axon |
| name | uriFrag |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriHost
uriHost(val)
Get the host Uri as a string or null
meta
| def | func:uriHost |
| is | func |
| lib | lib:axon |
| name | uriHost |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriIsDir
uriIsDir(val)
Return if the URI path ends in a slash.
meta
| def | func:uriIsDir |
| is | func |
| lib | lib:axon |
| name | uriIsDir |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriName
uriName(val)
Get the name Str of a Uri (last item in path).
meta
| def | func:uriName |
| is | func |
| lib | lib:axon |
| name | uriName |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriPath
uriPath(val)
Get the path segments of a Uri as a list of Strs.
meta
| def | func:uriPath |
| is | func |
| lib | lib:axon |
| name | uriPath |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriPathStr
uriPathStr(val)
Get the path a Uri as a string.
meta
| def | func:uriPathStr |
| is | func |
| lib | lib:axon |
| name | uriPathStr |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriPlusSlash
uriPlusSlash(val)
Adding trailing slash to the URI. See Uri.plusSlash
meta
| def | func:uriPlusSlash |
| is | func |
| lib | lib:axon |
| name | uriPlusSlash |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriPort
uriPort(val)
Get the port of a Uri as a Number or null
meta
| def | func:uriPort |
| is | func |
| lib | lib:axon |
| name | uriPort |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriQueryStr
uriQueryStr(val)
Return if the query portion of the a URI after question mark
meta
| def | func:uriQueryStr |
| is | func |
| lib | lib:axon |
| name | uriQueryStr |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:uriScheme
uriScheme(val)
Get the scheme of a Uri as a string or null
meta
| def | func:uriScheme |
| is | func |
| lib | lib:axon |
| name | uriScheme |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:vals
vals(dict)
Get the list of values used by a given dict
meta
| def | func:vals |
| is | func |
| lib | lib:axon |
| name | vals |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:weekOfYear
weekOfYear(val, startOfWeek: null)
Given a DateTime or Date, return the week number of the year. The result is a number between 1 and 53 using the given start of week weekday as number 0-6 (defaults start of week for current locale).
meta
| def | func:weekOfYear |
| is | func |
| lib | lib:axon |
| name | weekOfYear |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:weekday
weekday(t)
Get weekday as integer from 0 to 6 of Date or DateTime. Zero indicates Sunday and 6 indicates Saturday
meta
| def | func:weekday |
| is | func |
| lib | lib:axon |
| name | weekday |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:xstr
xstr(type, val)
Construct decoded XStr instance
meta
| def | func:xstr |
| is | func |
| lib | lib:axon |
| name | xstr |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:year
year(d)
Get year as integer such as 2010 from date or datetime
meta
| def | func:year |
| is | func |
| lib | lib:axon |
| name | year |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:yesterday
yesterday()
Return yesterday's Date according to context's time zone
meta
| def | func:yesterday |
| is | func |
| lib | lib:axon |
| name | yesterday |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
name
Name key
meta
| def | name |
| is | str |
| lib | lib:axon |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| str | Unicode string of characters |
def
overridable
Applied to an ext function to enable override by project record functions.
meta
| def | overridable |
| is | marker |
| lib | lib:axon |
supertypes
| marker | Marker labels a dict with typing information |
def
src
Source code
meta
| def | src |
| is | str |
| lib | lib:axon |
| multiLine | ✓ |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| str | Unicode string of characters |
def
su
Requires superuser permission
meta
| def | su |
| is | marker |
| lib | lib:axon |
| tagOn | finSetting, func, view |
supertypes
| marker | Marker labels a dict with typing information |