Skip to content

Create separate include/wx and src/wx directories and files #271

Description

Description:

The ttlib::cview class was created to provide a version of std::stringview that always pointed to a zero-length string, and had most of the additional functions that ttlib::cstr had. Much later, a ttlib::sview class was added which also had most of the additional functions that ttlib::cstr had, but was a true std::stringview class, so no zero-terminated strings. This meant that calling code might never use ttlib::cview. Unfortunately, the header files are now in a situation where they are dependent on the order of inclusion, in large part because of the need for ttlib:cview as a parameter for ttString and ttlib::cstr.

One approach that could be used to solve this problem while also providing an opportunity to refact/review the code would be to create both a include/wx and src/wx and make it possible to create a wxWidgets-only version of the library:

    ttlib.h
        ttstring.h
        ttsview.h
        ttcstr.h

ttsview.h would have functions for working with wxString, but not ttString or ttlib::cstr.
ttcstr.h would have functions for working with wxString, but not ttString or ttlib::sview.

ttlib::cview would be dropped -- all ctors should use std::string, std::string_view, their wide counterparts, and wxString.

Note the rename of ttlibspace.h -- I think that would make sense so that callers don't get the two mixed up. It would also have most of the Windows-only functionality removed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions