-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Victor Moene <[email protected]>
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: default | ||
title: type | ||
published: true | ||
--- | ||
|
||
[%CFEngine_function_prototype(var, type)%] | ||
|
||
**Description:** Returns whether a variable `var` is of type `type` | ||
|
||
[%CFEngine_function_attributes(var, type)%] | ||
|
||
This function works by comparing the type description of `var` with the string `type`. The function | ||
expects a variable identifier as the first argument `var` and a type string as | ||
the second argument `type`. The type accepts both the type and an optional subtype. The function | ||
by default evaluates to false if the variable or the type string are wrong. | ||
|
||
To see the possible data types and theit subtypes, see `type()` | ||
|
||
**Example:** | ||
|
||
[%CFEngine_include_snippet(is_type.cf, #\+begin_src cfengine3, .*end_src)%] | ||
|
||
Output: | ||
|
||
[%CFEngine_include_snippet(is_type.cf, #\+begin_src\s+example_output\s*, .*end_src)%] | ||
|
||
**History:** | ||
|
||
* Introduced in 3.26.0 |