diff --git a/init/services/HestiaKERNEL/String/Scan_Any_String.ps1 b/init/services/HestiaKERNEL/String/Scan_Any_String.ps1 new file mode 100644 index 0000000..8e7ed0e --- /dev/null +++ b/init/services/HestiaKERNEL/String/Scan_Any_String.ps1 @@ -0,0 +1,39 @@ +# Copyright 2024 (Holloway) Chew, Kean Ho +# +# +# Licensed under (Holloway) Chew, Kean Ho’s Liberal License (the "License"). +# You must comply with the license to use the content. Get the License at: +# +# https://doi.org/10.5281/zenodo.13770769 +# +# You MUST ensure any interaction with the content STRICTLY COMPLIES with +# the permissions and limitations set forth in the license. +. "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Any_Unicode.ps1" +. "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\To_Unicode_From_String.ps1" + + + + +function HestiaKERNEL-Scan-Any-String { + param ( + [string]$___input, + [string]$___target, + [int32]$___count, + [int32]$___ignore, + [string]$___from_right + ) + + + # execute + $___content = HestiaKERNEL-To-Unicode-From-String $___input + $___chars = HestiaKERNEL-To-Unicode-From-String $___target + + + # report status + return HestiaKERNEL-Scan-Any-Unicode ` + $___content ` + $___chars ` + $___count ` + $___ignore ` + $___from_right +} diff --git a/init/services/HestiaKERNEL/String/Scan_Any_String.sh b/init/services/HestiaKERNEL/String/Scan_Any_String.sh new file mode 100644 index 0000000..21595d2 --- /dev/null +++ b/init/services/HestiaKERNEL/String/Scan_Any_String.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright 2024 (Holloway) Chew, Kean Ho +# +# +# Licensed under (Holloway) Chew, Kean Ho’s Liberal License (the "License"). +# You must comply with the license to use the content. Get the License at: +# +# https://doi.org/10.5281/zenodo.13770769 +# +# You MUST ensure any interaction with the content STRICTLY COMPLIES with +# the permissions and limitations set forth in the license. +. "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Any_Unicode.sh" +. "${LIBS_HESTIA}/HestiaKERNEL/Unicode/To_Unicode_From_String.sh" + + + + +HestiaKERNEL_Scan_Any_String() { + #___input="$1" + #___target="$2" + #___count="$3" + #___ignore="$4" + #___from_right="$5" + + + # execute + ___content="$(HestiaKERNEL_To_Unicode_From_String "$1")" + ___chars="$(HestiaKERNEL_To_Unicode_From_String "$2")" + printf -- "%b" "$(HestiaKERNEL_Scan_Any_Unicode "$___content" "$___chars" "$3" "$4" "$5")" + + + # report status + return $? +} diff --git a/init/services/HestiaKERNEL/Unicode/Scan_Any_Unicode.ps1 b/init/services/HestiaKERNEL/Unicode/Scan_Any_Unicode.ps1 new file mode 100644 index 0000000..f46de55 --- /dev/null +++ b/init/services/HestiaKERNEL/Unicode/Scan_Any_Unicode.ps1 @@ -0,0 +1,42 @@ +# Copyright 2024 (Holloway) Chew, Kean Ho +# +# +# Licensed under (Holloway) Chew, Kean Ho’s Liberal License (the "License"). +# You must comply with the license to use the content. Get the License at: +# +# https://doi.org/10.5281/zenodo.13770769 +# +# You MUST ensure any interaction with the content STRICTLY COMPLIES with +# the permissions and limitations set forth in the license. +. "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Any_Left_Unicode.ps1" +. "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Any_Right_Unicode.ps1" + + + + +function HestiaKERNEL-Scan-Any-Unicode { + param ( + [uint32[]]$___content_unicode, + [uint32[]]$___target_unicode, + [int32]$___count, + [int32]$___ignore, + [string]$___from_right + ) + + + # execute + if ($___from_right -ne "") { + # from right + return HestiaKERNEL-Scan-Any-Right-Unicode ` + $___content_unicode ` + $___target_unicode ` + $___count ` + $___ignore + } else { + return HestiaKERNEL-Scan-Any-Left-Unicode ` + $___content_unicode ` + $___target_unicode ` + $___count ` + $___ignore + } +} diff --git a/init/services/HestiaKERNEL/Unicode/Scan_Any_Unicode.sh b/init/services/HestiaKERNEL/Unicode/Scan_Any_Unicode.sh new file mode 100644 index 0000000..af41ce8 --- /dev/null +++ b/init/services/HestiaKERNEL/Unicode/Scan_Any_Unicode.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Copyright 2024 (Holloway) Chew, Kean Ho +# +# +# Licensed under (Holloway) Chew, Kean Ho’s Liberal License (the "License"). +# You must comply with the license to use the content. Get the License at: +# +# https://doi.org/10.5281/zenodo.13770769 +# +# You MUST ensure any interaction with the content STRICTLY COMPLIES with +# the permissions and limitations set forth in the license. +. "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Any_Left_Unicode.sh" +. "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Any_Right_Unicode.sh" + + + + +HestiaKERNEL_Scan_Any_Unicode() { + #___content_unicode="$1" + #___target_unicode="$2" + #___count="$3" + #___ignore="$4" + #___from_right="$5" + + + # execute + if [ ! "$5" = "" ]; then + printf -- "%b" "$(HestiaKERNEL_Scan_Any_Right_Unicode "$1" "$2" "$3" "$4")" + else + printf -- "%b" "$(HestiaKERNEL_Scan_Any_Left_Unicode "$1" "$2" "$3" "$4")" + fi + + + # report status + return $? +} diff --git a/init/services/HestiaKERNEL/Vanilla.sh.ps1 b/init/services/HestiaKERNEL/Vanilla.sh.ps1 index 0d33c9a..a62024b 100644 --- a/init/services/HestiaKERNEL/Vanilla.sh.ps1 +++ b/init/services/HestiaKERNEL/Vanilla.sh.ps1 @@ -52,6 +52,7 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Is_Whitespace_String.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Any_Left_String.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Any_Right_String.ps1" +. "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Any_String.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Left_String.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Right_String.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_String.ps1" @@ -81,6 +82,7 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null . "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Is_Whitespace_Unicode.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Any_Left_Unicode.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Any_Right_Unicode.ps1" +. "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Any_Unicode.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Left_Unicode.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Right_Unicode.ps1" . "${env:LIBS_HESTIA}\HestiaKERNEL\Unicode\Scan_Unicode.ps1" @@ -135,6 +137,7 @@ RUN_AS_POWERSHELL . "${LIBS_HESTIA}/HestiaKERNEL/String/Is_Whitespace_String.sh" . "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Any_Left_String.sh" . "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Any_Right_String.sh" +. "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Any_String.sh" . "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Left_String.sh" . "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Right_String.sh" . "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_String.sh" @@ -164,6 +167,7 @@ RUN_AS_POWERSHELL . "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Is_Whitespace_Unicode.sh" . "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Any_Left_Unicode.sh" . "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Any_Right_Unicode.sh" +. "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Any_Unicode.sh" . "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Left_Unicode.sh" . "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Right_Unicode.sh" . "${LIBS_HESTIA}/HestiaKERNEL/Unicode/Scan_Unicode.sh" diff --git a/init/start.ps1 b/init/start.ps1 index 43b9871..6dfa869 100644 --- a/init/start.ps1 +++ b/init/start.ps1 @@ -118,6 +118,12 @@ Write-Host "|$(HestiaKERNEL-Scan-String "e你feeeff你你aerg aegE你F" "a" "-1" Write-Host "|$(HestiaKERNEL-Scan-String "e你feeeff你你aerg aegE你F" "a" "-1" "-1")|" Write-Host "----" +Write-Host "---- Scan-Any-String ----" +. "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Any_String.ps1" +Write-Host "|$(HestiaKERNEL-Scan-Any-String "e你feeeff你你aerg aegE你F" "a" "-1" "-1" "right")|" +Write-Host "|$(HestiaKERNEL-Scan-Any-String "e你feeeff你你aerg aegE你F" "a" "-1" "-1")|" +Write-Host "----" + Write-Host "---- Scan-Any-Right-String ----" . "${env:LIBS_HESTIA}\HestiaKERNEL\String\Scan_Any_Right_String.ps1" Write-Host "|$(HestiaKERNEL-Scan-Any-Right-String "e你feeeff你你aerg aegE你F" '')|" diff --git a/init/start.sh b/init/start.sh index 4f3aedf..f54e9ff 100644 --- a/init/start.sh +++ b/init/start.sh @@ -107,6 +107,11 @@ LIBS_HESTIA="${LIBS_UPSCALER}/services" 1>&2 printf -- "|%s|\n" "$(HestiaKERNEL_Scan_String "e你feeeff你你aerg aegE你F" "a" "-1" "-1" "right")" 1>&2 printf -- "|%s|\n" "$(HestiaKERNEL_Scan_String "e你feeeff你你aerg aegE你F" "a" "-1" "-1")" +1>&2 printf -- "---- Scan_Any_String ----\n" +. "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Any_String.sh" +1>&2 printf -- "|%s|\n" "$(HestiaKERNEL_Scan_Any_String "e你feeeff你你aerg aegE你F" "a" "-1" "-1" "right")" +1>&2 printf -- "|%s|\n" "$(HestiaKERNEL_Scan_Any_String "e你feeeff你你aerg aegE你F" "a" "-1" "-1")" + 1>&2 printf -- "---- Scan_Any_Right_String ----\n" . "${LIBS_HESTIA}/HestiaKERNEL/String/Scan_Any_Right_String.sh" 1>&2 printf -- "|%s|\n" "$(HestiaKERNEL_Scan_Any_Right_String "e你feeeff你你aerg aegE你F" "")"