32 lines
394 B
TypeScript
32 lines
394 B
TypeScript
|
/**
|
||
|
* CAD文件数据
|
||
|
*/
|
||
|
export class NestFiler
|
||
|
{
|
||
|
private readIndex: number = 0
|
||
|
constructor(public _datas: any[] = []) { }
|
||
|
|
||
|
Clear()
|
||
|
{
|
||
|
this._datas.length = 0
|
||
|
return this.Reset()
|
||
|
}
|
||
|
|
||
|
Reset()
|
||
|
{
|
||
|
this.readIndex = 0
|
||
|
return this
|
||
|
}
|
||
|
|
||
|
Write(data: any)
|
||
|
{
|
||
|
this._datas.push(data)
|
||
|
return this
|
||
|
}
|
||
|
|
||
|
Read(): any
|
||
|
{
|
||
|
return this._datas[this.readIndex++]
|
||
|
}
|
||
|
}
|