Class CeL.env
環境變數 (environment variables) 與程式會用到的 library 相關變數 / configuration。
Defined in: ce.origin.js.
Constructor Attributes | Constructor Name and Description |
---|---|
CeL.env(name, value)
取得/設定環境變數 enumeration
(雖然不喜歡另開 name-space,但以 2009 當下的 JsDoc Toolkit 來說,似乎沒辦法創造 enumeration。) |
Field Attributes | Field Name and Description |
---|---|
<static> |
CeL.env.global
default global object.
|
<static> |
CeL.env.identifier_RegExp
Legal identifier name in RegExp.
|
<static> |
CeL.env.identifier_String
Legal identifier name in String from env.identifier_RegExp.
|
<static> |
CeL.env.locale
預設語系
0x404:中文-台灣,0x0411:日文-日本
|
<static> |
CeL.env.main_script
|
<static> |
CeL.env.main_script_name
library main file base name
|
<static> |
CeL.env.module_name_separator
預設 module name separator
|
<static> |
CeL.env.new_line
文件預設 new line
|
<static> |
CeL.env.not_to_extend_keyword
module 中的這 member 定義了哪些 member 不被 extend
|
<static> |
CeL.env.organization
creator group / 組織名稱 organization name
|
<static> |
CeL.env.OS
本次執行所在 OS 平台
|
<static> |
CeL.env.path_separator
file system 預設 path separator
platform-dependent path separator character, 決定目錄(directory)分隔 |
<static> |
CeL.env.path_separator_RegExp
path_separator in 通用(regular)運算式
|
<static> |
CeL.env.registry_base
在 registry 中存放 library 資料的 base path
|
<static> |
CeL.env.registry_path
存放在 registry 中的 path,通常指的是 library 在 File System 中的 base path
|
<static> |
CeL.env.script_base_path
base path of script.
|
<static> |
CeL.env.script_extension
default extension of script file.
|
<static> |
CeL.env.script_name
script name
|
<static> |
CeL.env.source_encoding
本 library source 檔案使用之 encoding
不使用會產生語法錯誤 |
Class Detail
CeL.env(name, value)
取得/設定環境變數 enumeration
(雖然不喜歡另開 name-space,但以 2009 當下的 JsDoc Toolkit 來說,似乎沒辦法創造 enumeration。)
(雖然不喜歡另開 name-space,但以 2009 當下的 JsDoc Toolkit 來說,似乎沒辦法創造 enumeration。)
- Parameters:
- {String} name
- 環境變數名稱
- value
- 環境變數之值
- Returns:
- 舊環境變數之值
Field Detail
<static>
{Object}
CeL.env.global
default global object.
有可能為 undefined!
<static>
{RegExp}
CeL.env.identifier_RegExp
Legal identifier name in RegExp.
這 pattern 會佔去兩個筆紀錄: first letter, and least.
.replace(/_/ [g],'for first letter')
.replace(/\\d/,'for least')
這邊列出的只是合法 identifier 的*子集*,且未去除 reserved words!
請注意實際判別須加入 ^..$
不用 \d 而用 0-9 是因為 \d 還包括了 MATHEMATICAL BOLD DIGIT。
基于正则的URL匹配安全性考虑
- See:
- ECMA-262 7.6 Identifier Names and Identifiers
<static>
CeL.env.identifier_String
Legal identifier name in String from env.identifier_RegExp.
<static>
{Number}
CeL.env.locale
預設語系
0x404:中文-台灣,0x0411:日文-日本
- See:
- CultureInfo 類別
<static>
{String}
CeL.env.main_script
<static>
{String}
CeL.env.main_script_name
library main file base name
<static>
{String}
CeL.env.module_name_separator
預設 module name separator
<static>
{String}
CeL.env.new_line
文件預設 new line
<static>
{String}
CeL.env.not_to_extend_keyword
module 中的這 member 定義了哪些 member 不被 extend
<static>
{String}
CeL.env.organization
creator group / 組織名稱 organization name
<static>
{String}
CeL.env.OS
本次執行所在 OS 平台
<static>
{String}
CeL.env.path_separator
file system 預設 path separator
platform-dependent path separator character, 決定目錄(directory)分隔
platform-dependent path separator character, 決定目錄(directory)分隔
<static>
{RegExp}
CeL.env.path_separator_RegExp
path_separator in 通用(regular)運算式
<static>
{String}
CeL.env.registry_base
在 registry 中存放 library 資料的 base path
<static>
{String}
CeL.env.registry_path
存放在 registry 中的 path,通常指的是 library 在 File System 中的 base path
<static>
{String}
CeL.env.script_base_path
base path of script.
TODO
以 reg 代替
<static>
{String}
CeL.env.script_extension
default extension of script file.
設定成 '.' 時由 CeL.get_script_base_path 設定
<static>
{String}
CeL.env.script_name
script name
<static>
{String}
CeL.env.source_encoding
本 library source 檔案使用之 encoding
不使用會產生語法錯誤
不使用會產生語法錯誤