@@ -68,7 +68,11 @@ like_uri({str}) *Vital.Web.URI.like_uri()*
68
68
69
69
*Vital.Web.URI.new_default_pattern_set()*
70
70
new_default_pattern_set()
71
- Returns | Vital.Web.URI-PatternSet | .
71
+ Creates a new | Vital.Web.URI-PatternSet | object.
72
+
73
+ *Vital.Web.URI.clone_pattern_set()*
74
+ clone_pattern_set({patternset} )
75
+ Clones a | Vital.Web.URI-PatternSet | object.
72
76
73
77
encode({str} [, {char-enc} ]) *Vital.Web.URI.encode()*
74
78
Encodes {str} to Percent-encoding string.
@@ -144,70 +148,70 @@ is_path({str})
144
148
is_query({str} )
145
149
is_fragment({str} )
146
150
147
- Returns non-zero value if {str} has right syntax
148
- for each component. Returns zero otherwise.
151
+ Returns non-zero value if {str} has right syntax
152
+ for each component. Returns zero otherwise.
149
153
150
154
*Vital.Web.URI-URI.clone()*
151
155
clone()
152
156
153
- This method clones a URI object itself. >
154
- let s:URI = vital#{plugin-name}#new().import('Web.URI')
155
- let uri = s:URI.new('http://example.com/')
156
- let copyuri = uri.clone().relative('/a/b/c')
157
- echo uri.to_string()
158
- " => 'http://example.com/'
159
- echo copyuri.to_string()
160
- " => 'http://example.com/a/b/c'
157
+ This method clones a URI object itself. >
158
+ let s:URI = vital#{plugin-name}#new().import('Web.URI')
159
+ let uri = s:URI.new('http://example.com/')
160
+ let copyuri = uri.clone().relative('/a/b/c')
161
+ echo uri.to_string()
162
+ " => 'http://example.com/'
163
+ echo copyuri.to_string()
164
+ " => 'http://example.com/a/b/c'
161
165
<
162
166
*Vital.Web.URI-URI.relative()*
163
167
relative({reluri} )
164
168
165
- This method ...
166
- * Calculates a URI from
167
- base URI and relative URI({reluri} ).
168
- * Changes the URI object itself (destructive).
169
- * Returns the URI object itself.
170
- * Calls | Vital.Web.URI-URI.relative() | implicitly.
171
-
172
- Example: >
173
- let s:URI = vital#{plugin-name}#new().import('Web.URI')
174
- let BASE_URI = 'http://example.com/foo/bar'
175
- let RELATIVE_URI = '../baz'
176
- echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
177
- " => 'http://example.com/baz'
178
-
179
- let BASE_URI = 'http://example.com/foo/bar/'
180
- let RELATIVE_URI = '../baz'
181
- echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
182
- " => 'http://example.com/foo/baz'
169
+ This method ...
170
+ * Calculates a URI from
171
+ base URI and relative URI({reluri} ).
172
+ * Changes the URI object itself (destructive).
173
+ * Returns the URI object itself.
174
+ * Calls | Vital.Web.URI-URI.relative() | implicitly.
175
+
176
+ Example: >
177
+ let s:URI = vital#{plugin-name}#new().import('Web.URI')
178
+ let BASE_URI = 'http://example.com/foo/bar'
179
+ let RELATIVE_URI = '../baz'
180
+ echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
181
+ " => 'http://example.com/baz'
182
+
183
+ let BASE_URI = 'http://example.com/foo/bar/'
184
+ let RELATIVE_URI = '../baz'
185
+ echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
186
+ " => 'http://example.com/foo/baz'
183
187
<
184
188
*Vital.Web.URI-URI.canonicalize()*
185
189
canonicalize()
186
190
187
- This method ...
188
- * Canonicalizes the URI.
189
- * Changes the URI object itself (destructive).
190
- * Returns the URI object itself.
191
-
192
- See Web.URI.* modules for supported schemes.
193
- For example, the following four URIs
194
- becomes equivalent URI (http://example.com/ ).
195
- * http://example.com
196
- * http://example.com/
197
- * http://example.com:/
198
- * http://example.com:80/
199
-
200
- Example: >
201
- let s:URI = vital#{plugin-name}#new().import('Web.URI')
202
- echo s:URI.new('http://example.com:80/').to_string()
203
- " => 'http://example.com/'
191
+ This method ...
192
+ * Canonicalizes the URI.
193
+ * Changes the URI object itself (destructive).
194
+ * Returns the URI object itself.
195
+
196
+ See Web.URI.* modules for supported schemes.
197
+ For example, the following four URIs
198
+ becomes equivalent URI (http://example.com/ ).
199
+ * http://example.com
200
+ * http://example.com/
201
+ * http://example.com:/
202
+ * http://example.com:80/
203
+
204
+ Example: >
205
+ let s:URI = vital#{plugin-name}#new().import('Web.URI')
206
+ echo s:URI.new('http://example.com:80/').to_string()
207
+ " => 'http://example.com/'
204
208
<
205
209
*Vital.Web.URI-URI.default_port()*
206
210
default_port()
207
211
208
- This method returns the default port for current scheme.
209
- (e.g.: 80 for "http" scheme)
210
- See Web.URI.* modules for supported schemes.
212
+ This method returns the default port for current scheme.
213
+ (e.g.: 80 for "http" scheme)
214
+ See Web.URI.* modules for supported schemes.
211
215
212
216
------------------------------------------------------------------------------
213
217
PATTERNSET OBJECT *Vital.Web.URI-PatternSet*
@@ -232,28 +236,28 @@ According to RFC3986, URI allows
232
236
but these characters often appears in ordinary text.
233
237
This code lets the parser ignore these characters. >
234
238
235
- let s:LoosePatternSet = s:URI.new_default_pattern_set()
239
+ let s:LoosePatternSet = s:URI.new_default_pattern_set()
236
240
237
- " Remove "'", "(", ")" from default sub_delims().
238
- function! s:LoosePatternSet.sub_delims() abort
239
- return '[!$&*+,;=]'
240
- endfunction
241
+ " Remove "'", "(", ")" from default sub_delims().
242
+ function! s:LoosePatternSet.sub_delims() abort
243
+ return '[!$&*+,;=]'
244
+ endfunction
241
245
242
- " Ignore trailing string after URI.
243
- let NONE = []
244
- let ret = URI.new_from_seq_string(
245
- \ 'http://example.com)', NONE, s:LoosePatternSet)
246
- if ret isnot NONE
247
- ...
248
- endif
246
+ " Ignore trailing string after URI.
247
+ let NONE = []
248
+ let ret = URI.new_from_seq_string(
249
+ \ 'http://example.com)', NONE, s:LoosePatternSet)
250
+ if ret isnot NONE
251
+ ...
252
+ endif
249
253
<
250
254
251
255
get({component} ) *Vital.Web.URI-PatternSet.get()*
252
256
253
- Returns each component definition.
257
+ Returns each component definition.
254
258
>
255
- let s:PatternSet = s:URI.new_default_pattern_set()
256
- echo s:PatternSet.get('scheme')
259
+ let s:PatternSet = s:URI.new_default_pattern_set()
260
+ echo s:PatternSet.get('scheme')
257
261
<
258
262
Listing all customizable components here (alphabetic order).
259
263
NOTE: DON'T call these methods directly.
0 commit comments