mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-05-28 18:56:17 +08:00
业务框架数据层静态配置表Json数据生成 + 数据结构对象代码生成插件
This commit is contained in:
35
extensions/oops-plugin-excel-to-json/node_modules/exceljs/lib/utils/string-builder.js
generated
vendored
Normal file
35
extensions/oops-plugin-excel-to-json/node_modules/exceljs/lib/utils/string-builder.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// StringBuilder - a way to keep string memory operations to a minimum
|
||||
// while building the strings for the xml files
|
||||
class StringBuilder {
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
get length() {
|
||||
return this._buf.length;
|
||||
}
|
||||
|
||||
toString() {
|
||||
return this._buf.join('');
|
||||
}
|
||||
|
||||
reset(position) {
|
||||
if (position) {
|
||||
while (this._buf.length > position) {
|
||||
this._buf.pop();
|
||||
}
|
||||
} else {
|
||||
this._buf = [];
|
||||
}
|
||||
}
|
||||
|
||||
addText(text) {
|
||||
this._buf.push(text);
|
||||
}
|
||||
|
||||
addStringBuf(inBuf) {
|
||||
this._buf.push(inBuf.toString());
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = StringBuilder;
|
||||
Reference in New Issue
Block a user