Hutmacher Common Library -- Version 0.1
Functions | Variables
hcl.core.js File Reference

Functions

function hcl_features_ ()
 
function hcl_feature_ ($hcl_feature)
 
function array_key_exists_ ($array, $key, $recurse)
 Determines is a given key exists in a given array. More...
 
function array_length_ ($array, $recurse)
 Returns the number of elements in the given array. More...
 
function array_occurrence_count_ ($array, $values, $recurse)
 Counts the number of times a value occurs in an array. More...
 
function array_remove_values_ ($array, $values, $recurse)
 Returns an array with all the given values removed. More...
 
function array_value_ ($array, $key, $fallback, $recurse, $error_value)
 Returns a value from an array by the given key, or a fallback value if the key doesn't exist. More...
 
function array_value_exists_ ($array, $value, $recurse)
 Checks to see if an array contains the given value. More...
 
function get_type_ ($value, $flags)
 
function is_alphabetic_string_ ($value)
 Determines if a given string contains ONLY characters within the alphabet (ie a-z and A-Z) More...
 
function is_alphanumeric_string_ ($value)
 Determines if a given string contains ONLY characters within the alphabet or numberic digits (ie a-z and A-Z and 0-9) More...
 
function is_array_ ($value)
 Determines if a given variable is an array. More...
 
function is_base_64_string_ ($value)
 Determines if a variable is a base_64 encoded string. More...
 
function is_boolean_ ($value)
 Determines if a variable is a boolean value. More...
 
function is_boolean_string_ ($value, $terms, $case_sensitive)
 Determines if a variable is a string containing certain values to indicate true or false. More...
 
function is_defined_ ($value)
 Determines if a variable has been defined. More...
 
function is_digit_string_ ($value)
 Determines if a variable is a string that contains ONLY digits (ie 0,1,2,3,4,5,6,7,8 or 9). More...
 
function is_empty_string_ ($value)
 Determines if a variable is a string that has no characters (ie ""). More...
 
function is_email_string_ ($value)
 Determines if a variable is a string that contains a valid email address. More...
 
function is_float_ ($value)
 Determines if a variable is a float. More...
 
function is_float_string_ ($value)
 Determines if a variable is a string that contains an float value. More...
 
function is_function_name_ ($value)
 Determines if the given string is the name of a defined function. More...
 
function is_hexidecimal_string_ ($value)
 Determines if a variable is a string containing only hexidecimal values. More...
 
function is_integer_ ($value)
 Determines if a variable is an integer. More...
 
function is_integer_string_ ($value)
 Determines if a variable is a string that contains an integer value. More...
 
function is_ip_v4_string_ ($value)
 Determines if a variable is a string that contains a valid IPv4 string. More...
 
function is_ip_v6_string_ ($value)
 Determines if a variable is a string that contains a valid IPv6 string. More...
 
function is_json_string_ ($value)
 Determines if a variable is a string that contains a valid json string. More...
 
function is_md5_string_ ($value)
 Determines if a variable is the proper format for an md5 hash string. More...
 
function is_null_ ($value)
 Determines if a variable is null. More...
 
function is_numeric_ ($value)
 Determines if a variable is either an integer or a float. More...
 
function is_numeric_string_ ($value)
 Determines if a variable is a string that contains an integer value or a float value. More...
 
function is_object_ ($value)
 Determines if a variable is an object. More...
 
function is_string_ ($value)
 Determines if a variable is a string. More...
 
function is_social_security_number_string_ ($value)
 Determines if a variable is a string that contains a social security number. More...
 
function is_zip_code_string_ ($value)
 Determines if a variable is a string that contains a zip code. More...
 
function is_validated_zip_code_ ($value)
 Determines if $value is listed in the HCL_DATA_ZIP_CODE data files. If so it is a confirmed existing zip code, not just a 5 digit integer. More...
 
function absolute_ ($value, $precision)
 Returns the positive value of a numeric variable. More...
 
function ceiling_ ($value)
 Returns the highest integer value to the given variable. More...
 
function convert_units_ ($data, $value, $from_unit, $to_unit, $precision)
 Converts a value from one unit to another. More...
 
function cube_ ($value, $precision)
 Returns the value of value to the 3rd power with the given precision. More...
 
function cube_root_ ($value, $precision)
 Returns the cube root value of value with the given precision. More...
 
function float_to_string_ ($value, $precision)
 Returns the given float value as a string value. More...
 
function floor_ ($value)
 Returns the lowest integer value to the given variable. More...
 
function in_range_ ($value, $minimum, $maximum)
 Checks if a given numeric value is between a minimum and maximum value, inclusive. More...
 
function in_range_value_ ($value, $minimum, $maximum)
 Returns a number that is within the minimum and maximum values given. More...
 
function integer_to_string_ ($value)
 Returns the given integer value as a string value. More...
 
function is_even_ ($value)
 Determif a given variable is even. More...
 
function is_negative_ ($value)
 Determines if a variable is a negative numeric value. More...
 
function is_negative_float_ ($value)
 Determines if a variable is a negative float value. More...
 
function is_negative_integer_ ($value)
 Determines if a variable is a negative float value. More...
 
function is_odd_ ($value)
 Determines if a given variable is odd. More...
 
function is_positive_ ($value)
 Determines if a variable is a positive numeric value. More...
 
function is_positive_float_ ($value)
 Determines if a variable is a positive float value. More...
 
function is_positive_integer_ ($value)
 Determines if a variable is a positive integer value. More...
 
function maximum_ ($values)
 Returns the largest numeric value in an array. More...
 
function mean_ ($values, $precision)
 Returns the average (mean) value of an array of numeric values. More...
 
function minimum_ ($values)
 Returns the smallest numeric value (integer or float) in an array. More...
 
function negate_ ($value)
 Returns the negative value of the given value. More...
 
function pi_ ()
 Returns the value of pi. More...
 
function power_ ($base, $exponent, $precision)
 Returns the value base to the exponent power. More...
 
function random_ ($minimum, $maximum)
 Returns a random integer between minimum and maximum. More...
 
function random_float_ ($minimum, $maximum, $precision)
 Returns a integer between $minimum and $maximum. More...
 
function random_integer_ ($minimum, $maximum)
 Returns a random integer between $minimum and $maximum. More...
 
function round_ ($value, $precision)
 Returns a numeric value that is rounded to the given precision. More...
 
function square_ ($value, $precision)
 Returns the given value raised to the second power and truncated to the given precision. More...
 
function square_root_ ($value, $precision)
 Returns the square root of the given value truncated to the given precision. More...
 
function sum_ ($values, $precision, $recurse)
 Returns the sum of the numeric values in an array or comma seperated string. More...
 
function truncate_float_ ($value, $precision)
 Returns a value as a float which has been trucated to the given precision. More...
 
function base64_to_string_ ($value)
 Converts a base64 encoded string to ascii string. More...
 
function camel_case_ ($value, $exceptions)
 Returns a string which has all first characters in a word capatilized and the rest of the world lower case. More...
 
function lower_case_ ($value)
 Returns a string in which all characters have been converted to lower case. More...
 
function md5_ ($value, $lower_case)
 Returns a string containing an md5 hash of the input string. More...
 
function password_strength_ ($password, $minimum_length)
 Calculates the bits of entropy for a given password. More...
 
function string_begins_with_ ($value, $substring, $case_sensitive)
 Checks if a string begins with a given substring. More...
 
function string_contains_ ($value, $substring, $case_sensitive)
 Checks if a string contains a given substring. More...
 
function string_ends_with_ ($value, $substring, $case_sensitive)
 Checks if a string ends with a given substring. More...
 
function string_everything_after_ ($value, $substring, $case_sensitive)
 Returns everything after the first occurance of the given substring. More...
 
function string_everything_before_ ($value, $substring, $case_sensitive)
 Returns everything before the first occurance of the given substring. More...
 
function string_everything_between_ ($value, $first_string, $second_string, $case_sensitive)
 Returns everything between the first occurance of $first_string and the first occurance of $second_string. More...
 
function string_index_valid_ ($value, $index)
 Checks if a given $index is inside the bounds of $value. More...
 
function string_length_ ($value)
 Returns the length of a given string. More...
 
function string_longest_line_ ($value)
 Returns the longest string in an array or string that is seperated by end lines. More...
 
function string_longest_line_index_ ($value)
 Returns the index of the longest string in an array or string that is seperated by end lines. More...
 
function string_longest_line_length_ ($value)
 Returns the length of the longest string in an array or string that is seperated by end lines. More...
 
