(encoding?: string)
| 596 | } |
| 597 | |
| 598 | public readText(encoding?: string): Promise<string> { |
| 599 | return new Promise((resolve, reject) => { |
| 600 | try { |
| 601 | this._checkAccess(); |
| 602 | } catch (ex) { |
| 603 | reject(ex); |
| 604 | |
| 605 | return; |
| 606 | } |
| 607 | |
| 608 | this._locked = true; |
| 609 | |
| 610 | getFileAccess() |
| 611 | .readTextAsync(this.path, encoding) |
| 612 | .then( |
| 613 | (result) => { |
| 614 | resolve(result); |
| 615 | this._locked = false; |
| 616 | }, |
| 617 | (error) => { |
| 618 | reject(error); |
| 619 | this._locked = false; |
| 620 | }, |
| 621 | ); |
| 622 | }); |
| 623 | } |
| 624 | |
| 625 | public readTextSync(onError?: (error: any) => any, encoding?: string): string { |
| 626 | this._checkAccess(); |
nothing calls this directly
no test coverage detected