-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
510b677
commit 0d9ac76
Showing
10 changed files
with
141 additions
and
28 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
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,16 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::Ïú»Ù | ||
:: ²ÎÊý1: ʵÀýÃû³Æ | ||
|
||
::Script:Map.Destroy.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
CALL SET "@=%%%~1.@LIST%%" | ||
FOR %%A IN (%@%) DO SET "%~1.%%~A=" | ||
CALL SET "@=%%%~1.@CHILD%%" | ||
FOR %%A IN (%@%) DO CALL Map.Destroy.CMD "%~1.%%~A" | ||
SET "%~1.@LIST=" & SET "%~1.@CHILD=" | ||
EXIT /B |
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,23 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::数据组织: A.XX=* A.YY=* A.ZZ=* | ||
::元素列表: A.@LIST A.B.@LIST A.C.@LIST | ||
::子项列表: A.@CHILD A.B.@CHILD A.C.@CHILD | ||
::数据创建: CALL Map_New.CMD A; | ||
::数据添加: CALL Map_Push.CMD A XX "*"; | ||
::数据访问: CALL Map_Get.CMD A XX; CALL :ARRAY_REMOVE A YY; | ||
::数据遍历: CALL Map_List.CMD A "ECHO {0} {1}"; | ||
::数据销毁: CALL Map_Destroy.CMD A; | ||
|
||
::创建 | ||
:: 参数1: 实例名称 | ||
|
||
::Script:Map.Destroy.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
CALL Map.Destroy.CMD "%~1" | ||
SET "%~1.@LIST=;" | ||
SET "%~1.@CHILD=;" | ||
EXIT /B |
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,16 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::创建子项 | ||
:: 参数1: 实例名称 | ||
:: 参数2: 子项名称 | ||
|
||
::Script:Map.New.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
CALL ECHO.%%%~1.@CHILD%% | FIND /I ";%~2;" 1>NUL 2>&1 || ( | ||
CALL SET "%~1.@CHILD=%%%~1.@CHILD%%%~2;" | ||
CALL Map.New.CMD "%~1.%~2" | ||
) | ||
EXIT /B |
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,14 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::加入 | ||
:: 参数1: 实例名称 | ||
:: 参数2: 键 | ||
:: 参数3: 值 | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
SET "%~1.%~2=%~3" | ||
CALL ECHO.%%%~1.@LIST%% | FIND /I ";%~2;" 1>NUL 2>&1 ^ | ||
|| CALL SET "%~1.@LIST=%%%~1.@LIST%%%~2;" | ||
EXIT /B |
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 |
---|---|---|
@@ -1,26 +1,19 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
::@version 0.2.1 | ||
|
||
::使用(SET "@=%*")也可以达到同样目的 | ||
::但存在无法使用双引号包裹参数问题, 遇到特殊符号会产生歧义 | ||
|
||
::已知问题: 无法处理TAB符号 | ||
|
||
::去首尾空格 | ||
:: 参数1: 目标字符串 | ||
:: 返回@: 处理后的字符串 | ||
|
||
::Script:String.TrimStart.CMD:: | ||
::Script:String.TrimEnd.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
SET "@=%~1" | ||
:_TRIM_START | ||
IF NOT "%@%" == "" IF "%@:~,1%" == " " ( | ||
SET "@=%@:~1%" | ||
GOTO :_TRIM_START | ||
) | ||
:_TRIM_END | ||
IF NOT "%@%" == "" IF "%@:~-1%" == " " ( | ||
SET "@=%@:~,-1%" | ||
GOTO :_TRIM_END | ||
) | ||
CALL String.TrimStart.CMD "%%@%%" | ||
CALL String.TrimEnd.CMD "%%@%%" | ||
EXIT /B |
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,21 @@ | ||
::@author FB | ||
::@version 0.2.1 | ||
|
||
::环境变量扩展在变量未定义时, 会造成未知结果 | ||
|
||
::已知问题: 无法处理TAB符号 | ||
|
||
::去尾空格 | ||
:: 参数1: 目标字符串 | ||
:: 返回@: 处理后的字符串 | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
SET "@=%~1" | ||
:_TRIM_END | ||
IF "%@%" == "" EXIT /B | ||
IF "%@:~-1%" == " " ( | ||
SET "@=%@:~,-1%" | ||
GOTO :_TRIM_END | ||
) | ||
EXIT /B |
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,21 @@ | ||
::@author FB | ||
::@version 0.2.1 | ||
|
||
::环境变量扩展在变量未定义时, 会造成未知结果 | ||
|
||
::已知问题: 无法处理TAB符号 | ||
|
||
::去首空格 | ||
:: 参数1: 目标字符串 | ||
:: 返回@: 处理后的字符串 | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
SET "@=%~1" | ||
:_TRIM_START | ||
IF "%@%" == "" EXIT /B | ||
IF "%@:~,1%" == " " ( | ||
SET "@=%@:~1%" | ||
GOTO :_TRIM_START | ||
) | ||
EXIT /B |
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
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