function string_occurance_count_ ($value, $substring, $case_sensitive)
 Returns the number of times a substring or substring(s) occur within an array or string. More...
 
function string_index_ ($value, $substring, $case_sensitive)
 Returns the index of the first occurance of substring within a string. More...
 
function string_position_ ($value, $substring, $case_sensitive)
 
function string_replace_ ($value, $search, $replacement, $case_sensitive)
 Returns the given string with all instances of search replaced by replacement. More...
 
function string_reversed_ ($value)
 Returns the given string in reversed order. More...
 
function string_to_base64_ ($value)
 Returns the given string converted to base 64. More...
 
function string_to_integer_ ($value)
 
function string_to_float_ ($value)
 
function string_truncate_ ($value, $length, $append)
 Returns the given string reduced to the given length. More...
 
function string_validate_characters_allowed_ ($value, $characters, $case_sensitive)
 Checks if the given string contains ONLY the allowed characters supplied. More...
 
function string_validate_characters_forbidden_ ($value, $characters, $case_sensitive)
 Checks to see if the string is valid (ie does not contain any forbidden characters) More...
 
function substring_by_length_ ($value, $start, $length)
 Returns a portion of a string. More...
 
function substring_by_position_ ($value, $start, $end)
 Returns a portion of a string. More...
 
function trim_ ($value)
 Returns a string in which all white space at the beginning of the string and end of the string has been removed. More...
 
function trim_left_ ($value)
 Returns a string in which all white space at the beginning of the string has been removed. More...
 
function trim_right_ ($value)
 Returns a string in which all white space at the end of the string has been removed. More...
 
function upper_case_ ($value)
 Returns a string in which all characters have been converted to upper case. More...
 
function get_timestamps_ ()
 Returns an array of timestamp values in second, millisecond and microsecond precision. More...
 
function get_timestamp_ ($format, $timestamp_precision)
 Returns a timestamp in the given format and precision. More...
 
function array_to_json_ ($array)
 Returns a json string created from the given array. More...
 
function array_to_string_ ($value, $delimiter)
 
function json_to_array_ ($json)
 
function json_to_object_ ($json)
 
function string_to_array_ ($value, $delimiter)
 
function get_available_data_array_ ()
 
function get_available_data_defines_ ()
 
function get_data_value_ ($data_source, $key)
 
function get_user_agent_string_ ()
 Returns the browsers User Agent string. More...
 
function get_user_agent_data_array_ ()
 Returns an array with details about the browser that has been parsed from the User Agent string. The array indexes are generated from the HCL_CORE_USER_AGENT_xxx defines. More...
 
function get_user_agent_browser_name_ ()
 Returns a string with name of the browser as parsed from the User Agent string. More...
 
function get_user_agent_browser_version_ ()
 Returns a string with version of the browser as parsed from the User Agent string. More...
 
function get_user_agent_device_model_ ()
 Returns a string with name of the device's model as parsed from the User Agent string. More...
 
function get_user_agent_device_type_ ()
 Returns a string with type of device as parsed from the User Agent string. More...
 
function get_user_agent_device_vendor_ ()
 Returns a string with name of the device's vendor as parsed from the User Agent string. More...
 
function get_user_agent_engine_name_ ()
 Returns a string with name of the browser's engine as parsed from the User Agent string. More...
 
function get_user_agent_engine_version_ ()
 Returns a string with version of the browser's engine as parsed from the User Agent string. More...
 
function get_user_agent_os_name_ ()
 Returns a string with name of the browser's operating system as parsed from the User Agent string. More...
 
function get_user_agent_os_version_ ()
 Returns a string with the version of the browser's operating system as parsed from the User Agent string. More...
 
function get_user_agent_cpu_architecture_ ()
 Returns a string with architecture of the browser's operating system as parsed from the User Agent string. More...
 

Variables

var HCL_VERSION = "0.1"
 
var HCL_DEBUG = true
 
var HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT = false
 
var HCL_ARRAY_SANITIZE_KEEP = "keep"
 
var HCL_ARRAY_SANITIZE_REMOVE = "remove"
 
var HCL_ARRAY_SANITIZE_REPLACE = "replace"
 
var HCL_ARRAY_SANITIZE_KEYS = "keys"
 
var HCL_ARRAY_SANITIZE_TYPES = "types"
 
var HCL_ARRAY_SANITIZE_VALUES = "values"
 
var HCL_ARRAY_SANITIZE_VALUES_RANGE = "range"
 
var HCL_OPERATIONS_EQUAL = "=="
 
var HCL_OPERATIONS_GREATER_THAN = ">"
 
var HCL_OPERATIONS_GREATER_THAN_OR_EQUAL = ">="
 
var HCL_OPERATIONS_LESS_THAN = "<"
 
var HCL_OPERATIONS_LESS_THAN_OR_EQUAL = "<="
 
var HCL_OPERATIONS_NOT_EQUAL = "!="
 
var HCL_DEBUG_LEVEL_NOTICE = 1
 
var HCL_DEBUG_LEVEL_WARNING = 2
 
var HCL_DEBUG_LEVEL_ERROR = 4
 
var HCL_DEBUG_LEVEL_OUTPUT = HCL_DEBUG_LEVEL_ERROR
 
var HCL_DEBUG_OUTPUT_STACK = true
 
var HCL_ERROR_VALUE = null
 
var HCL_CORE_USER_AGENT_USER_AGENT_UNDEFINED = 0
 
var HCL_CORE_USER_AGENT_STRING = 1
 
var HCL_CORE_USER_AGENT_BROWSER_NAME = 2
 
var HCL_CORE_USER_AGENT_BROWSER_VERSION = 4
 
var HCL_CORE_USER_AGENT_DEVICE_MODEL = 8
 
var HCL_CORE_USER_AGENT_DEVICE_TYPE = 16
 
var HCL_CORE_USER_AGENT_DEVICE_VENDOR = 32
 
var HCL_CORE_USER_AGENT_ENGINE_NAME = 64
 
var HCL_CORE_USER_AGENT_ENGINE_VERSION = 128
 
var HCL_CORE_USER_AGENT_OS_NAME = 256
 
var HCL_CORE_USER_AGENT_OS_VERSION = 512
 
var HCL_CORE_USER_AGENT_CPU_ARCHITECTURE = 1024
 
var HCL_FEATURES_MICROSECOND_TIMESTAMP_PRECISION = 1
 
var HCL_FEATURES_CONVERSION_DATA_LOADED = 2
 
var HCL_FEATURES_BROWSER_DETECTION = 4
 
var HCL_FEATURES_FULL_ZIP_CODE_VALIDATION = 8
 
var HCL_MATH_DEFAULT_PRECISION = 0
 
var HCL_MATH_MAXIMUM_PRECISION = 8
 
var HCL_MATH_PI = 3.1415926535
 
var HCL_STRING_REGEX_ALPHA = /^[a-zA-Z]+$/
 
var HCL_STRING_REGEX_ALPHANUMERIC = /^[0-9a-zA-Z]+$/
 
var HCL_STRING_REGEX_DIGITS = /^[0-9]+$/
 
var HCL_STRING_REGEX_HEXIDECIMAL = /^[0-9a-fA-F]+$/
 
var HCL_STRING_REGEX_EMAIL_ADDRESS = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
 
var HCL_STRING_BOOLEAN_STRING_TRUE_VALUES = "t,true,y,yes,1"
 
var HCL_STRING_BOOLEAN_STRING_FALSE_VALUES = "f,false,n,no,0"
 
var HCL_STRING_BOOLEAN_STRING_VALUES = HCL_STRING_BOOLEAN_STRING_FALSE_VALUES + "," + HCL_STRING_BOOLEAN_STRING_TRUE_VALUES
 
var HCL_STRING_CAMEL_CASE_EXCEPTIONS = "a,and,or,the"
 
var HCL_STRING_CASE_SENSITIVE_DEFAULT = false
 
var HCL_STRING_LOWER_CASE_DEFAULT = true
 
var HCL_STRING_MD5_LOWER_CASE_DEFAULT = true
 
var HCL_STRING_PASSWORD_MINIMUM_LENGTH_DEFAULT = 8
 
var HCL_STRING_SUBSTRING_NOT_FOUND = -1
 
var HCL_STRING_FIRST_SUBSTRING_NOT_FOUND = -2
 
var HCL_STRING_SECOND_SUBSTRING_NOT_FOUND = -3
 
var HCL_STRING_TO_ARRAY_DEFAULT_DELIMITER = ","
 
