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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 45x 45x 45x 45x 45x 45x 45x 45x 45x 45x 45x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 1x 1x 1x 1x 1x 1x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 1x 1x 31x 2x 2x 2x 31x 31x 31x 31x 31x 31x 31x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 5x 5x 5x 5x 2x 5x 2x 2x 3x 1x 5x 5x 6x 1x 1x 6x 6x 6x 6x 6x 6x 6x 6x 4x 4x 4x 4x 4x 4x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 31x 5x 31x 26x 26x 1x 1x 26x 26x 31x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 4x 48x 44x 44x 44x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 31x 31x 31x 31x 31x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 48x 4x 4x 48x 48x 48x 48x 48x 2x 2x 1x 1x 1x 48x 46x 46x 48x 2x 2x 48x 46x 46x 48x 48x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_filename_logic.clas.abap class zcl_abapgit_filename_logic { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_FILENAME_LOGIC'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"GO_AFF_REGISTRY": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AFF_REGISTRY", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AFF_REGISTRY"});}, "visibility": "I", "is_constant": " ", "is_class": "X"}, "C_PACKAGE_FILE": {"type": () => {return new abap.types.Structure({ "obj_name": new abap.types.Character(7, {}), "sep1": new abap.types.Character(1, {}), "obj_type": new abap.types.Character(4, {}), "sep2": new abap.types.Character(1, {}), "extension": new abap.types.Character(3, {})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "C_JSON_FILE": {"type": () => {return new abap.types.Structure({ "extension": new abap.types.Character(4, {})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}}; static METHODS = {"NAME_ESCAPE": {"visibility": "I", "parameters": {"RV_NAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}}, "NAME_UNESCAPE": {"visibility": "I", "parameters": {"RV_NAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}}, "MAP_FILENAME_TO_OBJECT": {"visibility": "I", "parameters": {"IV_ITEM_PART_OF_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PACKAGE": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});}, "is_optional": " "}, "IO_DOT": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});}, "is_optional": " "}, "CS_ITEM": {"type": () => {return new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}}}, "MAP_OBJECT_TO_FILENAME": {"visibility": "I", "parameters": {"IS_ITEM": {"type": () => {return new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}, "IV_EXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_EXTRA": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "CV_ITEM_PART_OF_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "GET_LANG_AND_EXT": {"visibility": "I", "parameters": {"IV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "EV_LANG": {"type": () => {return new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"});}, "is_optional": " "}, "EV_EXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "DETECT_OBJ_DEFINITION": {"visibility": "U", "parameters": {"IV_TYPE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_EXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "EV_IS_XML": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "EV_IS_JSON": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "IS_OBJ_DEFINITION_FILE": {"visibility": "U", "parameters": {"RV_YES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "FILE_TO_OBJECT": {"visibility": "U", "parameters": {"IV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_DEVCLASS": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});}, "is_optional": " "}, "IO_DOT": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});}, "is_optional": " "}, "ES_ITEM": {"type": () => {return new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}, "EV_IS_XML": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "EV_IS_JSON": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "I18N_FILE_TO_OBJECT": {"visibility": "U", "parameters": {"IV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "ES_ITEM": {"type": () => {return new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}, "EV_LANG": {"type": () => {return new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"});}, "is_optional": " "}, "EV_EXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "OBJECT_TO_FILE": {"visibility": "U", "parameters": {"RV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_ITEM": {"type": () => {return new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}, "IV_EXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_EXTRA": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}}, "OBJECT_TO_I18N_FILE": {"visibility": "U", "parameters": {"RV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_ITEM": {"type": () => {return new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}, "IV_LANG_SUFFIX": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_EXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}}; #go_aff_registry; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { }; this.go_aff_registry = zcl_abapgit_filename_logic.go_aff_registry; this.c_package_file = zcl_abapgit_filename_logic.c_package_file; this.c_json_file = zcl_abapgit_filename_logic.c_json_file; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async detect_obj_definition(INPUT) { return zcl_abapgit_filename_logic.detect_obj_definition(INPUT); } static async detect_obj_definition(INPUT) { let iv_type = INPUT?.iv_type; if (iv_type?.getQualifiedName === undefined || iv_type.getQualifiedName() !== "STRING") { iv_type = undefined; } if (iv_type === undefined) { iv_type = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_type); } let iv_ext = INPUT?.iv_ext; if (iv_ext?.getQualifiedName === undefined || iv_ext.getQualifiedName() !== "STRING") { iv_ext = undefined; } if (iv_ext === undefined) { iv_ext = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_ext); } let ev_is_xml = INPUT?.ev_is_xml || new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let ev_is_json = INPUT?.ev_is_json || new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); ev_is_xml.set(abap.builtin.boolc(abap.compare.eq(iv_ext, abap.builtin.to_upper({val: zcl_abapgit_filename_logic.c_package_file.get().extension})) && abap.compare.eq(abap.builtin.strlen({val: iv_type}), abap.IntegerFactory.get(4)))); ev_is_json.set(abap.builtin.boolc(abap.compare.eq(iv_ext, abap.builtin.to_upper({val: zcl_abapgit_filename_logic.c_json_file.get().extension})) && abap.compare.eq(abap.builtin.strlen({val: iv_type}), abap.IntegerFactory.get(4)))); } async file_to_object(INPUT) { return zcl_abapgit_filename_logic.file_to_object(INPUT); } static async file_to_object(INPUT) { let iv_filename = INPUT?.iv_filename; if (iv_filename?.getQualifiedName === undefined || iv_filename.getQualifiedName() !== "STRING") { iv_filename = undefined; } if (iv_filename === undefined) { iv_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_filename); } 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_devclass = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}); if (INPUT && INPUT.iv_devclass) {iv_devclass.set(INPUT.iv_devclass);} let io_dot = INPUT?.io_dot; if (io_dot?.getQualifiedName === undefined || io_dot.getQualifiedName() !== "ZCL_ABAPGIT_DOT_ABAPGIT") { io_dot = undefined; } if (io_dot === undefined) { io_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"}).set(INPUT.io_dot); } let es_item = INPUT?.es_item || new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}); let ev_is_xml = INPUT?.ev_is_xml || new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let ev_is_json = INPUT?.ev_is_json || new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let lv_name = new abap.types.String({qualifiedName: "STRING"}); let lv_type = new abap.types.String({qualifiedName: "STRING"}); let lv_ext = new abap.types.String({qualifiedName: "STRING"}); abap.statements.split({source: iv_filename, at: abap.CharacterFactory.get(1, '.'), targets: [lv_name,lv_type,lv_ext]}); lv_type.set(abap.builtin.to_upper({val: lv_type})); lv_ext.set(abap.builtin.to_upper({val: lv_ext})); abap.statements.replace({target: lv_name, all: true, with: abap.CharacterFactory.get(1, '/'), of: abap.CharacterFactory.get(1, '#')}); abap.statements.replace({target: lv_type, all: true, with: abap.CharacterFactory.get(1, '/'), of: abap.CharacterFactory.get(1, '#')}); abap.statements.replace({target: lv_ext, all: true, with: abap.CharacterFactory.get(1, '/'), of: abap.CharacterFactory.get(1, '#')}); if (abap.compare.initial(zcl_abapgit_filename_logic.go_aff_registry)) { zcl_abapgit_filename_logic.go_aff_registry.set(await (new abap.Classes['ZCL_ABAPGIT_AFF_REGISTRY']()).constructor_()); } if (abap.compare.eq((await zcl_abapgit_filename_logic.go_aff_registry.get().zif_abapgit_aff_registry$is_supported_object_type({iv_obj_type: new abap.types.String().set(`${abap.templateFormatting(lv_type)}`)})), abap.builtin.abap_true)) { abap.statements.replace({target: lv_name, all: true, with: abap.CharacterFactory.get(1, '/'), of: abap.CharacterFactory.get(1, '(')}); abap.statements.replace({target: lv_name, all: true, with: abap.CharacterFactory.get(1, '/'), of: abap.CharacterFactory.get(1, ')')}); } lv_name.set((await this.name_unescape({iv_name: lv_name}))); es_item.clear(); es_item.get().obj_type.set(lv_type); es_item.get().obj_name.set(abap.builtin.to_upper({val: lv_name})); await this.map_filename_to_object({iv_item_part_of_filename: lv_name, iv_path: iv_path, io_dot: io_dot, iv_package: iv_devclass, cs_item: es_item}); await this.detect_obj_definition({iv_ext: lv_ext, iv_type: lv_type, ev_is_xml: ev_is_xml, ev_is_json: ev_is_json}); } async get_lang_and_ext(INPUT) { return zcl_abapgit_filename_logic.get_lang_and_ext(INPUT); } static async get_lang_and_ext(INPUT) { let iv_filename = INPUT?.iv_filename; if (iv_filename?.getQualifiedName === undefined || iv_filename.getQualifiedName() !== "STRING") { iv_filename = undefined; } if (iv_filename === undefined) { iv_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_filename); } let ev_lang = INPUT?.ev_lang || new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}); let ev_ext = INPUT?.ev_ext || new abap.types.String({qualifiedName: "STRING"}); let lt_filename_elements = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE"); let lv_lang_suffix = new abap.types.String({qualifiedName: "STRING"}); let lv_sap1 = new abap.types.Character(1, {"qualifiedName":"sy-langu","conversionExit":"ISOLA"}); abap.statements.split({source: iv_filename, at: abap.CharacterFactory.get(1, '.'), table: lt_filename_elements}); abap.statements.readTable(lt_filename_elements,{index: abap.builtin.lines({val: lt_filename_elements}), into: ev_ext}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Could not derive file extension of file ${abap.templateFormatting(iv_filename)}`)}); } abap.statements.readTable(lt_filename_elements,{withKey: (i) => {return abap.compare.eq(i.table_line, new abap.types.String().set(`i18n`));}, withKeyValue: [{key: (i) => {return i.table_line}, value: new abap.types.String().set(`i18n`)}], usesTableLine: true, withKeySimple: {"table_line": new abap.types.String().set(`i18n`)}}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { abap.statements.readTable(lt_filename_elements,{index: abap.operators.add(abap.builtin.sy.get().tabix,abap.IntegerFactory.get(1)), into: lv_lang_suffix}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { if (abap.compare.eq(ev_ext, new abap.types.String().set(`po`))) { ev_lang.set(abap.builtin.to_lower({val: lv_lang_suffix})); } else if (abap.compare.eq(ev_ext, new abap.types.String().set(`properties`))) { lv_sap1.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].language_bcp47_to_sap1({im_lang_bcp47: lv_lang_suffix}))); ev_lang.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].language_sap1_to_sap2({im_lang_sap1: lv_sap1}))); } else { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Unexpected translation file format ${abap.templateFormatting(iv_filename)}`)}); } } } if (abap.compare.initial(ev_lang)) { ev_ext.clear(); } } async i18n_file_to_object(INPUT) { return zcl_abapgit_filename_logic.i18n_file_to_object(INPUT); } static async i18n_file_to_object(INPUT) { let iv_filename = INPUT?.iv_filename; if (iv_filename?.getQualifiedName === undefined || iv_filename.getQualifiedName() !== "STRING") { iv_filename = undefined; } if (iv_filename === undefined) { iv_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_filename); } 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 es_item = INPUT?.es_item || new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}); let ev_lang = INPUT?.ev_lang || new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}); let ev_ext = INPUT?.ev_ext || new abap.types.String({qualifiedName: "STRING"}); let lo_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"}); es_item.clear(); ev_lang.clear(); ev_ext.clear(); lo_dot.set((await abap.Classes['ZCL_ABAPGIT_DOT_ABAPGIT'].build_default())); await this.file_to_object({iv_filename: iv_filename, iv_path: iv_path, io_dot: lo_dot, es_item: es_item}); await this.get_lang_and_ext({iv_filename: iv_filename, ev_lang: ev_lang, ev_ext: ev_ext}); } async is_obj_definition_file(INPUT) { return zcl_abapgit_filename_logic.is_obj_definition_file(INPUT); } static async is_obj_definition_file(INPUT) { let rv_yes = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let iv_filename = INPUT?.iv_filename; if (iv_filename?.getQualifiedName === undefined || iv_filename.getQualifiedName() !== "STRING") { iv_filename = undefined; } if (iv_filename === undefined) { iv_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_filename); } let lv_xml = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let lv_json = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let lv_name = new abap.types.String({qualifiedName: "STRING"}); let lv_type = new abap.types.String({qualifiedName: "STRING"}); let lv_ext = new abap.types.String({qualifiedName: "STRING"}); abap.statements.split({source: abap.builtin.to_upper({val: iv_filename}), at: abap.CharacterFactory.get(1, '.'), targets: [lv_name,lv_type,lv_ext]}); await this.detect_obj_definition({iv_ext: lv_ext, iv_type: lv_type, ev_is_xml: lv_xml, ev_is_json: lv_json}); rv_yes.set(abap.builtin.boolc(abap.compare.eq(lv_json, abap.builtin.abap_true) || abap.compare.eq(lv_xml, abap.builtin.abap_true))); return rv_yes; } async map_filename_to_object(INPUT) { return zcl_abapgit_filename_logic.map_filename_to_object(INPUT); } static async map_filename_to_object(INPUT) { let iv_item_part_of_filename = INPUT?.iv_item_part_of_filename; if (iv_item_part_of_filename?.getQualifiedName === undefined || iv_item_part_of_filename.getQualifiedName() !== "STRING") { iv_item_part_of_filename = undefined; } if (iv_item_part_of_filename === undefined) { iv_item_part_of_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_item_part_of_filename); } 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_package = INPUT?.iv_package; if (iv_package?.getQualifiedName === undefined || iv_package.getQualifiedName() !== "DEVCLASS") { iv_package = undefined; } if (iv_package === undefined) { iv_package = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}).set(INPUT.iv_package); } let io_dot = INPUT?.io_dot; if (io_dot?.getQualifiedName === undefined || io_dot.getQualifiedName() !== "ZCL_ABAPGIT_DOT_ABAPGIT") { io_dot = undefined; } if (io_dot === undefined) { io_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"}).set(INPUT.io_dot); } let cs_item = new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}); if (INPUT && INPUT.cs_item) {cs_item = INPUT.cs_item;} let lv_class = new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}); try { lv_class.set(abap.operators.concat(abap.CharacterFactory.get(19, 'ZCL_ABAPGIT_OBJECT_'),cs_item.get().obj_type)); if (abap.Classes[lv_class.get().trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } await abap.dynamicCallLookup(abap.Classes[lv_class.get().trimEnd()], "zif_abapgit_object$map_filename_to_object")({iv_item_part_of_filename: iv_item_part_of_filename,iv_path: iv_path,io_dot: io_dot,iv_package: iv_package,cs_item: cs_item}); } catch (e) { if ((abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'])) { if (abap.compare.eq(cs_item.get().obj_type, abap.CharacterFactory.get(4, 'CONF'))) { cs_item.get().obj_type.set(abap.CharacterFactory.get(4, 'TABU')); } } else { throw e; } } } async map_object_to_filename(INPUT) { return zcl_abapgit_filename_logic.map_object_to_filename(INPUT); } static async map_object_to_filename(INPUT) { let is_item = INPUT?.is_item; if (is_item?.getQualifiedName === undefined || is_item.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_ITEM") { is_item = undefined; } if (is_item === undefined) { is_item = new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}).set(INPUT.is_item); } let iv_ext = INPUT?.iv_ext; if (iv_ext?.getQualifiedName === undefined || iv_ext.getQualifiedName() !== "STRING") { iv_ext = undefined; } if (iv_ext === undefined) { iv_ext = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_ext); } let iv_extra = INPUT?.iv_extra; let cv_item_part_of_filename = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.cv_item_part_of_filename) {cv_item_part_of_filename = INPUT.cv_item_part_of_filename;} let lv_class = new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}); try { lv_class.set(abap.operators.concat(abap.CharacterFactory.get(19, 'ZCL_ABAPGIT_OBJECT_'),is_item.get().obj_type)); if (abap.Classes[lv_class.get().trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } await abap.dynamicCallLookup(abap.Classes[lv_class.get().trimEnd()], "zif_abapgit_object$map_object_to_filename")({is_item: is_item,iv_ext: iv_ext,iv_extra: iv_extra,cv_item_part_of_filename: cv_item_part_of_filename}); } catch (e) { if ((abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'])) { } else { throw e; } } } async name_escape(INPUT) { return zcl_abapgit_filename_logic.name_escape(INPUT); } static async name_escape(INPUT) { let rv_name = new abap.types.String({qualifiedName: "STRING"}); let iv_name = INPUT?.iv_name; rv_name.set(iv_name); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%23'), of: new abap.types.String().set(`#`)}); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%25'), of: new abap.types.String().set(`%`)}); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%2e'), of: new abap.types.String().set(`.`)}); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%3c'), of: new abap.types.String().set(`<`)}); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%3d'), of: new abap.types.String().set(`=`)}); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%3e'), of: new abap.types.String().set(`>`)}); abap.statements.replace({target: rv_name, all: true, with: abap.CharacterFactory.get(3, '%3f'), of: new abap.types.String().set(`?`)}); return rv_name; } async name_unescape(INPUT) { return zcl_abapgit_filename_logic.name_unescape(INPUT); } static async name_unescape(INPUT) { let rv_name = new abap.types.String({qualifiedName: "STRING"}); let iv_name = INPUT?.iv_name; rv_name.set((await abap.Classes['CL_HTTP_UTILITY'].if_http_utility$unescape_url({escaped: iv_name}))); return rv_name; } async object_to_file(INPUT) { return zcl_abapgit_filename_logic.object_to_file(INPUT); } static async object_to_file(INPUT) { let rv_filename = new abap.types.String({qualifiedName: "STRING"}); let is_item = INPUT?.is_item; if (is_item?.getQualifiedName === undefined || is_item.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_ITEM") { is_item = undefined; } if (is_item === undefined) { is_item = new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}).set(INPUT.is_item); } let iv_ext = INPUT?.iv_ext; if (iv_ext?.getQualifiedName === undefined || iv_ext.getQualifiedName() !== "STRING") { iv_ext = undefined; } if (iv_ext === undefined) { iv_ext = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_ext); } let iv_extra = INPUT?.iv_extra || new abap.types.Character(); let lv_obj_name = new abap.types.String({qualifiedName: "STRING"}); let lv_obj_type = new abap.types.String({qualifiedName: "STRING"}); let lv_nb_of_slash = new abap.types.String({qualifiedName: "STRING"}); let lv_keep_case = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); lv_obj_name.set((abap.builtin.to_lower({val: (await this.name_escape({iv_name: is_item.get().obj_name}))}))); lv_obj_type.set(abap.builtin.to_lower({val: is_item.get().obj_type})); rv_filename.set(lv_obj_name); try { await this.map_object_to_filename({is_item: is_item, iv_ext: iv_ext, iv_extra: iv_extra, cv_item_part_of_filename: rv_filename}); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) { } else { throw e; } } abap.statements.concatenate({source: [rv_filename, abap.CharacterFactory.get(1, '.'), lv_obj_type], target: rv_filename}); if (abap.compare.initial(iv_extra) === false) { abap.statements.concatenate({source: [rv_filename, abap.CharacterFactory.get(1, '.'), iv_extra], target: rv_filename}); } if (abap.compare.initial(iv_ext) === false) { abap.statements.concatenate({source: [rv_filename, abap.CharacterFactory.get(1, '.'), iv_ext], target: rv_filename}); } zcl_abapgit_filename_logic.go_aff_registry.set(await (new abap.Classes['ZCL_ABAPGIT_AFF_REGISTRY']()).constructor_()); if (abap.compare.eq((await zcl_abapgit_filename_logic.go_aff_registry.get().zif_abapgit_aff_registry$is_supported_object_type({iv_obj_type: is_item.get().obj_type})), abap.builtin.abap_true)) { abap.statements.find(rv_filename, {find: new abap.types.String().set(`/`), first: false, count: lv_nb_of_slash}); if (abap.compare.eq(lv_nb_of_slash, abap.IntegerFactory.get(2))) { abap.statements.replace({target: rv_filename, all: false, with: new abap.types.String().set(`(`), of: new abap.types.String().set(`/`)}); abap.statements.replace({target: rv_filename, all: false, with: new abap.types.String().set(`)`), of: new abap.types.String().set(`/`)}); } } else { abap.statements.replace({target: rv_filename, all: true, with: abap.CharacterFactory.get(1, '#'), of: abap.CharacterFactory.get(1, '/')}); } if (abap.compare.eq(iv_ext, abap.CharacterFactory.get(10, 'properties'))) { lv_keep_case.set(abap.builtin.abap_true); } if (abap.compare.eq(lv_keep_case, abap.builtin.abap_false)) { abap.statements.translate(rv_filename, "LOWER"); } return rv_filename; } async object_to_i18n_file(INPUT) { return zcl_abapgit_filename_logic.object_to_i18n_file(INPUT); } static async object_to_i18n_file(INPUT) { let rv_filename = new abap.types.String({qualifiedName: "STRING"}); let is_item = INPUT?.is_item; if (is_item?.getQualifiedName === undefined || is_item.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_ITEM") { is_item = undefined; } if (is_item === undefined) { is_item = new abap.types.Structure({ "obj_type": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "srcsystem": new abap.types.Character(5, {}), "origlang": new abap.types.Character(1, {}), "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}).set(INPUT.is_item); } let iv_lang_suffix = INPUT?.iv_lang_suffix; if (iv_lang_suffix?.getQualifiedName === undefined || iv_lang_suffix.getQualifiedName() !== "STRING") { iv_lang_suffix = undefined; } if (iv_lang_suffix === undefined) { iv_lang_suffix = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_lang_suffix); } let iv_ext = INPUT?.iv_ext; if (iv_ext?.getQualifiedName === undefined || iv_ext.getQualifiedName() !== "STRING") { iv_ext = undefined; } if (iv_ext === undefined) { iv_ext = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_ext); } rv_filename.set((await this.object_to_file({is_item: is_item, iv_extra: new abap.types.String().set(`i18n.${abap.templateFormatting(iv_lang_suffix)}`), iv_ext: iv_ext}))); return rv_filename; } } abap.Classes['ZCL_ABAPGIT_FILENAME_LOGIC'] = zcl_abapgit_filename_logic; zcl_abapgit_filename_logic.go_aff_registry = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AFF_REGISTRY", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AFF_REGISTRY"}); zcl_abapgit_filename_logic.c_package_file = new abap.types.Structure({ "obj_name": new abap.types.Character(7, {}), "sep1": new abap.types.Character(1, {}), "obj_type": new abap.types.Character(4, {}), "sep2": new abap.types.Character(1, {}), "extension": new abap.types.Character(3, {})}, undefined, undefined, {}, {}); zcl_abapgit_filename_logic.c_package_file.get().obj_name.set('package'); zcl_abapgit_filename_logic.c_package_file.get().sep1.set('.'); zcl_abapgit_filename_logic.c_package_file.get().obj_type.set('devc'); zcl_abapgit_filename_logic.c_package_file.get().sep2.set('.'); zcl_abapgit_filename_logic.c_package_file.get().extension.set('xml'); zcl_abapgit_filename_logic.c_json_file = new abap.types.Structure({ "extension": new abap.types.Character(4, {})}, undefined, undefined, {}, {}); zcl_abapgit_filename_logic.c_json_file.get().extension.set('json'); export {zcl_abapgit_filename_logic}; |