00-icanuse-procs.tcl

An API for checking optional features (name inspired by caniuse.com)

Location:
packages/acs-tcl/tcl/00-icanuse-procs.tcl
Created:
4th June 2019
Author:
Gustaf Neumann

Procedures in this file

Detailed information

acs::cmd_error_contains (private)

 acs::cmd_error_contains cmd subcommand

Helper proc abusing error messages to determine, whether the error message contains some string. This is a weeker form of cmd_has_subcommand.

Parameters:
cmd (required)
subcommand (required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

acs::cmd_has_subcommand (private)

 acs::cmd_has_subcommand cmd subcommand

Helper proc abusing error messages to determine, whether as submethod is available, since there is in Tcl no generic way to determine subcommands for a command. Note: Use this with caution, this is NOT GUARANTEED to work with every command, since many commands require e.g. a connection or return different error messages. When using this in more cases, test first! Therefore, this is a PRIVATE function, not intenended for public use.

Parameters:
cmd (required)
subcommand (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs__command_has_subcommand acs__command_has_subcommand (test acs-tcl) acs::cmd_has_subcommand acs::cmd_has_subcommand test_acs__command_has_subcommand->acs::cmd_has_subcommand

Testcases:
acs__command_has_subcommand

acs::icanuse (public)

 acs::icanuse feature

Check, if a (previously registered) feature can be used in an installation. These features are typically version dependent features of NaviServer. The checking of the availability of these features is typically more complex than a plain "info commands ...".

Parameters:
feature (required)
name for a feature, can contain blanks
Returns:
boolean value

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_icanuse acs_icanuse (test acs-tcl) acs::icanuse acs::icanuse test_acs_icanuse->acs::icanuse Class ::xo::Context Class ::xo::Context (public) Class ::xo::Context->acs::icanuse Object ::throttle Object ::throttle (public) Object ::throttle->acs::icanuse aa_check_leftovers aa_check_leftovers (public) aa_check_leftovers->acs::icanuse aa_used_application_memory aa_used_application_memory (private) aa_used_application_memory->acs::icanuse ad_conn ad_conn (public) ad_conn->acs::icanuse

Testcases:
acs_icanuse

acs::register_icanuse (public)

 acs::register_icanuse feature condition

Registry function for acs::caniuse.

Parameters:
feature (required)
name for a feature, can contain blanks
condition (required)
expression to determine availability

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_icanuse acs_icanuse (test acs-tcl) acs::register_icanuse acs::register_icanuse test_acs_icanuse->acs::register_icanuse

Testcases:
acs_icanuse
[ show source ]