var HCL_TYPE_ARRAY = "array"
 
var HCL_TYPE_BOOLEAN = "boolean"
 
var HCL_TYPE_FLOAT = "float"
 
var HCL_TYPE_INTEGER = "integer"
 
var HCL_TYPE_NULL = "null"
 
var HCL_TYPE_OBJECT = "object"
 
var HCL_TYPE_STRING = "string"
 
var HCL_TYPE_UNDEFINED = "undefined"
 
var HCL_TIMESTAMP_PRECISION_SECOND = 0
 
var HCL_TIMESTAMP_PRECISION_MILLISECONDS = 1
 
var HCL_TIMESTAMP_PRECISION_MICROSECONDS = 2
 
var HCL_TIMESTAMP_PRECISION_DEFAULT = HCL_TIMESTAMP_PRECISION_SECOND
 
var HCL_TIMESTAMP_FORMAT_INTEGER = 0
 
var HCL_TIMESTAMP_FORMAT_FLOAT = 1
 
var HCL_TIMESTAMP_FORMAT_DEFAULT = HCL_TIMESTAMP_FORMAT_INTEGER
 
var JAVASCRIPT_NEW_LINE = "\n"
 
var JAVASCRIPT_TYPE_ARRAY = "array"
 
var JAVASCRIPT_TYPE_BOOLEAN = "boolean"
 
var JAVASCRIPT_TYPE_FUNCTION = "function"
 
var JAVASCRIPT_TYPE_NULL = "null"
 
var JAVASCRIPT_TYPE_NUMERIC = "number"
 
var JAVASCRIPT_TYPE_OBJECT = "object"
 
var JAVASCRIPT_TYPE_STRING = "string"
 
var JAVASCRIPT_TYPE_UNDEFINED = "undefined"
 

Detailed Description

Hootsoft Common Library For Javascript 0.1

Function Documentation

function absolute_ (   $value,
  $precision 
)

Returns the positive value of a numeric variable.

Library
core
Note
If $value is not an integer or float, HCL_ERROR_VALUE is returned.
If $precision is not a positive integer, the HCL_MATH_DEFAULT_PRECISION define will be used to determine how many digits of precision to return.
If $precision is not in range (0 to HCL_MATH_MAXIMUM_PRECISION), HCL_MATH_DEFAULT_PRECISION will be used.
Parameters
$valueThe value to be checked.
$precisionThe number of decimal points to include in the return value.
Returns
positive numeric value, truncated to the given precision if $value is a float or HCL_ERROR_VALUE on error.
function array_key_exists_ (   $array,
  $key,
  $recurse 
)

Determines is a given key exists in a given array.

Library
core
Sublibrary
arrays
Note
If $array is not an array HCL_ERROR_VALUE is returned.
If $key is not a string HCL_ERROR_VALUE is returned.
If $recurse is not defined, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
Parameters
$arrayThe array to search
$keyThe key to search for
$recurseDetermines if the function should check each array within the array as well
Javascript Specific
  • $array can be either an array or object.
  • If the given key is a not a positive integer value it will be ignored when checking an actual javascript array (since javascript arrays cannot use string keys).
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function array_length_ (   $array,
  $recurse 
)

Returns the number of elements in the given array.

Library
core
Sublibrary
arrays
Note
If $array is not an array HCL_ERROR_VALUE is returned.
If $recurse is not defined, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
Parameters
$arrayThe array to check.
$recurseDetermines if the function should check each array within the array as well.
Javascript Specific
  • $array can be either an array or object.
  • If the given key is a non-integer value it will be ignored when checking an actual javascript array (since javascript arrays cannot use string keys).
Returns
integer or HCL_ERROR_VALUE on error.
function array_occurrence_count_ (   $array,
  $values,
  $recurse 
)

Counts the number of times a value occurs in an array.

Library
core
Sublibrary
arrays
Note
If $array is not an array or object HCL_ERROR_VALUE is returned.
If $values is not an array HCL_ERROR_VALUE is returned.
If $recurse is not defined, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
Parameters
$arrayThe array or object to search
$valuesThe value to search for
$recurseDetermines if the function should check each array within the array as well.
Javascript Specific
  • $array can be either an array or object.
  • If the given key is a non-integer value it will be ignored when checking an actual javascript array (since javascript arrays cannot use string keys).
Todo:

Change so values can be a single value.

Make case sensitive

Returns
integer or HCL_ERROR_VALUE on error.
function array_remove_values_ (   $array,
  $values,
  $recurse 
)

Returns an array with all the given values removed.

Library
core
Sublibrary
arrays
Note
If $array is not an array or object HCL_ERROR_VALUE is returned.
If $values is not an array HCL_ERROR_VALUE is returned.
If $recurse is not defined or not a boolean value, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
Parameters
$arrayThe array or object to search
$valuesThe values to search for
$recursecheck each array or object within the array or object as well
Javascript Specific
  • $array can be either an array or object. If $array is an object an reindexed array will still be returned.
  • If the given key is a non-integer value it will be ignored when checking an actual javascript array (since javascript arrays cannot use string keys).
Returns
array or HCL_ERROR_VALUE on error.
function array_to_json_ (   $array)

Returns a json string created from the given array.

Library
core
Note
$array MUST be an array to HCL_ERROR_VALUE will be returned.
Returns
string or HCL_ERROR_VALUE on error.
function array_to_string_ (   $value,
  $delimiter 
)
function array_value_ (   $array,
  $key,
  $fallback,
  $recurse,
  $error_value 
)

Returns a value from an array by the given key, or a fallback value if the key doesn't exist.

Library
core
Sublibrary
arrays
Note
If $array is not an array HCL_ERROR_VALUE is returned.
If $key is not an integer or string HCL_ERROR_VALUE is returned.
If $fallback is not given HCL_ERROR_VALUE is returned.
If $recurse is not defined or not a boolean value, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
During recursion the first key found will be returned, even if the key exists in multiple child arrays.
Parameters
$arrayThe array or object to search
$keyThe key to search for
$fallbackThe fallback value to return if the given key cannot be found.
$recursecheck each child array within the array as well.
$error_valueA custom value to return instead of HCL_ERROR_VALUE. This is provided so that an array can include HCL_ERROR_VALUE as a value (null by default) without being confused as an error. If not given HCL_ERROR_VALUE will be used instead.
Javascript Specific
  • $array can be either an array or object.
  • If the given key is a non-integer value it will be ignored when checking an actual javascript array (since javascript arrays cannot use string keys).
Returns
value, $error_value if given or HCL_ERROR_VALUE on error.
function array_value_exists_ (   $array,
  $value,
  $recurse 
)

Checks to see if an array contains the given value.

Library
core
Sublibrary
arrays
Note
If array is not an array or object HCL_ERROR_VALUE is returned.
If value is not defined or is an array or object HCL_ERROR_VALUE is returned.
If recurse is not defined, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
Parameters
$arrayThe array to search.
$valueThe value to search for.
$recursecheck each array within the array as well.
Javascript Specific
  • $array can be either an array or object.
  • If the given key is a non-integer value it will be ignored when checking an actual javascript array (since javascript arrays cannot use string keys).
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function base64_to_string_ (   $value)

Converts a base64 encoded string to ascii string.

Library
core
Note
If $value is not a base64 string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe string value to process.
Returns
string or HCL_ERROR_VALUE on error.
function camel_case_ (   $value,
  $exceptions 
)

Returns a string which has all first characters in a word capatilized and the rest of the world lower case.

Library
core
Note
If $value is not a string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be checked.
Returns
string or HCL_ERROR_VALUE on error.
function ceiling_ (   $value)

Returns the highest integer value to the given variable.

Library
core
Note
If $value is not an integer or float, HCL_ERROR_VALUE is returned.
Parameters
$valueThe variable to processed.
Returns
integer or HCL_ERROR_VALUE on error.
function convert_units_ (   $data,
  $value,
  $from_unit,
  $to_unit,
  $precision 
)

Converts a value from one unit to another.

Library
core
Note
If $value is not an integer or float, HCL_ERROR_VALUE is returned.
If $precision is not a positive integer, the HCL_MATH_DEFAULT_PRECISION define will be used to determine how many digits of precision to return.
If $precision is not in range (0 to HCL_MATH_MAXIMWUM_PRECISION), HCL_MATH_DEFAULT_PRECISION will be used.
Parameters
$dataThe HCL json string to draw the unit information from. The string should have a variable named: HCL_DATA_UNIT_xxx.
$valueThe variable to processed.
$from_unitThe unit $value should be given in. The string should have a variable named: HCL_DATA_UNIT_xxx_xxx.
$to_unitThe unit $value should be returned in. The string should have a variable named: HCL_DATA_UNIT_xxx_xxx.
$precisionThe number of decimal points to include in the return value.
Todo:
Check if data is available
Returns
float value truncated to the given precision or the default precision or HCL_ERROR_VALUE on error.
function cube_ (   $value,
  $precision 
)

