Now GetNumString does not use global buffer.
The return value is a wide string.
Fix: Now the max number of cards in a pack is not limited by the size of numStrings.
8509aec134cbd584810808e16727dd0201b23a75
Rebuild class ustring16 from edopro version, which is modified by @edo9300 .
edopro changes:
remove allocator
Before:
template <typename TAlloc = irrAllocator<uchar16_t> >
class ustring16
After:
class ustring16
https://learn.microsoft.com/en-us/cpp/standard-library/allocators?view=msvc-170
If you are targeting C++11 and you need to write a new custom allocator, make it a minimal allocator if possible. Even if you have already implemented an old-style allocator, consider modifying it to be a minimal allocator in order to take advantage of the more efficient construct() method that will be provided for you automatically.
When creating a minimal allocator, do not implement any members except the ones shown in the example below:
a converting copy constructor (see example)
operator==
operator!=
allocate
deallocate
class ustring16 is written before C++11, and it seems that its allocator irrAllocator is out-dated.
I agree that removing the allocator is a better choice.
Before:
wchar_t => converted to core::stringw => converted to core::ustring
a member function of Game
After:
wchar_t or std::wstring => converted to core::ustring
not a member function of Game
c457ae5e146ba38f47cfb271ee584c7dfafa031c
c97b29c4acbca3ef1362d244c25ee7c19ddb26da
fix Game::lpcstring
fix DuelInfo::vic_string
Now they are std::wstring.
Keeping a pointer to local variable is dangerous and unnecessary.
Base: #2602
aa1e281674e07b6e54d05f027167b5bb3724c3c5
Now
GetNumString
does not use global buffer. The return value is a wide string. Fix: Now the max number of cards in a pack is not limited by the size ofnumStrings
.8509aec134cbd584810808e16727dd0201b23a75 Rebuild class ustring16 from edopro version, which is modified by @edo9300 .
edopro changes:
remove allocator
Before:
After:
https://learn.microsoft.com/en-us/cpp/standard-library/allocators?view=msvc-170 If you are targeting C++11 and you need to write a new custom allocator, make it a minimal allocator if possible. Even if you have already implemented an old-style allocator, consider modifying it to be a minimal allocator in order to take advantage of the more efficient construct() method that will be provided for you automatically.
When creating a minimal allocator, do not implement any members except the ones shown in the example below:
class ustring16
is written before C++11, and it seems that its allocatorirrAllocator
is out-dated. I agree that removing the allocator is a better choice.remove
class _ustring16_iterator_access
Before:
After:
class _ustring16_const_iterator
does not usestd::iterator
Before:
After:
https://en.cppreference.com/w/cpp/iterator/iterator
(deprecated in C++17)
https://en.cppreference.com/w/cpp/iterator/iterator_traits iterator_category value_type difference_type pointer reference
This template is just a helper, and we can explicitly define these traits.
remove
class _ustring16_iterator
Now it only has
const_iterator
.ygopro changes
Remove
if constexpr
It is a C++17 feature. I am not sure if we are ready for C++17.
Add constructor for
irr::core::wstring
core::stringw in current version does not have
data()
.8a8dc31b695a7671e68618a7d5b866580aef89a2 bcdaa5d73f25ed51651ccf3912415946a6eb9093 class CGUITTFont add
drawUstring
Before: Convert the string from core::stringw to core::ustring
After: Use core::ustring directly.
343537ae85425a02e5642bef147885de6f339be5 update DrawShadowText
Before: wchar_t => converted to
core::stringw
=> converted tocore::ustring
a member function ofGame
After: wchar_t or
std::wstring
=> converted tocore::ustring
not a member function ofGame
c457ae5e146ba38f47cfb271ee584c7dfafa031c c97b29c4acbca3ef1362d244c25ee7c19ddb26da fix Game::lpcstring fix DuelInfo::vic_string Now they are
std::wstring
. Keeping a pointer to local variable is dangerous and unnecessary.@mercury233 @purerosefallen @Wind2009-Louse @edo9300