-
Notifications
You must be signed in to change notification settings - Fork 101
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
impl #63 #98
Draft
JohannesKauffmann
wants to merge
7
commits into
master
Choose a base branch
from
impl-63
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
impl #63 #98
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added ISegment and DataSegment base classes, and concrete ANSI Extented Symbol Segment implementation. ISegment: - add: Abstract base class which provides segment types and methods to concrete segments. DataSegment: - add: Abstract class, extends from ISegment. Provides DataSegment subtypes to concrete DataSegment implementations. ANSISegment: - Add: Concrete DataSegment implementation, provides functionality for encoding ANSI data. EPath: - add: Constructor which takes a collection of segments to be requested. - add: member which stores the segment collection. - chg: packPaddedPath() and getSizeInWords() check to see if the segment member is empty. If not, packPaddedPath() encodes the segment collection instead of class/object/attribute id, and getSizeInWords() calculates the size of the segment collection instead of the id's.
{ANSI,Data}Segment/EPath: - Fixed some stylistic issues LogicalSegment: - Added LogicalSegment abstract class which inherits from ISegment and contains enums for the logical type bits and logical format bits. MemberIDSegment: - Added concrete MemberIDSegment class which inherits from LogicalSegment and implements encoding a Member ID logical value as either 8bit or 16bit.
EPath: - add: Added documentation of functions to header file. - chg: toString() now prints all segments when needed. - chg: expandPaddedPath doesn't try to decode the given vector when the EPath consists of a collection of segments. - fix: Initialize all member variables in every constructor. ISegment: - add: virtual function to calculate the segment header, and virtual function to stringify the segment data. MemberIDSegment: - fix: Previously, the 16bit format was set in the constructor, even when the 8bit format was indicated. - impl: getSegmentHeader() and toString() function. ANSISegment: - impl: getSegmentHeader() and toString() function.
ISegment: - add: Added documentation to the protected contructor and _data member variable as to their usages. - chg: The encode() method and getSize() method are now called data() and size(), respectively, to represent their new roles. Their implementations in the concrete ANSISegment and MemberIDSegment class now just return the data and size, instead of doing complex encoding and size calculations. ANSISegment: - chg: Constructor now encodes the data with header, size and optional padding information instead of the renamed encode() method. The toString method has been refactored to return the correct string. MemberIDSegment: - chg: Constructor now encodes the data with header and correct format information instead of the renamed encode() method. The toString method has been refactored to return the correct string.
ANSISegment: fix: Previously, when the segment didn't hold any actual data, the toString() function would crash trying to construct an empty string. This was because the string is constructed from the beginning of the data vector minus two bytes (for the header byte and length byte) to the end of the data vector, minus a possible pad byte. When the data length byte was zero, the check for the padding interpreted the last byte as the pad byte, when this was the length byte, and thus an invalid string would be constructed. Now, this case is checked at the beginning.
Thank you for putting this up! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO:
Ideally, this would depend on #50...