Returns the value of value to the 3rd power with the given precision.

Library
core
Note
If $value is not an integer or float, HCL_ERROR_VALUE is returned.
If $precision is not a positive integer, the HCL_MATH_DEFAULT_PRECISION define will be used to determine how many digits of precision to return.
If $precision is not in range (0 to HCL_MATH_MAXIMUM_PRECISION), HCL_MATH_DEFAULT_PRECISION will be used.
The returned float will be truncated to $precision, not rounded.
Parameters
$valueThe variable to processed.
$precisionThe number of decimal points to include in the return value.
Returns
numeric value truncated to the given precision or the default precision or HCL_ERROR_VALUE on error.
function cube_root_ (   $value,
  $precision 
)

Returns the cube root value of value with the given precision.

W

Library
core
Note
If $value is not an integer or float, HCL_ERROR_VALUE is returned.
If $precision is not a positive integer, the HCL_MATH_DEFAULT_PRECISION define will be used to determine how many digits of precision to return.
If $precision is not in range (0 to HCL_MATH_MAXIMUM_PRECISION), HCL_MATH_DEFAULT_PRECISION will be used.
The returned float will be truncated to precision, not rounded.
Parameters
$valueThe variable to processed.
$precisionThe number of decimal points to include in the return value.
Returns
numeric value truncated to either the given precision or the default precision, or HCL_ERROR_VALUE on error.
function float_to_string_ (   $value,
  $precision 
)

Returns the given float value as a string value.

Library
core
Note
If $value is not a float HCL_ERROR_VALUE will be returned.
If $precision is not a positive integer, the HCL_MATH_DEFAULT_PRECISION define will be used to determine how many digits of precision to return.
If $precision is not in range (0 to HCL_MATH_MAXIMUM_PRECISION), HCL_MATH_DEFAULT_PRECISION will be used.
The returned string will be truncated to given precision, not rounded.
Parameters
$valueThe variable to processed.
$precisionThe number of decimal points to include in the return value.
Returns
string truncated to either the given precision or the default precision, or HCL_ERROR_VALUE on error.
function floor_ (   $value)

Returns the lowest integer value to the given variable.

Library
core
Note
If $value is anything other than an integer or float the function returns HCL_ERROR_VALUE.
Parameters
$valueThe value to be checked.
Returns
integer or HCL_ERROR_VALUE on error.
function get_available_data_array_ ( )
function get_available_data_defines_ ( )
function get_data_value_ (   $data_source,
  $key 
)
function get_timestamp_ (   $format,
  $timestamp_precision 
)

Returns a timestamp in the given format and precision.

Library
core
Note
If $format is not one of the following defines HCL_ERROR_VALUE will be returned.
If $precision is not one of the following defines HCL_ERROR_VALUE will be returned.
Parameters
$format- The format of timestamp to be returned.
$timestamp_precision- The precision of the timestamp to be returned.
Returns
array
function get_timestamps_ ( )

Returns an array of timestamp values in second, millisecond and microsecond precision.

Library
core
Note
Returned array index 0 contains the time the page was loaded in milliseconds.
Returned array index 1 contains the time that has elapsed since the time in index 0. It is in the format of [milliseconds].[microseconds];
Returned array index 2 contains an array containing integer timestamps. The array contains items where the following indexes are: [0] = seconds, [1] = milliseconds, [2] = microseconds.
Returned array index 3 contains an array containing float timestamps. The array contains items where the following indexes are: [0] = seconds, [1] = seconds.milliseconds, [2] = seconds.microseconds.
Returns
array
function get_type_ (   $value,
  $flags 
)
function get_user_agent_browser_name_ ( )

Returns a string with name of the browser as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned. *
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_browser_version_ ( )

Returns a string with version of the browser as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned. *
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_cpu_architecture_ ( )

Returns a string with architecture of the browser's operating system as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_data_array_ ( )

Returns an array with details about the browser that has been parsed from the User Agent string. The array indexes are generated from the HCL_CORE_USER_AGENT_xxx defines.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Javascript Specific
The HCL uses the "Lightweight JavaScript-based User-Agent string parser" https://github.com/faisalman/ua-parser-js to determine information from the brower's user agent. In order to use any of the user agent data functions the file ua-parser.min.js must be included in the document or you must use one of the hcl javascript builds that contain that code ( ie hcl.production.min.js or hcl.full.min.js ).
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_device_model_ ( )

Returns a string with name of the device's model as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_device_type_ ( )

Returns a string with type of device as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_device_vendor_ ( )

Returns a string with name of the device's vendor as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_engine_name_ ( )

Returns a string with name of the browser's engine as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_engine_version_ ( )

Returns a string with version of the browser's engine as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_os_name_ ( )

Returns a string with name of the browser's operating system as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_os_version_ ( )

Returns a string with the version of the browser's operating system as parsed from the User Agent string.

Library
core
Note
if the HCL_FEATURES_BROWSER_DETECTION feature is not available (as checked from hcl_feature_) HCL_ERROR_VALUE will be returned.
Returns
array or HCL_ERROR_VALUE on error.
function get_user_agent_string_ ( )

Returns the browsers User Agent string.

Library
core
Returns
string
function hcl_feature_ (   $hcl_feature)
function hcl_features_ ( )
function in_range_ (   $value,
  $minimum,
  $maximum 
)

Checks if a given numeric value is between a minimum and maximum value, inclusive.

Library
core
Note
If any of the given variables are not numeric, the function will return HCL_ERROR_VALUE.
If $minimum and $maximum values are reversed ($minimum > $maximum) or ( $maximum < $minimum), $minimum and $maximum variables will be switched within the function.
Parameters
$valueThe value to be checked. Must be a numeric value.
$minimumThe minimum allowed numeric value. Must be a numeric value.
$maximumThe maximum allowed numeric value. Must be a numeric value.
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function in_range_value_ (   $value,
  $minimum,
  $maximum 
)

Returns a number that is within the minimum and maximum values given.

Library
core
Note
If any of the given variables are not numeric, the function will return HCL_ERROR_VALUE.
If $minimum and $maximum values are reversed ($minimum > $maximum) or ( $maximum < $minimum), $minimum and $maximum will be switched within the function.
If $value is less than $minimum, $minimum will be returned.
If $value is greater than $maximum, $maximum will be returned.
Parameters
$valueThe value to be checked. Must be a numeric value.
$minimumThe minimum allowed value. Must be a numeric value.
$maximumThe maximum allowed value. Must be a numeric value.
Returns
integer or float or HCL_ERROR_VALUE on error.
function integer_to_string_ (   $value)

Returns the given integer value as a string value.

Library
core
Note
If $value is not a integer HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to processed.
Returns
string or HCL_ERROR_VALUE on error.
function is_alphabetic_string_ (   $value)

Determines if a given string contains ONLY characters within the alphabet (ie a-z and A-Z)

Library
core
Sublibrary
variables
Note
If $value is not given false will be returned.
Parameters
$valueValue to be checked.
Returns
boolean true or false.
function is_alphanumeric_string_ (   $value)

Determines if a given string contains ONLY characters within the alphabet or numberic digits (ie a-z and A-Z and 0-9)

Library
core
Sublibrary
variables
Note
If $value is not given false will be returned.
Parameters
$valueValue to be checked.
Returns
boolean true or false.
function is_array_ (   $value)

Determines if a given variable is an array.

Library
core
Sublibrary
variables
Note
If $value is not given false will be returned.
Parameters
$valueValue to be checked.
Returns
boolean true or false.
function is_base_64_string_ (   $value)

Determines if a variable is a base_64 encoded string.

Library
core
Sublibrary
variables
Note
Idea from http://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript.
If $value is not given false will be returned.
If $value is an empty string false will be returned.
Parameters
$valueto be checked.
Returns
boolean true or false.
function is_boolean_ (   $value)

Determines if a variable is a boolean value.

Library
core
Sublibrary
variables
Note
If $value is not given false will be returned.
Parameters
$valueValue to be checked.
Returns
boolean true or false.
function is_boolean_string_ (   $value,
  $terms,
  $case_sensitive 
)

