lc_time_fmt_compile (private)

 lc_time_fmt_compile fmt locale

Defined in packages/acs-lang/tcl/localization-procs.tcl

Compiles ISO 14652 LC_TIME style formatting string to variable substitutions and proc calls.

Parameters:
fmt (required)
An ISO 14652 LC_TIME style formatting string.
locale (required)
Locale identifier must be in the locale database
Returns:
A string that should be subst'ed in the lc_time_fmt proc after local variables have been set.

Partial Call Graph (max 5 caller/called nodes):
%3 lc_time_fmt lc_time_fmt (public) lc_time_fmt_compile lc_time_fmt_compile lc_time_fmt->lc_time_fmt_compile lc_get lc_get (public) lc_time_fmt_compile->lc_get

Testcases:
No testcase defined.
Source code:
    set to_process $fmt

    set compiled_string ""
    while {[regexp -- {^(.*?)%(.)(.*)$} $to_process match done_portion percent_modifier remaining]} {

        switch -exact -- $percent_modifier {
            x {
                append compiled_string $done_portion
                set to_process "[lc_get -locale $locale d_fmt]$remaining"
            }
            X {
                append compiled_string $done_portion
                set to_process "[lc_get -locale $locale t_fmt]$remaining"
            }
            c {
                append compiled_string $done_portion
                set to_process "[lc_get -locale $locale d_t_fmt]$remaining"
            }
            q {
                append compiled_string $done_portion
                set to_process "[lc_get -locale $locale dlong_fmt]$remaining"
            }
            Q {
                append compiled_string $done_portion
                set to_process "[lc_get -locale $locale dlongweekday_fmt]$remaining"
            }
            default {
                append compiled_string "${done_portion}$::lang::util::percent_match($percent_modifier)"
                set to_process $remaining
            }
        }
    }

    # What is left to_process must be (%.)-less, so it should be included without transformation.
    append compiled_string $to_process

    return $compiled_string
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-lang/tcl/localization-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: