cmdr
Check-in [47da046a26]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:cmdr::validate - Tweaked the "integer" validation type to use decimal as internal representation, as we accept octal and hex as external strings.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 47da046a2604672e1e958731cf843926bd5a6848
User & Date: andreask 2014-03-13 20:04:59
Context
2014-04-15
19:27
Hide docs from kettle's scanner for Tcl packages. check-in: 8a156a1311 user: andreask tags: trunk
2014-03-13
20:04
cmdr::validate - Tweaked the "integer" validation type to use decimal as internal representation, as we accept octal and hex as external strings. check-in: 47da046a26 user: andreask tags: trunk
2014-02-19
20:20
officer - Extended class to accept the unique prefixes of the known command names for dispatch. check-in: 434ada2661 user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to validate.tcl.

92
93
94
95
96
97
98




99


100
101
102
103
104
105
106
...
367
368
369
370
371
372
373
374
375
}
proc ::cmdr::validate::integer::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
proc ::cmdr::validate::integer::validate {p x} {
    debug.cmdr/validate {}




    if {[string is integer -strict $x]} { return $x }


    fail $p INTEGER "an integer" $x
}

# # ## ### ##### ######## ############# #####################
## Any double

namespace eval ::cmdr::validate::double {
................................................................................
    if {![file readable    $path]} {return 0}
    if {![file writable    $path]} {return 0}
    return 1
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate 1.2
return






>
>
>
>
|
>
>







 







|

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
373
374
375
376
377
378
379
380
381
}
proc ::cmdr::validate::integer::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
proc ::cmdr::validate::integer::validate {p x} {
    debug.cmdr/validate {}

    # While we accept integers in octal and hex we convert them into
    # proper decimals for internal use, as our standard
    # representation.
    if {[string is integer -strict $x]} {
	return [format %d $x]
    }
    fail $p INTEGER "an integer" $x
}

# # ## ### ##### ######## ############# #####################
## Any double

namespace eval ::cmdr::validate::double {
................................................................................
    if {![file readable    $path]} {return 0}
    if {![file writable    $path]} {return 0}
    return 1
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate 1.2.1
return