All files / src/Ice Version.js

92.98% Statements 53/57
100% Branches 7/7
75% Functions 6/8
92.98% Lines 53/57

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 5841x 41x 41x 41x 41x 41x 41x 41x 41x 4264x 4264x 4264x 41x 41x 401x 401x 401x 41x 41x 4177x 4177x 4177x 41x 41x     41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 14011x 14011x 14011x 41x 41x 4927x 4927x 4927x 41x 41x 13732x 13732x 13732x 41x 41x     41x 41x 41x 41x  
// Copyright (c) ZeroC, Inc.
 
export const Ice = {};
 
/**
 *  A version structure for the protocol version.
 */
Ice.ProtocolVersion = class {
    constructor(major = 0, minor = 0) {
        this.major = major;
        this.minor = minor;
    }
 
    _write(ostr) {
        ostr.writeByte(this.major);
        ostr.writeByte(this.minor);
    }
 
    _read(istr) {
        this.major = istr.readByte();
        this.minor = istr.readByte();
    }
 
    static get minWireSize() {
        return 2;
    }
};
 
// Moved to VersionExtensions.js to avoid circular dependencies.
// defineStruct(ProtocolVersion, true, false);
 
/**
 *  A version structure for the encoding version.
 */
Ice.EncodingVersion = class {
    constructor(major = 0, minor = 0) {
        this.major = major;
        this.minor = minor;
    }
 
    _write(ostr) {
        ostr.writeByte(this.major);
        ostr.writeByte(this.minor);
    }
 
    _read(istr) {
        this.major = istr.readByte();
        this.minor = istr.readByte();
    }
 
    static get minWireSize() {
        return 2;
    }
};
 
// Moved to VersionExtensions.js to avoid circular dependencies.
// defineStruct(EncodingVersion, true, false);