All files / output zcl_abapgit_git_delta.clas.locals.mjs

87.69% Statements 57/65
100% Branches 7/7
40% Functions 6/15
87.69% Lines 57/65

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 651x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 1x                 1x 2x 2x 2x 2x 1x 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 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": " "}}},
  "EAT_BYTE": {"visibility": "U", "parameters": {"RV_X": {"type": () => {return new abap.types.Hex();}, "is_optional": " "}}},
  "EAT_BYTES": {"visibility": "U", "parameters": {"RV_X": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}, "IV_LENGTH": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}},
  "HAS_DATA": {"visibility": "U", "parameters": {"RV_DATA": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}};
  #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),
    };
    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;
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM'] = lcl_stream;
lcl_stream.ty_hex = new abap.types.Hex();
export {lcl_stream};