| 1891 | exports.parseList = void 0; |
| 1892 | const formart_1 = require("../../utils/formart"); |
| 1893 | class parseList extends mscorlib.Object { |
| 1894 | _defaultCapacity = lfv(this.handle, "_defaultCapacity").toInt32(); |
| 1895 | _emptyArray = lfv(this.handle, "_emptyArray"); |
| 1896 | _items = lfv(this.handle, "_items"); |
| 1897 | _size = lfv(this.handle, "_size").toInt32(); |
| 1898 | _version = lfv(this.handle, "_version").toInt32(); |
| 1899 | _syncRoot = new mscorlib.Object(lfv(this.handle, "_syncRoot")); |
| 1900 | constructor(handleOrWrapper) { |
| 1901 | super(handleOrWrapper); |
| 1902 | } |
| 1903 | toShow() { |
| 1904 | newLine(); |
| 1905 | formart_1.formartClass.printTitileA(`${new mscorlib.Object(this.handle).toString()} @ ${this.handle}`); |
| 1906 | LOGJSON(this); |
| 1907 | } |
| 1908 | toString() { |
| 1909 | return JSON.stringify(this); |
| 1910 | } |
| 1911 | getItem(index = 0) { |
| 1912 | if (Process.arch != "arm") |
| 1913 | return ptr(0); |
| 1914 | if (index + 1 > this._size) |
| 1915 | throw new Error(`Out of list range: this list maxLen = ${this._size}, input index = ${index + 1}`); |
| 1916 | return this._items.add(p_size * (4 + index)).readPointer(); |
| 1917 | } |
| 1918 | foreach(callback) { |
| 1919 | for (let i = 0; i < this._size; i++) |
| 1920 | callback(this.getItem(i)); |
| 1921 | } |
| 1922 | toArray() { |
| 1923 | const arr = []; |
| 1924 | this.foreach(item => arr.push(item)); |
| 1925 | return arr; |
| 1926 | } |
| 1927 | toSimpleString() { |
| 1928 | return this.toArray().map(item => { |
| 1929 | let action = item.add(p_size * 2).readPointer(); |
| 1930 | let method = new mscorlib.Delegate(action).method; |
| 1931 | LOGE(`\t${method.readPointer().readPointer().sub(soAddr)}`); |
| 1932 | return `${getLine(4, " ")}${item} ("${new Il2Cpp.Object(item).toString()}")`; |
| 1933 | }).join(getLine(4, " ")); |
| 1934 | } |
| 1935 | } |
| 1936 | exports.parseList = parseList; |
| 1937 | globalThis.parseList = (mPtr) => new parseList(checkCmdInput(mPtr)); |
| 1938 | },{"../../utils/formart":186}],17:[function(require,module,exports){ |