Determines if a variable is a string containing certain values to indicate true or false.

Library
core
Sublibrary
variables
Note
If value is not given false will be returned.
If true_values or false_values is not given or are not strings, HCL_STRING_BOOLEAN_STRING_VALUES will be used instead.
If case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueto be checked.
$termsA comma seperated string of the values to consider boolean true or boolean false.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
boolean true or false.
function is_defined_ (   $value)

Determines if a variable has been defined.

Library
core
Sublibrary
variables
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_digit_string_ (   $value)

Determines if a variable is a string that contains ONLY digits (ie 0,1,2,3,4,5,6,7,8 or 9).

Library
core
Sublibrary
variables
Note
If $value is not a string false will be returned.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_email_string_ (   $value)

Determines if a variable is a string that contains a valid email address.

Library
core
Note
If $value is not given false will be returned.
If the given value is not a string false will be returned.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_empty_string_ (   $value)

Determines if a variable is a string that has no characters (ie "").

Library
core
Note
If $value is not given false will be returned.
If the given value is not a string false will be returned.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_even_ (   $value)

Determif a given variable is even.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an integer false will be returned.
Zero (0) is considered even.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_float_ (   $value)

Determines if a variable is a float.

Library
core
Note
$value MUST be of javascript type Number and have a decimal value to be considered a float.
If $value is not defined HCL_ERROR_VALUE is returned.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_float_string_ (   $value)

Determines if a variable is a string that contains an float value.

Library
core
Note
If $value is not defined false is returned.
If $value is not a string false is returned.
If $value is an empty string, false is returned.
If the string contains an integer value false is returned.
Parameters
$valueThe value to be checked.
Returns
boolean true or false.
function is_function_name_ (   $value)

Determines if the given string is the name of a defined function.

Library
core
Note
If $value is not defined false is returned.
If $value is not a string false is returned.
Parameters
$valueThe value to be checked.
Returns
boolean true or false.
function is_hexidecimal_string_ (   $value)

Determines if a variable is a string containing only hexidecimal values.

Library
core
Note
If $value is not defined false is returned.
If $value is not a string false will be returned.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_integer_ (   $value)

Determines if a variable is an integer.

Library
core
Note
If $value is not defined false is returned.
The $value MUST be of javascript type Number and have no decimal value.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_integer_string_ (   $value)

Determines if a variable is a string that contains an integer value.

Library
core
Note
If $value is not defined false is returned.
Parameters
$valueThe value to be checked.
Returns
boolean true or false.
function is_ip_v4_string_ (   $value)

Determines if a variable is a string that contains a valid IPv4 string.

Library
core
Note
The value MUST be of javascript type string or false will be returned.
Numbers must be integers from 0 to 255.
A string will be considered a valid IPv4 string if it follows the following pattern: ###.###.###.###.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_ip_v6_string_ (   $value)

Determines if a variable is a string that contains a valid IPv6 string.

Library
core
Note
The value MUST be of javascript type string or false will be returned.
Numbers must be hexidecimal numbers from 00-FF (case-insenstive).
A string will be considered a valid IPv6 if it follows the following pattern: ##:##:##:##:##:##.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_json_string_ (   $value)

Determines if a variable is a string that contains a valid json string.

Library
core
Note
If value is not defined false is returned.
Parameters
$valueThe value to be checked.
Returns
boolean true or false.
function is_md5_string_ (   $value)

Determines if a variable is the proper format for an md5 hash string.

Library
core
Note
If $value is not defined false is returned.
A string is considered an md5 hash string if it contains only valid hexidecimal characters and is exactly 32 bytes long.
Parameters
$valueThe value to be checked.
Returns
boolean true or false.
function is_negative_ (   $value)

Determines if a variable is a negative numeric value.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an integer or float false will be returned.
Zero (0) is considered a positive number.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_negative_float_ (   $value)

Determines if a variable is a negative float value.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an float false will be returned.
Zero (0.0) is considered a positive number.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_negative_integer_ (   $value)

Determines if a variable is a negative float value.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an integer false will be returned.
Zero (0) is considered a positive number.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_null_ (   $value)

Determines if a variable is null.

Library
core
Note
If $value is not defined null is returned.
Oddly enough, typeof null returns object. This is for historical reasons, thus we are checking that $value is a null value and not using the typeof operator.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_numeric_ (   $value)

Determines if a variable is either an integer or a float.

Library
core
Note
If $value is not defined false will be returned.
Strings that contain numbers (ie "12") are not considered numeric and will return false.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_numeric_string_ (   $value)

Determines if a variable is a string that contains an integer value or a float value.

Library
core
Note
If $value is not defined false will be returned.
If $value is not a string false will be returned.
Parameters
$valueThe value to be checked.
Returns
boolean true or false.
function is_object_ (   $value)

Determines if a variable is an object.

Library
javascript
Note
If $value is not defined false will be returned.
$value MUST be of javascript type Object or false will be returned.
Oddly enough, typeof null returns object. This is for historical reasons, thus we are checking that the sent variable is an object and not null.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_odd_ (   $value)

Determines if a given variable is odd.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an integer false will be returned.
Zero (0) is considered an even number.
Returns
boolean true or false.
function is_positive_ (   $value)

Determines if a variable is a positive numeric value.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an integer or float false will be returned.
Zero (0) is considered a positive number.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_positive_float_ (   $value)

Determines if a variable is a positive float value.

Library
core
Note
If $value is not given false will be returned.
If $value is anything other than an float false will be returned.
Zero (0) is considered a positive number.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_positive_integer_ (   $value)

Determines if a variable is a positive integer value.

Library
core
Note
If $value is not given false will be returned.
If $value is not an integer, false is returned.
Zero (0) is considered a positive number.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_social_security_number_string_ (   $value)

Determines if a variable is a string that contains a social security number.

Library
core
Note
If $value is not defined false will be returned.
$value MUST be of javascript type string or false will be returned.
A string will be considered a valid Social Security Number if it follows the following pattern: ###-##-####.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_string_ (   $value)

Determines if a variable is a string.

Library
core
Note
If $value is not defined false will be returned.
$value MUST be of javascript type string or false will be returned..
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function is_validated_zip_code_ (   $value)

Determines if $value is listed in the HCL_DATA_ZIP_CODE data files. If so it is a confirmed existing zip code, not just a 5 digit integer.

Library
core
Note
If feature HCL_FEATURES_FULL_ZIP_CODE_VALIDATION is not available HCL_ERROR_VALUE will be returned.
If $value is not a string or integer HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be checked.
Returns
boolean true or false or HCL_ERROR_VALUE.
function is_zip_code_string_ (   $value)

Determines if a variable is a string that contains a zip code.

Library
core
Note
If $value is not defined false will be returned.
$value MUST be of javascript type string.
A string will be considered a valid zip code if it follows the following pattern: ##### or #####-####
Parameters
$valueThe variable to be checked.
Returns
boolean true or false.
function json_to_array_ (   $json)
function json_to_object_ (   $json)
function lower_case_ (   $value)

Returns a string in which all characters have been converted to lower case.

Library
core
Note
If $value is not a string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be converted.
Returns
string or HCL_ERROR_VALUE on error.
function maximum_ (   $values)

Returns the largest numeric value in an array.

Library
core
Note
Any non-numeric values within the array are ignored.
If $values is not an array or an object or a string, HCL_ERROR_VALUE is returned.
Parameters
$valuesAn array or object of numeric values (integer or float) or a csv string of numeric values (integer or float).
Returns
integer or float or HCL_ERROR_VALUE on error.
function md5_ (   $value,
  $lower_case 
)

Returns a string containing an md5 hash of the input string.

Library
core
Note
Based on code from here: https://css-tricks.com/snippets/javascript/javascript-md5
If $value is not a string HCL_ERROR_VALUE will be returned.
If $lower_case is not a boolean true or false or not given, HCL_STRING_MD5_LOWER_CASE_DEFAULT will be used instead.
Parameters
$valueThe variable to be converted to an md5 hash.
$lower_caseIf the returned hash should be lower or upper case.
Returns
string or HCL_ERROR_VALUE on error.
function mean_ (   $values,
  $precision 
)

Returns the average (mean) value of an array of numeric values.

