MxsPack.ms
- MxsPackStruct
- _CP1_
- blankLineRegex
- blockCommentRegex
- commaBreakRegex
- continuationLineRegex
- indentationRegex
- installerRegex
- lfRegex
- lineCommentRegex
- pathUtility
- AppendText
- ClipFile
- ClipText
- CopyDirectory
- DeleteDirectory
- InsertText
- Install
- Minify
- RemoveInstallerOption
- ReplaceText
- Uninstall
- WriteAllText
- isValidPathUtility
- version
- StructName
- Dump
- Equals
- GetVersion
- 依存
struct MxsPackStruct
複数のスクリプトファイルを1ファイルに統合するためのメソッドを提供する。
- 補足
スクリプトファイルは以下の条件を満たしていることが前提となる。
項目 状態 エンコード utf-8
(BOM無し)改行コード LF
public _CP1_
- プロパティ
<String>
作成パラメータ1。相対パスの基準となるディレクトリのパス。必須。既定値は
undefined
。
private blankLineRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
^ *?\n
に一致する正規表現オブジェクト。
private blockCommentRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
^ */\*(?!!)(.|\n)*?\*/\n?
に一致する正規表現オブジェクト。*
は*
に読み替える。
private commaBreakRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
(?<=\(|,)\n
に一致する正規表現オブジェクト。
private continuationLineRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
*\\ *\n *
に一致する正規表現オブジェクト。
private indentationRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
^ +
に一致する正規表現オブジェクト。
private installerRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
(?<=\.RegisterFile \(getSourceFileName\(\)\)) installer:true
に一致する正規表現オブジェクト。
private lfRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
\n
に一致する正規表現オブジェクト。
private lineCommentRegex
- プロパティ
<DotNetObject:System.Text.RegularExpressions.Regex>
^ *--.*?\n
に一致する正規表現オブジェクト。
private pathUtility
- プロパティ
<Struct:PathUtilityStruct>
public fn AppendText
末尾に文字列を追加する。
- パラメータ
source
<String>
元の文字列。
- パラメータ
input
<String>
追加する文字列。
- 戻り値
<String|UndefinedClass>
- 補足
無効な値の場合は
undefined
を返す。
public fn ClipFile
ファイルから指定された範囲の部分文字列を切り出す。
- パラメータ
path
<String>
ファイルパス。相対パスも可。
- パラメータ
fromPos
<Integer>
開始位置。
- パラメータ
stringLength
<Integer>
文字列の長さ。負の値を指定した場合は文字列の末尾までが範囲になる。
- 戻り値
<String|UndefinedClass>
- 補足
基準となるディレクトリが未指定の場合、ファイルが存在しない場合、または範囲指定が正しくない場合は
undefined
を返す。
public fn ClipText
文字列から指定された範囲の部分文字列を切り出す。
- パラメータ
source
<String>
元の文字列。
- パラメータ
fromPos
<Integer>
開始位置。
- パラメータ
stringLength
<Integer>
文字列の長さ。負の値を指定した場合は文字列の末尾までが範囲になる。
- 戻り値
<String|UndefinedClass>
- 補足
範囲指定が正しくない場合は
undefined
を返す。
public fn CopyDirectory
::std.FileUtility.CopyDirectory
メソッドをラップする。
- パラメータ
source
<String>
コピーするディレクトリのパス。相対パスも可。
- パラメータ
destination
<String>
コピー先のパス。相対パスも可。
- 戻り値
<OkClass>
- 補足
常に上書きする。
基準となるディレクトリが未指定の場合は何もしない。
public fn DeleteDirectory
::std.FileUtility.DeleteDirectory
メソッドをラップする。
- パラメータ
path
<String>
相対パスも可。
- 戻り値
<OkClass>
- 補足
常に再帰的に削除する。
基準となるディレクトリが未指定の場合は何もしない。
public fn InsertText
指定した位置に文字列を挿入する。
- パラメータ
source
<String>
元の文字列。
- パラメータ
insertPos
<Integer>
挿入位置。
- パラメータ
input
<String>
挿入文字列。
- 戻り値
<String|UndefinedClass>
- 補足
無効な値の場合は
undefined
を返す。
public fn Install
インストールする。
- 戻り値
<OkClass>
- 補足
静的メソッド。
public fn Minify
コードを最小化する。
- パラメータ
input
<String>
- 戻り値
<String|UndefinedClass>
- 補足
無効な値の場合は
undefined
を返す。
public fn RemoveInstallerOption
Install
メソッドのインストーラオプションを除去する。
- パラメータ
input
<String>
- 戻り値
<String|UndefinedClass>
- 補足
無効な値の場合は
undefined
を返す。
public fn ReplaceText
指定された範囲の文字列を置換した新たな文字列を返す。
- パラメータ
source
<String>
元の文字列。
- パラメータ
fromPos
<Integer>
開始位置。
- パラメータ
stringLength
<Integer>
文字列の長さ。負の値を指定した場合は文字列の末尾までが範囲になる。
- パラメータ
input
<String>
置換文字列。
- 戻り値
<String|UndefinedClass>
- 補足
範囲指定が正しくない場合は
undefined
を返す。
public fn Uninstall
アンインストールする。
- 戻り値
<OkClass>
- 補足
静的メソッド。
public fn WriteAllText
::std.FileUtility.WriteAllText
メソッドをラップする。
- パラメータ
path
<String>
相対パスも可。
- パラメータ
contents
<String|StringStream>
- 戻り値
<OkClass>
- 補足
基準となるディレクトリが未指定の場合は何もしない。
private fn isValidPathUtility
- パラメータ
obj
<Any>
- 戻り値
<BooleanClass>
private version
- プロパティ
<Array[<Integer>]>
バージョン番号。メジャー、マイナー、パッチの順。
public fn StructName
- 戻り値
<Name>
public fn Dump
- パラメータ
indent:
<String>
- パラメータ
out:
<FileStream|StringStream|WindowStream>
出力先。既定値は
listener
。
- 戻り値
<OkClass>
public fn Equals
- パラメータ
obj
<Any>
- 戻り値
<BooleanClass>
- 補足
大文字と小文字を区別する。
public fn GetVersion
- 戻り値
<Array[<Integer>]>