All files / output zcl_abapgit_git_delta.clas.locals.mjs

93.84% Statements 122/130
88.88% Branches 16/18
36.84% Functions 7/19
93.84% Lines 122/130

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 1301x 1x 11x 11x 11x 11x 11x 11x 11x 11x 11x 1x 1x 1x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 3x 3x 3x 3x 3x 11x                 11x 2x 2x 2x 2x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 5x 5x 5x 5x 11x 3x 3x 3x 3x 11x 2x 2x 2x 2x 11x 2x 2x 2x 2x 11x 11x 6x 6x 6x 6x 11x 3x 3x 3x 3x 11x 2x 2x 2x 2x 11x 5x 5x 11x 11x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_git_delta.clas.locals_def.abap// zcl_abapgit_git_delta.clas.locals_imp.abap
class lcl_stream {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"MV_DATA": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_POSITION": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_LENGTH": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"CONSTRUCTOR": {"visibility": "U", "parameters": {"IV_DATA": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " ", "parm_kind": "I", "type_name": "XStringType"}}},
  "EAT_BYTE": {"visibility": "U", "parameters": {"RV_X": {"type": () => {return new abap.types.Hex();}, "is_optional": " ", "parm_kind": "R", "type_name": "HexType"}}},
  "EAT_BYTES": {"visibility": "U", "parameters": {"RV_X": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "XStringType"}, "IV_LENGTH": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "I", "type_name": "IntegerType"}}},
  "HAS_DATA": {"visibility": "U", "parameters": {"RV_DATA": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "R", "type_name": "CharacterType"}}},
  "EAT_OFFSET_AND_LENGTH": {"visibility": "U", "parameters": {"IV_INSTRUCTION": {"type": () => {return new abap.types.Hex();}, "is_optional": " ", "parm_kind": "I", "type_name": "HexType"}, "EV_OFFSET": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "E", "type_name": "IntegerType"}, "EV_LENGTH": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "E", "type_name": "IntegerType"}}}};
  #mv_data;
  #mv_position;
  #mv_length;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "eat_byte": this.eat_byte.bind(this),
      "eat_bytes": this.eat_bytes.bind(this),
      "has_data": this.has_data.bind(this),
      "eat_offset_and_length": this.eat_offset_and_length.bind(this),
    };
    this.#mv_data = new abap.types.XString({qualifiedName: "XSTRING"});
    this.FRIENDS_ACCESS_INSTANCE["mv_data"] = this.#mv_data;
    this.#mv_position = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_position"] = this.#mv_position;
    this.#mv_length = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_length"] = this.#mv_length;
  }
  async constructor_(INPUT) {
    let iv_data = INPUT?.iv_data;
    if (iv_data?.getQualifiedName === undefined || iv_data.getQualifiedName() !== "XSTRING") { iv_data = undefined; }
    if (iv_data === undefined) { iv_data = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_data); }
    this.#mv_data.set(iv_data);
    this.#mv_position.set(abap.IntegerFactory.get(0));
    this.#mv_length.set(abap.builtin.xstrlen({val: this.#mv_data}));
    return this;
  }
  async eat_byte() {
    let rv_x = new abap.types.Hex();
    rv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
    this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
    return rv_x;
  }
  async eat_bytes(INPUT) {
    let rv_x = new abap.types.XString({qualifiedName: "XSTRING"});
    let iv_length = INPUT?.iv_length;
    if (iv_length?.getQualifiedName === undefined || iv_length.getQualifiedName() !== "I") { iv_length = undefined; }
    if (iv_length === undefined) { iv_length = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_length); }
    rv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: iv_length}));
    this.#mv_position.set(abap.operators.add(this.#mv_position,iv_length));
    return rv_x;
  }
  async has_data() {
    let rv_data = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    rv_data.set(abap.builtin.boolc(abap.compare.lt(this.#mv_position, this.#mv_length)));
    return rv_data;
  }
  async eat_offset_and_length(INPUT) {
    let iv_instruction = INPUT?.iv_instruction;
    if (iv_instruction?.getQualifiedName === undefined || iv_instruction.getQualifiedName() !== "LCL_STREAM=>TY_HEX") { iv_instruction = undefined; }
    if (iv_instruction === undefined) { iv_instruction = new abap.types.Hex().set(INPUT.iv_instruction); }
    let ev_offset = INPUT?.ev_offset || new abap.types.Integer({qualifiedName: "I"});
    let ev_length = INPUT?.ev_length || new abap.types.Integer({qualifiedName: "I"});
    let lc_1 = new abap.types.Hex();
    lc_1.set('01');
    let lc_2 = new abap.types.Hex();
    lc_2.set('02');
    let lc_4 = new abap.types.Hex();
    lc_4.set('04');
    let lc_8 = new abap.types.Hex();
    lc_8.set('08');
    let lc_16 = new abap.types.Hex();
    lc_16.set('10');
    let lc_32 = new abap.types.Hex();
    lc_32.set('20');
    let lc_64 = new abap.types.Hex();
    lc_64.set('40');
    let lv_x = new abap.types.Hex();
    ev_offset.set(abap.IntegerFactory.get(0));
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_1), lc_1)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_offset.set(lv_x);
    }
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_2), lc_2)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_offset.set(abap.operators.add(ev_offset,abap.operators.multiply(lv_x,new abap.types.Integer().set(256))));
    }
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_4), lc_4)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_offset.set(abap.operators.add(ev_offset,abap.operators.multiply(lv_x,new abap.types.Integer().set(65536))));
    }
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_8), lc_8)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_offset.set(abap.operators.add(ev_offset,abap.operators.multiply(lv_x,new abap.types.Integer().set(16777216))));
    }
    ev_length.set(abap.IntegerFactory.get(0));
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_16), lc_16)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_length.set(lv_x);
    }
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_32), lc_32)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_length.set(abap.operators.add(ev_length,abap.operators.multiply(lv_x,new abap.types.Integer().set(256))));
    }
    if (abap.compare.eq(abap.operators.bitand(iv_instruction,lc_64), lc_64)) {
      lv_x.set(this.#mv_data.getOffset({offset: this.#mv_position, length: 1}));
      this.#mv_position.set(abap.operators.add(this.#mv_position,abap.IntegerFactory.get(1)));
      ev_length.set(abap.operators.add(ev_length,abap.operators.multiply(lv_x,new abap.types.Integer().set(65536))));
    }
    if (abap.compare.eq(ev_length, abap.IntegerFactory.get(0))) {
      ev_length.set(new abap.types.Integer().set(65536));
    }
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM'] = lcl_stream;
lcl_stream.ty_hex = new abap.types.Hex();
export {lcl_stream};