Library
core
Note
Any non-numeric values within the array or object or csv are ignored.
If $values is not an array or an object or a csv, HCL_ERROR_VALUE is returned.
If $precision is not a positive integer, the HCL_MATH_DEFAULT_PRECISION define will be used to determine how many digits of precision to return.
If $precision is not in range (0 to HCL_MATH_MAXIMUM_PRECISION), HCL_MATH_DEFAULT_PRECISION will be used.
Parameters
$valuesAn array or object of numeric values (integer or float) or a csv string of numeric values (integer or float).
$precisionThe precision of the float to be returned.
Returns
float or HCL_ERROR_VALUE on error.
function minimum_ (   $values)

Returns the smallest numeric value (integer or float) in an array.

Library
core
Note
Any non-numeric values within the array are ignored.
If $values is not an array or a comma seperated string, HCL_ERROR_VALUE is returned.
Parameters
$valuesAn array of numeric values (integer or float) or a csv string of numeric values (integer or float).
Returns
integer or float or HCL_ERROR_VALUE on error.
function negate_ (   $value)

Returns the negative value of the given value.

Library
core
Note
If $value is anything other than an integer or float HCL_ERROR_VALUE will be returned.
Parameters
$valueThe value to be negated.
Returns
integer or float or HCL_ERROR_VALUE on error.
function password_strength_ (   $password,
  $minimum_length 
)

Calculates the bits of entropy for a given password.

Library
core
Note
Based on code from here: https://code.tutsplus.com/tutorials/build-a-simple-password-strength--net-7565
Do NOT consider this as an authoritative value. The HCL is designed to be small and simple, so it doesn't use the most advanced algorithms possible.
If $password is not a string, HCL_ERROR_VALUE will be returned.
If $minimum_length is not a positive integer, HCL_STRING_PASSWORD_MINIMUM_LENGTH_DEFAULT will be returned.
Parameters
$passwordThe password to be checked.
$minimum_lengthThe number of characters a password should be to be considered "secure".
Returns
bits of entropy as integer or HCL_ERROR_VALUE on error.
function pi_ ( )

Returns the value of pi.

Library
core
Note
To avoid any possiblity of differences between languages, this function returns pi to 10 decimal places and is determined by an HCL define, not any type of native code.
Returns
float.
function power_ (   $base,
  $exponent,
  $precision 
)

Returns the value base to the exponent power.

Library
core
Note
if $base or $exponent is anything other than numeric (integer or float) HCL_ERROR_VALUE is returned.
if $precision is not a positive integer, then HCL_MATH_DEFAULT_PRECISION is used.
if $precision is an integer that is not between 0 and HCL_MATH_MAXIMUM_PRECISION, then the closest value to 0 or HCL_MATH_MAXIMUM_PRECISION is used.
Returns
float or HCL_ERROR_VALUE on error.
function random_ (   $minimum,
  $maximum 
)

Returns a random integer between minimum and maximum.

Library
core
Note
If the $minimum or $maximum are not integers, the function will return HCL_ERROR_VALUE.
If the $minimum and $maximum values are reversed ($minimum > $maximum) or ($maximum < $minimum), the $minimum and $maximum values will be switched within the function.
Parameters
$minimumThe $minimum allowed value.
$maximumThe $maximum allowed value.
Returns
integer or HCL_ERROR_VALUE on error.
function random_float_ (   $minimum,
  $maximum,
  $precision 
)

Returns a integer between $minimum and $maximum.

Library
core
Note
If any of the given variables are not numeric, the function will return HCL_ERROR_VALUE.
If the minimum and maximum values are reversed ($minimum > $maximum) or ($maximum < $minimum), the $minimum and $maximum values will be switched within the function.
if $precision is not a positive integer, then HCL_MATH_DEFAULT_PRECISION is used.
if $precision is an integer that is not between 0 and HCL_MATH_MAXIMUM_PRECISION, then the closest value to 0 or HCL_MATH_MAXIMUM_PRECISION is used.
Parameters
$minimumThe minimum allowed value.
$maximumThe maximum allowed value.
Returns
float or HCL_ERROR_VALUE on error.
function random_integer_ (   $minimum,
  $maximum 
)

Returns a random integer between $minimum and $maximum.

Library
core
Note
This function is simply a wrapper around random_. Both random_ and random_integer_ are kept to allow for a self-documenting style function name.
function round_ (   $value,
  $precision 
)

Returns a numeric value that is rounded to the given precision.

Library
core
Note
If $value is not given HCL_ERROR_VALUE will be returned.
if $precision is not a positive integer, then HCL_MATH_DEFAULT_PRECISION is used.
if $precision is an integer that is not between 0 and HCL_MATH_MAXIMUM_PRECISION, then the closest value to 0 or HCL_MATH_MAXIMUM_PRECISION is used.
Parameters
$valueThe numeric value to round.
$precisionThe number of decimal points to round to.
Javascript Specific
  • Rounding has been changed from Javascript's default behavior to match php's rounding behavior for negative numbers, which to me makes more sense.
  • ex: In this function -1.5 will round to -2, not -1 as it would in Javascript.
Returns
float or HCL_ERROR_VALUE on error.
function square_ (   $value,
  $precision 
)

Returns the given value raised to the second power and truncated to the given precision.

Library
core
Note
If $value is not numeric HCL_ERROR_VALUE will be returned.
if $precision is not a positive integer, then HCL_MATH_DEFAULT_PRECISION is used.
if $precision is an integer that is not between 0 and HCL_MATH_MAXIMUM_PRECISION, then the closest value to 0 or HCL_MATH_MAXIMUM_PRECISION is used.
Parameters
$valueThe numeric value to round.
$precisionThe number of decimal points to truncate to.
Returns
float or HCL_ERROR_VALUE on error.
function square_root_ (   $value,
  $precision 
)

Returns the square root of the given value truncated to the given precision.

Library
core
Note
If $value is not given HCL_ERROR_VALUE will be returned.
If $value is not a numeric value HCL_ERROR_VALUE will be returned.
if $precision is not a positive integer, then HCL_MATH_DEFAULT_PRECISION is used.
if $precision is an integer that is not between 0 and HCL_MATH_MAXIMUM_PRECISION, then the closest value to 0 or HCL_MATH_MAXIMUM_PRECISION is used.
Parameters
$valueThe numeric value to round.
$precisionThe number of decimal points to truncate to.
Returns
float or HCL_ERROR_VALUE on error.
function string_begins_with_ (   $value,
  $substring,
  $case_sensitive 
)

Checks if a string begins with a given substring.

Library
core
Note
If value is not a string then HCL_ERROR_VALUE is returned.
If substring is not a string then HCL_ERROR_VALUE is returned.
If case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check
$substringThe substring to search the value string for.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function string_contains_ (   $value,
  $substring,
  $case_sensitive 
)

Checks if a string contains a given substring.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $substring is not a string then HCL_ERROR_VALUE is returned.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check.
$substringThe substring to search the value string for.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function string_ends_with_ (   $value,
  $substring,
  $case_sensitive 
)

Checks if a string ends with a given substring.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $substring is not a string then HCL_ERROR_VALUE is returned.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check.
$substringThe substring to search the value string for.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function string_everything_after_ (   $value,
  $substring,
  $case_sensitive 
)

Returns everything after the first occurance of the given substring.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $substring is not a string then HCL_ERROR_VALUE is returned.
If $substring is not found then HCL_STRING_SUBSTRING_NOT_FOUND is returned.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check.
$substringThe substring to search for.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
string or HCL_ERROR_VALUE on error.
function string_everything_before_ (   $value,
  $substring,
  $case_sensitive 
)

Returns everything before the first occurance of the given substring.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $substring is not a string then HCL_ERROR_VALUE is returned.
If $substring is not found then HCL_STRING_SUBSTRING_NOT_FOUND is returned.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check
$substringThe substring to search for.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
string or HCL_ERROR_VALUE on error.
function string_everything_between_ (   $value,
  $first_string,
  $second_string,
  $case_sensitive 
)

Returns everything between the first occurance of $first_string and the first occurance of $second_string.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $first_string is not a string then HCL_ERROR_VALUE is returned.
If $second_string is not a string then HCL_ERROR_VALUE is returned.
If $first_string is not found, HCL_STRING_FIRST_SUBSTRING_NOT_FOUND will be returned.
If $second_string is not found, HCL_STRING_SECOND_SUBSTRING_NOT_FOUND will be returned.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check.
$first_stringThe first string to find in $value.
$second_stringThe first string to find in $value.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
string or HCL_ERROR_VALUE on error.
function string_index_ (   $value,
  $substring,
  $case_sensitive 
)

