Skip to content

Conversation

@Mauller
Copy link

@Mauller Mauller commented Aug 2, 2025

This is a small PR that simply adds functions to the string classes to return their size in bytes.

@Mauller Mauller self-assigned this Aug 2, 2025
@Mauller Mauller added the Enhancement Is new feature or request label Aug 2, 2025
@Mauller Mauller force-pushed the feat-return-strings-bytecount branch from c5e799d to 9a5de01 Compare August 2, 2025 13:26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about write this like

Return the number of bytes until the first zero character or end of string.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about write this like

Return the number of characters until the first zero character or end of string.

Unlike std::string::size, this strlen will stop at the first 0 character. It is a subtle difference.

@Mauller Mauller force-pushed the feat-return-strings-bytecount branch from 9a5de01 to b8dbd3c Compare August 3, 2025 09:00
@Mauller
Copy link
Author

Mauller commented Aug 3, 2025

Tweaked it now, comments should be a bit better based on feedback.

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still do not like the function comments but it is ok.

@xezon xezon added the Refactor Edits the code with insignificant behavior changes, is never user facing label Aug 3, 2025
@xezon xezon changed the title tweak(string): add a function to string classes to return the size of a contained string in bytes tweak(string): Implement functions in AsciiString, UnicodeString to return the byte count of the contained string Aug 3, 2025
@xezon xezon merged commit 45a02a4 into TheSuperHackers:main Aug 3, 2025
15 checks passed
@xezon xezon deleted the feat-return-strings-bytecount branch August 3, 2025 15:42
@xezon xezon removed the Refactor Edits the code with insignificant behavior changes, is never user facing label Aug 3, 2025
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants