Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 3x 7x 4x 2x 2x 2x 2x 2x 2x 2x 2x 1x 1x 1x 1x 7x 7x 1x 1x 7x 7x 7x 7x 7x 7x 7x 7x 2x 7x 5x 5x 7x 7x 7x 7x 7x 7x 1x 1x 4x 4x 4x 4x 4x 4x 4x 1x 1x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 1x 1x 19x 19x 19x 19x 19x 19x 19x 19x 19x 17x 17x 19x 2x 2x 2x 19x 19x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_path.clas.abap class zcl_abapgit_path { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_PATH'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {}; static METHODS = {"SPLIT_FILE_LOCATION": {"visibility": "U", "parameters": {"IV_FULLPATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "EV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "EV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "IS_ROOT": {"visibility": "U", "parameters": {"RV_YES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "IS_SUBDIR": {"visibility": "U", "parameters": {"RV_YES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PARENT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "CHANGE_DIR": {"visibility": "U", "parameters": {"RV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_CUR_DIR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_CD": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "GET_FILENAME_FROM_SYSPATH": {"visibility": "U", "parameters": {"RV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}}; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { }; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async change_dir(INPUT) { return zcl_abapgit_path.change_dir(INPUT); } static async change_dir(INPUT) { let rv_path = new abap.types.String({qualifiedName: "STRING"}); let iv_cur_dir = INPUT?.iv_cur_dir; if (iv_cur_dir?.getQualifiedName === undefined || iv_cur_dir.getQualifiedName() !== "STRING") { iv_cur_dir = undefined; } if (iv_cur_dir === undefined) { iv_cur_dir = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_cur_dir); } let iv_cd = INPUT?.iv_cd; if (iv_cd?.getQualifiedName === undefined || iv_cd.getQualifiedName() !== "STRING") { iv_cd = undefined; } if (iv_cd === undefined) { iv_cd = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_cd); } let lv_last = new abap.types.Integer({qualifiedName: "I"}); let lv_temp = new abap.types.String({qualifiedName: "STRING"}); lv_last.set(abap.operators.minus(abap.builtin.strlen({val: iv_cur_dir}),abap.IntegerFactory.get(1))); if (abap.compare.eq(iv_cd, abap.CharacterFactory.get(1, '')) || abap.compare.eq(iv_cd, abap.CharacterFactory.get(1, '.'))) { rv_path.set(iv_cur_dir); } else if (abap.compare.eq(iv_cd.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '/'))) { rv_path.set(iv_cd); } else if (abap.compare.eq(iv_cd, abap.CharacterFactory.get(2, '..'))) { if (abap.compare.eq(iv_cur_dir, abap.CharacterFactory.get(1, '/')) || abap.compare.eq(iv_cur_dir, abap.CharacterFactory.get(1, ''))) { rv_path.set(iv_cur_dir); } else { lv_temp.set(abap.builtin.reverse({val: iv_cur_dir})); if (abap.compare.eq(lv_temp.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '/'))) { abap.statements.shift(lv_temp, {direction: 'LEFT',places: abap.IntegerFactory.get(1)}); } abap.statements.shift(lv_temp, {direction: 'LEFT',to: abap.CharacterFactory.get(1, '/')}); rv_path.set(abap.builtin.reverse({val: lv_temp})); } } else if (abap.compare.eq(iv_cur_dir.getOffset({offset: lv_last, length: 1}), abap.CharacterFactory.get(1, '/'))) { rv_path.set(abap.operators.concat(iv_cur_dir,iv_cd)); } else { rv_path.set(abap.operators.concat(iv_cur_dir,abap.operators.concat(abap.CharacterFactory.get(1, '/'),iv_cd))); } return rv_path; } async get_filename_from_syspath(INPUT) { return zcl_abapgit_path.get_filename_from_syspath(INPUT); } static async get_filename_from_syspath(INPUT) { let rv_filename = new abap.types.String({qualifiedName: "STRING"}); let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let lv_split = new abap.types.Character(1, {}); let lv_index = new abap.types.Integer({qualifiedName: "I"}); let lt_split = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); if (abap.compare.ca(iv_path, abap.CharacterFactory.get(1, '/'))) { lv_split.set(abap.CharacterFactory.get(1, '/')); } else { lv_split.set(abap.CharacterFactory.get(1, '\\')); } abap.statements.split({source: iv_path, at: lv_split, table: lt_split}); lv_index.set(abap.builtin.lines({val: lt_split})); abap.statements.readTable(lt_split,{index: lv_index, into: rv_filename}); return rv_filename; } async is_root(INPUT) { return zcl_abapgit_path.is_root(INPUT); } static async is_root(INPUT) { let rv_yes = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } rv_yes.set(abap.builtin.boolc(abap.compare.eq(iv_path, abap.CharacterFactory.get(1, '/')))); return rv_yes; } async is_subdir(INPUT) { return zcl_abapgit_path.is_subdir(INPUT); } static async is_subdir(INPUT) { let rv_yes = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let iv_parent = INPUT?.iv_parent; if (iv_parent?.getQualifiedName === undefined || iv_parent.getQualifiedName() !== "STRING") { iv_parent = undefined; } if (iv_parent === undefined) { iv_parent = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_parent); } let lv_len = new abap.types.Integer({qualifiedName: "I"}); let lv_last = new abap.types.Integer({qualifiedName: "I"}); lv_len.set(abap.builtin.strlen({val: iv_parent})); lv_last.set(abap.operators.minus(lv_len,abap.IntegerFactory.get(1))); rv_yes.set(abap.builtin.boolc(abap.compare.gt(abap.builtin.strlen({val: iv_path}), lv_len) && abap.compare.eq(iv_path.getOffset({offset: 0, length: lv_len}), iv_parent) && (abap.compare.eq(iv_parent.getOffset({offset: lv_last, length: 1}), abap.CharacterFactory.get(1, '/')) || abap.compare.eq(iv_path.getOffset({offset: lv_len, length: 1}), abap.CharacterFactory.get(1, '/'))))); return rv_yes; } async split_file_location(INPUT) { return zcl_abapgit_path.split_file_location(INPUT); } static async split_file_location(INPUT) { let iv_fullpath = INPUT?.iv_fullpath; if (iv_fullpath?.getQualifiedName === undefined || iv_fullpath.getQualifiedName() !== "STRING") { iv_fullpath = undefined; } if (iv_fullpath === undefined) { iv_fullpath = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_fullpath); } let ev_path = INPUT?.ev_path || new abap.types.String({qualifiedName: "STRING"}); let ev_filename = INPUT?.ev_filename || new abap.types.String({qualifiedName: "STRING"}); let lv_cnt = new abap.types.Integer({qualifiedName: "I"}); let lv_len = new abap.types.Integer({qualifiedName: "I"}); abap.statements.find(iv_fullpath, {regex: abap.CharacterFactory.get(8, '^/(.*/)?'), first: true, count: lv_cnt, length: lv_len}); if (abap.compare.gt(lv_cnt, abap.IntegerFactory.get(0))) { ev_path.set(iv_fullpath.getOffset({offset: 0, length: lv_len})); ev_filename.set(iv_fullpath.getOffset({offset: lv_len})); } else { ev_path.clear(); ev_filename.set(iv_fullpath); } ev_filename.set((await abap.Classes['CL_HTTP_UTILITY'].if_http_utility$unescape_url({escaped: ev_filename}))); } } abap.Classes['ZCL_ABAPGIT_PATH'] = zcl_abapgit_path; export {zcl_abapgit_path}; |