Returns the index of the first occurance of substring within a string.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $substring is not a string then HCL_ERROR_VALUE is returned.
If $substring is not found HCL_STRING_SUBSTRING_NOT_FOUND is returned.
If case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check.
$substringThe substring to search the primary string for.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
integer or HCL_STRING_SUBSTRING_NOT_FOUND if $substring is not found or HCL_ERROR_VALUE on error.
function string_index_valid_ (   $value,
  $index 
)

Checks if a given $index is inside the bounds of $value.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $value is an empty string then false will be returned.
If $index is not a positive integer then HCL_ERROR_VALUE is returned.
Parameters
$valueThe string to check the index against.
$indexThe zero based index to check.
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function string_length_ (   $value)

Returns the length of a given string.

Library
core
Parameters
$valueThe string to check
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
Returns
boolean true or false or HCL_ERROR_VALUE on error.
function string_longest_line_ (   $value)

Returns the longest string in an array or string that is seperated by end lines.

Library
core
Note
If $value is not an array or string then HCL_ERROR_VALUE is returned.
Code taken from http://stackoverflow.com/questions/6521245/finding-longest-string-in-array.
Parameters
$valueThe string to check.
Returns
string or HCL_ERROR_VALUE on error.
function string_longest_line_index_ (   $value)

Returns the index of the longest string in an array or string that is seperated by end lines.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
Parameters
$valueThe string to check.
Returns
integer or HCL_ERROR_VALUE on error.
function string_longest_line_length_ (   $value)

Returns the length of the longest string in an array or string that is seperated by end lines.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
Parameters
$valueThe string to check.
Returns
integer or HCL_ERROR_VALUE on error.
function string_occurance_count_ (   $value,
  $substring,
  $case_sensitive 
)

Returns the number of times a substring or substring(s) occur within an array or string.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $substring is not an array or string then HCL_ERROR_VALUE is returned.
If $substring is an array, any non string values within the array will be ignored.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe string to check.
$substringThe substring(s) to search the primary string for. Can be a single string or an array of strings.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
integer or HCL_ERROR_VALUE on error.
function string_position_ (   $value,
  $substring,
  $case_sensitive 
)
function string_replace_ (   $value,
  $search,
  $replacement,
  $case_sensitive 
)

Returns the given string with all instances of search replaced by replacement.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $search is not a string then HCL_ERROR_VALUE is returned.
If $replacement is not a string then HCL_ERROR_VALUE is returned.
If $case_sensitive is not given, HCL_STRING_CASE_SENSITIVE_DEFAULT will be used instead.
Parameters
$valueThe initial string.
$searchThe string to search for occurances.
$replacementThe string to replace occurances.
$case_sensitiveWhether the string check should be case sensitive or not.
Returns
string or HCL_ERROR_VALUE on error.
function string_reversed_ (   $value)

Returns the given string in reversed order.

Library
core
Note
$If value is not a string then HCL_ERROR_VALUE is returned.
Parameters
$valueThe string to reverse.
Returns
string or HCL_ERROR_VALUE on error.
function string_to_array_ (   $value,
  $delimiter 
)
function string_to_base64_ (   $value)

Returns the given string converted to base 64.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $value is already a base64 string then HCL_ERROR_VALUE is returned.
Parameters
$valueThe string to be converted.
Returns
string or HCL_ERROR_VALUE on error.
function string_to_float_ (   $value)
function string_to_integer_ (   $value)
function string_truncate_ (   $value,
  $length,
  $append 
)

Returns the given string reduced to the given length.

Library
core
Note
If $value is not a string then HCL_ERROR_VALUE is returned.
If $length is not a positive integer then HCL_ERROR_VALUE is returned.
If $length is greater than the length of value then the entire string will be given.
If $length is zero an empty string will be returned.
If $append is not a string it will be ignored.
Parameters
$valueThe string to be converted.
$lengthThe number of characters of $value to return.
$appendA string value that will be appended to the end of the return string.
Returns
string or HCL_ERROR_VALUE on error.
function string_validate_characters_allowed_ (   $value,
  $characters,
  $case_sensitive 
)

Checks if the given string contains ONLY the allowed characters supplied.

Library
core
Note
If value is not a string then null is returned.
If characters is not given then null is returned.
The characters string is not delimited, so "ABC" not "A,B,C" or "A B C".
If case_sensitive is false or not given, the check will be case sensitive. Otherwise case will be ignored.
Parameters
valueThe string to be converted.
charactersA string containing the characters that are allowed.
case_sensitiveA boolean true or false indicating if the search should be case sensitive or not.
Returns
string or null on error.
function string_validate_characters_forbidden_ (   $value,
  $characters,
  $case_sensitive 
)

Checks to see if the string is valid (ie does not contain any forbidden characters)

Library
core
Note
If value is not a string then null is returned.
If characters is not given then null is returned.
The characters string is not delimited, so "ABC" not "A,B,C" or "A B C".
If case_sensitive is false or not given, the check will be case sensitive. Otherwise case will be ignored.
Parameters
valueThe string to be converted.
charactersA string containing the characters that are forbidden.
case_sensitiveA boolean true or false indicating if the search should be case sensitive or not.
Returns
string or null on error.
function substring_by_length_ (   $value,
  $start,
  $length 
)

Returns a portion of a string.

Library
core
Note
If $value is not a string null will be returned.
If $start is not a positive integer null will be returned.
If $length is not a positive integer the rest of the string will be returned.
Parameters
$valueThe variable to be converted.
$startThe position of the first character to be returned.
$lengthThe position of the first character to be returned.
Returns
string or HCL_ERROR_VALUE on error.
function substring_by_position_ (   $value,
  $start,
  $end 
)

Returns a portion of a string.

Library
core
Note
If $value is not a string null will be returned.
If $start is not a positive integer null will be returned.
If $end is not a positive integer the rest of the string will be returned.
If $start is less than $end, $end and $start will be swapped within the function.
Parameters
$valueThe variable to be converted.
$startThe position of the first character to be returned.
$endThe position of the last character to be returned.
Returns
string or HCL_ERROR_VALUE on error.
function sum_ (   $values,
  $precision,
  $recurse 
)

Returns the sum of the numeric values in an array or comma seperated string.

Library
core
Note
If $values is not an array, an object or a csv string HCL_ERROR_VALUE will be returned.
Any non-numeric items in $values will be ignored.
if $precision is not a positive integer, then HCL_MATH_DEFAULT_PRECISION is used.
if $precision is an integer that is not between 0 and HCL_MATH_MAXIMUM_PRECISION, then the closest value to 0 or HCL_MATH_MAXIMUM_PRECISION is used.
If $recurse is not defined or not a boolean, the value from HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT will be used instead.
Parameters
$valuesAn array of values to be added.
$precisionThe number of decimal points to truncate to.
$recurseDetermines if the function should check each array within the array as well
Javascript Specific
  • $values can be either an array or object.
Returns
float or HCL_ERROR_VALUE on error.
function trim_ (   $value)

Returns a string in which all white space at the beginning of the string and end of the string has been removed.

Library
core
Note
If $value is not a string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be converted.
Returns
string or HCL_ERROR_VALUE on error.
function trim_left_ (   $value)

Returns a string in which all white space at the beginning of the string has been removed.

Library
core
Note
If $value is not a string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be converted.
Returns
string or HCL_ERROR_VALUE on error.
function trim_right_ (   $value)

Returns a string in which all white space at the end of the string has been removed.

Library
core
Note
If $value is not a string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be converted.
Returns
string or HCL_ERROR_VALUE on error.
function truncate_float_ (   $value,
  $precision 
)

Returns a value as a float which has been trucated to the given precision.

Library
core
Note
If $value is not a float value HCL_ERROR_VALUE will be returned.
If $precision is not given HCL_MATH_DEFAULT_PRECISION will be used.
If $precision is greater then HCL_MATH_MAXIMUM_PRECISION then HCL_MATH_MAXIMUM_PRECISION will be used.
As the function name suggests, the returned value will be truncated, not rounded. So truncate_float_(10.1234567, 5) would be truncated to 10.12345 not 10.12346.
Returns
float or HCL_ERROR_VALUE on error.
function upper_case_ (   $value)

Returns a string in which all characters have been converted to upper case.

Library
core
Note
If value is not a string HCL_ERROR_VALUE will be returned.
Parameters
$valueThe variable to be converted.
Returns
string or HCL_ERROR_VALUE on error.

Variable Documentation

var HCL_ARRAY_FUNCTIONS_RECURSE_DEFAULT = false

Determines if an array (or object for javascript) function should recurse by default.

