Loading...
Searching...
No Matches
dc_url::urlsplit Interface Reference

Public Member Functions

subroutine url_split_c (fullname, file, var, attr, iorange)

Detailed Description

Definition at line 60 of file dc_url.f90.

Member Function/Subroutine Documentation

◆ url_split_c()

subroutine dc_url::urlsplit::url_split_c ( character(len = *), intent(in) fullname,
character(len = *), intent(out), optional file,
character(len = *), intent(out), optional var,
character(len = *), intent(out), optional attr,
character(len = *), intent(out), optional iorange )

Definition at line 253 of file dc_url.f90.

254 !
255 ! fullname で与えられる変数 URL を、ファイル名 file、 変数名 var、
256 ! 属性名 attr、入出力範囲指定 iorange に分解して返します。
257 ! 見つからない成分には空文字列が代入されます。
258 !
259 use dc_types, only: string
260 character(len = *), intent(in):: fullname
261 character(len = *), intent(out), optional:: file, var, attr, iorange
262 character(len = STRING):: varpart
263 integer:: atmark, colon, comma
264 character(len = *), parameter:: VARNAME_SET &
265 = "0123456789eEdD+-=^,.:_" &
266 // "ABCDEFGHIJKLMNOPQRSTUVWXYZ" &
267 // "abcdefghijklmnopqrstuvwxyz"
268 continue
269 ! まず URL と変数属性指定 (? または @ 以降) を分離する。
270 ! URL は @ を含みうるため、最後の @ 以降に対して変数属性
271 ! として許されない文字(典型的には '/')が含まれていたら
272 ! 当該 @ は URL の一部とみなす。
273 atmark = index(fullname, gt_question)
274 if (atmark == 0) then
275 atmark = index(fullname, gt_atmark, back=.true.)
276 if (atmark /= 0) then
277 if (verify(trim(fullname(atmark+1: )), varname_set) /= 0) then
278 atmark = 0
279 endif
280 endif
281 endif
282 if (atmark == 0) then
283 ! 変数属性指定はなかった。
284 if (present(file)) file = fullname
285 if (present(var)) var = ''
286 if (present(attr)) attr = ''
287 if (present(iorange)) iorange = ''
288 return
289 endif
290 varpart = fullname(atmark+1: )
291 ! 変数属性指定があった。
292 if (present(file)) file = fullname(1: atmark - 1)
293 ! 範囲指定を探索する。
294 comma = index(varpart, gt_comma)
295 if (comma /= 0) then
296 ! 範囲指定がみつかった。
297 if (present(var)) var = varpart(1: comma - 1)
298 if (present(attr)) attr = ''
299 if (present(iorange)) iorange = varpart(comma + 1: )
300 return
301 endif
302 if (present(iorange)) iorange = ''
303 ! 範囲指定がなかったので、属性名の検索をする。
304 colon = index(varpart, gt_colon)
305 if (colon == 0) then
306 if (present(var)) var = varpart
307 if (present(attr)) attr = ''
308 varpart = ''
309 return
310 endif
311 if (present(var)) var = varpart(1: colon - 1)
312 if (present(attr)) attr = varpart(colon + 1: )
313 varpart = ''
種別型パラメタを提供します。
Definition dc_types.f90:49
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:118

References dc_url::gt_atmark, dc_url::gt_colon, dc_url::gt_comma, dc_url::gt_question, and dc_types::string.


The documentation for this interface was generated from the following file: