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.
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.httsview.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.