var HCL_ARRAY_SANITIZE_KEEP = "keep"
var HCL_ARRAY_SANITIZE_KEYS = "keys"
var HCL_ARRAY_SANITIZE_REMOVE = "remove"
var HCL_ARRAY_SANITIZE_REPLACE = "replace"
var HCL_ARRAY_SANITIZE_TYPES = "types"
var HCL_ARRAY_SANITIZE_VALUES = "values"
var HCL_ARRAY_SANITIZE_VALUES_RANGE = "range"
var HCL_CORE_USER_AGENT_BROWSER_NAME = 2
var HCL_CORE_USER_AGENT_BROWSER_VERSION = 4
var HCL_CORE_USER_AGENT_CPU_ARCHITECTURE = 1024
var HCL_CORE_USER_AGENT_DEVICE_MODEL = 8
var HCL_CORE_USER_AGENT_DEVICE_TYPE = 16
var HCL_CORE_USER_AGENT_DEVICE_VENDOR = 32
var HCL_CORE_USER_AGENT_ENGINE_NAME = 64
var HCL_CORE_USER_AGENT_ENGINE_VERSION = 128
var HCL_CORE_USER_AGENT_OS_NAME = 256
var HCL_CORE_USER_AGENT_OS_VERSION = 512
var HCL_CORE_USER_AGENT_STRING = 1
var HCL_CORE_USER_AGENT_USER_AGENT_UNDEFINED = 0
var HCL_DEBUG = true

If true debug statements will be output by console.log.

var HCL_DEBUG_LEVEL_ERROR = 4
var HCL_DEBUG_LEVEL_NOTICE = 1
var HCL_DEBUG_LEVEL_OUTPUT = HCL_DEBUG_LEVEL_ERROR
var HCL_DEBUG_LEVEL_WARNING = 2
var HCL_DEBUG_OUTPUT_STACK = true
var HCL_ERROR_VALUE = null

This is the value that will be returned for all errors.

var HCL_FEATURES_BROWSER_DETECTION = 4
var HCL_FEATURES_CONVERSION_DATA_LOADED = 2

Indicates that the HCL function convert_ has the data it needs to perform conversions.

var HCL_FEATURES_FULL_ZIP_CODE_VALIDATION = 8
var HCL_FEATURES_MICROSECOND_TIMESTAMP_PRECISION = 1

Indicates that the HCL can return timestamps to the microsecond (1 / 1,000,000 sec)

var HCL_MATH_DEFAULT_PRECISION = 0

The precision that will be used if no precision if given to a function.

var HCL_MATH_MAXIMUM_PRECISION = 8

The maximum precision that can be set for any function that requires a precision argument.

var HCL_MATH_PI = 3.1415926535

A float for Pi to 10 digits. Taken from http://www.piday.org/million

var HCL_OPERATIONS_EQUAL = "=="
var HCL_OPERATIONS_GREATER_THAN = ">"
var HCL_OPERATIONS_GREATER_THAN_OR_EQUAL = ">="
var HCL_OPERATIONS_LESS_THAN = "<"
var HCL_OPERATIONS_LESS_THAN_OR_EQUAL = "<="
var HCL_OPERATIONS_NOT_EQUAL = "!="
var HCL_STRING_BOOLEAN_STRING_FALSE_VALUES = "f,false,n,no,0"

The string values that are considered false.

var HCL_STRING_BOOLEAN_STRING_TRUE_VALUES = "t,true,y,yes,1"

The string values that are considered true.

var HCL_STRING_BOOLEAN_STRING_VALUES = HCL_STRING_BOOLEAN_STRING_FALSE_VALUES + "," + HCL_STRING_BOOLEAN_STRING_TRUE_VALUES
var HCL_STRING_CAMEL_CASE_EXCEPTIONS = "a,and,or,the"

This variable is a comma delimited string containing words that will be in lower case in the final camelcase string.

var HCL_STRING_CASE_SENSITIVE_DEFAULT = false

This variable determines which value a function with a "case sensitive" argument should use if the argument is not given.

var HCL_STRING_FIRST_SUBSTRING_NOT_FOUND = -2

Indicates that the first given substring is not found when using a string function.

var HCL_STRING_LOWER_CASE_DEFAULT = true

This variable determines if string output should be returned in lower case by default.

var HCL_STRING_MD5_LOWER_CASE_DEFAULT = true

This variable determines if an md5 hash value should be returned in lower case by default.

var HCL_STRING_PASSWORD_MINIMUM_LENGTH_DEFAULT = 8

The length of a string to be considered secure. Used for the password_strength_ function.

var HCL_STRING_REGEX_ALPHA = /^[a-zA-Z]+$/
var HCL_STRING_REGEX_ALPHANUMERIC = /^[0-9a-zA-Z]+$/
var HCL_STRING_REGEX_DIGITS = /^[0-9]+$/
var HCL_STRING_REGEX_EMAIL_ADDRESS = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
var HCL_STRING_REGEX_HEXIDECIMAL = /^[0-9a-fA-F]+$/
var HCL_STRING_SECOND_SUBSTRING_NOT_FOUND = -3

Indicates that the second given substring is not found when using a string function.

var HCL_STRING_SUBSTRING_NOT_FOUND = -1

Indicates that the given substring is not found when using a string function.

var HCL_STRING_TO_ARRAY_DEFAULT_DELIMITER = ","
var HCL_TIMESTAMP_FORMAT_DEFAULT = HCL_TIMESTAMP_FORMAT_INTEGER

This variable determines which value a function with a timestamp format argument should use if the argument is not given.

var HCL_TIMESTAMP_FORMAT_FLOAT = 1

This variable determines that timestamp should be given as floats with the whole second as the integer part and fractions of a second given as the decimal part.

var HCL_TIMESTAMP_FORMAT_INTEGER = 0

This variable determines that timestamp should be given as integers with no decimal part.

var HCL_TIMESTAMP_PRECISION_DEFAULT = HCL_TIMESTAMP_PRECISION_SECOND

This variable determines which value a function with a timestamp precision argument should use if the argument is not given.

var HCL_TIMESTAMP_PRECISION_MICROSECONDS = 2

This variable determines that timestamp should be given in microseconds (1/1000000) since the epoch (00:00 on 01-01-1970).

var HCL_TIMESTAMP_PRECISION_MILLISECONDS = 1

This variable determines that timestamp should be given in milliseconds (1/1000) since the epoch (00:00 on 01-01-1970).

var HCL_TIMESTAMP_PRECISION_SECOND = 0

This variable determines that timestamp should be given in whole seconds since the epoch (00:00 on 01-01-1970).

var HCL_TYPE_ARRAY = "array"

The string definition the HCL uses to indicate an array variable.

var HCL_TYPE_BOOLEAN = "boolean"

The string definition the HCL uses to indicate a boolean variable.

var HCL_TYPE_FLOAT = "float"

The string definition the HCL uses to indicate a float variable.

var HCL_TYPE_INTEGER = "integer"

The string definition the HCL uses to indicate an integer variable.

var HCL_TYPE_NULL = "null"

The string definition the HCL uses to indicate a null variable.

var HCL_TYPE_OBJECT = "object"

The string definition the HCL uses to indicate an object variable.

var HCL_TYPE_STRING = "string"

The string definition the HCL uses to indicate a string variable.

var HCL_TYPE_UNDEFINED = "undefined"

The string definition the HCL uses to indicate an undefined variable.

var HCL_VERSION = "0.1"

The version number of this HCL library.

var JAVASCRIPT_NEW_LINE = "\n"

The new line character for javascript.

var JAVASCRIPT_TYPE_ARRAY = "array"

The string value returned from javascript's typeof operator for an array variable.

var JAVASCRIPT_TYPE_BOOLEAN = "boolean"

The string value returned from javascript's typeof operator for a boolean variable.

var JAVASCRIPT_TYPE_FUNCTION = "function"

The string value returned from javascript's typeof operator for a function variable.

var JAVASCRIPT_TYPE_NULL = "null"

The string value returned from javascript's typeof operator for a null variable.

var JAVASCRIPT_TYPE_NUMERIC = "number"

The string value returned from javascript's typeof operator for a number variable.

var JAVASCRIPT_TYPE_OBJECT = "object"

The string value returned from javascript's typeof operator for an object variable.

var JAVASCRIPT_TYPE_STRING = "string"

The string value returned from javascript's typeof operator for a string variable.

var JAVASCRIPT_TYPE_UNDEFINED = "undefined"

The string value returned from javascript's typeof operator for an undefined variable.