mime::getsize (private)

 mime::getsize token

Defined in packages/acs-tcl/tcl/tcllib-doc-procs.tcl

Determine the size reported for a MIME token by mime::getproperty. This internal helper is version-dependent and is not a public API.

Parameters:
token (required)
MIME token to inspect.
Returns:
The size reported for the MIME part.
See Also:

Partial Call Graph (max 5 caller/called nodes):
mime::getproperty mime::getproperty (public) mime::getsize mime::getsize mime::getproperty->mime::getsize

Testcases:
No testcase defined.
Source code:
    # FRINK: nocheck
    variable $token
    upvar 0 $token state

    switch -- $state(value)/$state(canonicalP) {
        file/0 {
            set size $state(count)
        }

        file/1 {
            return [file size $state(file)]
        }

        parts/0
            -
        parts/1 {
            set size 0
            foreach part $state(parts) {
                incr size [getsize $part]
            }

            return $size
        }

        string/0 {
            set size [string length $state(string)]
        }

        string/1 {
            return [string length $state(string)]
        }
        default {
            error "Unknown combination \"$state(value)/$state(canonicalP)\""
        }
    }

    if {$state(encoding) eq "base64"} {
        set size [expr {($size * 3 + 2) / 4}]
    }

    return $size
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: