Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Add missing generated code comments #854

Open
MFrpurdy opened this issue Jun 3, 2021 · 0 comments
Open

[C#] Add missing generated code comments #854

MFrpurdy opened this issue Jun 3, 2021 · 0 comments

Comments

@MFrpurdy
Copy link
Contributor

MFrpurdy commented Jun 3, 2021

For a few generated methods, including the new string-based setter/getters that I recently added, the method comments are missing.

    /// <summary>
    /// Vehicle code from Car
    /// </summary>
    public Span<byte> VehicleCodeAsSpan()
    {
        return _buffer.AsSpan<byte>(_offset + 28, VehicleCodeLength);
    }

    public int GetVehicleCode(byte[] dst, int dstOffset)
    {
          const int length = 6;
          return GetVehicleCode(new Span<byte>(dst, dstOffset, length));
    }

    public int GetVehicleCode(Span<byte> dst)
    {
        const int length = 6;
        if (dst.Length < length)
        {
            ThrowHelper.ThrowWhenSpanLengthTooSmall(dst.Length);
        }
    
        _buffer.GetBytes(_offset + 28, dst);
        return length;
    }
   
    public void SetVehicleCode(byte[] src, int srcOffset)
    {
        SetVehicleCode(new ReadOnlySpan<byte>(src, srcOffset, src.Length - srcOffset));
    }
    
    public void SetVehicleCode(ReadOnlySpan<byte> src)
    {
        const int length = 6;
        if (src.Length > length)
        {
            ThrowHelper.ThrowWhenSpanLengthTooLarge(src.Length);
        }
    
        _buffer.SetBytes(_offset + 28, src);
    }
    
    public void SetVehicleCode(string value)
    {
        _buffer.SetNullTerminatedBytesFromString(VehicleCodeResolvedCharacterEncoding, value, _offset + 28, VehicleCodeLength, VehicleCodeNullValue);
    }
    public string GetVehicleCode()
    {
        return _buffer.GetStringFromNullTerminatedBytes(VehicleCodeResolvedCharacterEncoding, _offset + 28, VehicleCodeLength, VehicleCodeNullValue);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant