summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-06-17Add quest database support and parsing utilitiesThorbjørn Lindeijer1-0/+26
- Introduce QuestDB with quest/effect structures and XML parsing - Register questdb in CMake and settings manager - Add fromString overload for std::vector<int> parsing
2025-04-29Changed removeColors to work in-placeThorbjørn Lindeijer1-6/+5
Can avoid some memory allocations. Also simplified its implementation a little. Also made ChatLogger::getDateString use the full year.
2025-03-24Expanded GUI theming capabilitiesThorbjørn Lindeijer1-2/+0
* Moved previously hardcoded values for frame size, padding and title bar height to the Skin. * Added support for rendering colored rectangles (used for scroll bar background). * Scroll bar width is now determined by its skin. * Added separate skins for horizontal and vertical scroll bars and horizontal and vertical scroll markers and added a skin for the shortcut box. * Added support for hovered state on window close button.
2025-03-13Removed needless case-insensitive string comparisonsThorbjørn Lindeijer1-23/+0
These are not necessary since we can instead make sure the referenced values match case, like we do for everything else. This affects server types in the server list and colors referenced in theme files. The server version was also compared case-insensitively for some reason.
2025-02-14Fixed handling of update URLs which mention a portThorbjørn Lindeijer1-44/+21
This appears to have been a regression in f405849b49614254f42eb3ee6147434458978623, which for some reason erased the port (and any trailing parts) from not just the update directory but also from the update URL. Unfortunately we can't access Mana-Mantis #381 at the moment, but presumably the port was removed due to the colon being a problematic character. Instead, now the colon (and other special characters) are replaced by _ when determining the update directory. Closes https://git.themanaworld.org/mana/mana/-/issues/80
2025-01-18Introduced small convenience wrapper to write XMLThorbjørn Lindeijer1-5/+4
Might not seem worth it right now, but it will be if we write out more XML structures.
2024-10-18Avoid accessing static members through instancesThorbjørn Lindeijer1-2/+2
Fixed with clang-tidy `readability-static-accessed-through-instance` check.
2024-03-25Avoid string allocations during text rendering and sizingThorbjørn Lindeijer1-10/+0
Now a text chunk has a maximum length of 4k characters, but that should be plenty of space since they're only single lines.
2024-03-25Removed an unnecessary extra allocation in strprintfThorbjørn Lindeijer1-5/+4
We can use vsnprintf to write to the std::string directly.
2024-03-13Use snprintf instead of sprintfThorbjørn Lindeijer1-5/+5
Amendment of dd1db3753ecf8a4d782aee1f518759763d8caf87.
2024-02-22General code cleanupsThorbjørn Lindeijer1-4/+4
* Use default member initializers * Use range-based loops * Don't use 'else' after 'return' * Removed some unused includes * Construct empty strings with std::string() instead of "" * Clear strings with .clear() instead of assigning "" * Check whether strings are empty with .empty() instead of comparing to "" * Removed redundant initializations
2024-02-05Updated C++ standard to C++17Thorbjørn Lindeijer1-4/+16
C++17 should be universal enough by now. This raises the minimum CMake to 3.8, which should also pose no problem since Ubuntu 18.04 already shipped with CMake 3.10. C++17's 'if' initialization statement is now used in an efficient implementation of 'join' for vector<string>, found on StackOverflow.
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer1-1/+1
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-1/+1
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2024-01-24Fixed a few coding errors the compiler complained aboutThorbjørn Lindeijer1-1/+1
2012-03-18Removed some 'const' keywords from value returnsThorbjørn Lindeijer1-4/+4
It makes no sense to mark a return value as const when it is returned by value. This only makes sense if the return value is passed by reference, in order to prevent the receiver from modifying the value. Also made some other small adjustments. A std::string does not need to be initialized to "" explicitly and getSafeUtf8String could take its parameter by reference. Reviewed-by: Yohann Ferreira
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-09Made the client able to remove the port from update urls.Yohann Ferreira1-1/+48
Resolves: Mana-Mantis #381. Reviewed-by: Ablu.
2011-01-13Moved the normalize() function in strungUtils where it belongs.Yohann Ferreira1-0/+6
(Preparation for bringing a smaller item loading refactoring patch.) Trivial.
2010-09-27Centralized String to bool conversion into the client.Yohann Ferreira1-8/+9
The former XML::getBoolProperty() had a potential memleak and was unsafe when dealing with unknown values. Reviewed-by: CodyMartin. Resolves: Mana-Mantis #213.
2010-09-25Merge branch '1.0'Thorbjørn Lindeijer1-0/+35
Conflicts: src/actorspritemanager.h src/beingmanager.cpp src/game.cpp src/gui/beingpopup.cpp src/gui/chat.cpp src/gui/chat.h src/gui/inventorywindow.h src/gui/itempopup.cpp src/gui/socialwindow.cpp src/gui/statuswindow.cpp src/gui/widgets/chattab.cpp src/gui/widgets/chattab.h src/net/tmwa/inventoryhandler.cpp src/net/tmwa/partyhandler.cpp src/party.cpp src/sound.cpp src/utils/stringutils.cpp src/utils/stringutils.h
2010-08-29Move handling of autocomplete and input history into TextFieldJared Adams1-1/+36
Reviewed-by: Freeyorp
2010-07-28Centralized configuration default values using the VariableData system.Yohann Ferreira1-2/+14
Please note that I didn't turned all the getValue() call into new ones, simply because I have to have config object initiated which is not forcefully the case the branding file. Resolves: Manasource Mantis #170.
2010-05-27Fix drawing incorrect utf8 strings issue.Andrei Karas1-0/+11
Reviewed-by: Bertram Resolve: Manasource Mantis #143
2010-03-12Split Palette into Theme and UserPaletteJared Adams1-1/+7
Themes can now control the colors they use. Colors in the Viewport (being names, particles, etc) can still be changed by the user. Also make ProgressBars more easily colored. DyePalette was made more flexible in the process. Also fixes comparing strings of different lengths insensitively. Reviewed-by: Thorbjørn Lindeijer
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-01-24Autocomplete names with quotes if the string begins with a / or @ (commands)Blue Sans Douze1-1/+1
2010-01-08Small refactoring in chat auto completingAndrei Karas1-1/+1
2010-01-07Chat auto completingAndrei Karas1-0/+18
2010-01-06Fixes so mapreader ignores the case of object typesChuck Miller1-0/+6
This will decrease warnings in the log file by a good bit
2009-11-03Remove more _SUPPORT ifdefs and do some cleanupJared Adams1-0/+17
2009-10-05Hide color codes from speech textAndrei Karas1-0/+12
2009-05-03Moved strprintf into stringutils.{h,cpp}Bjørn Lindeijer1-0/+24
2009-04-29Changed palette colors to be once again stored in a human readableTametomo1-2/+9
format once again. This was originally reverted because it caused a regression on Windows, but not Linux, which was later found out to be because there's a Linux kernel function which will convert hex strings into an integer format, while Windows doesn't share the same luxury. So, to avoid any issues, this commit adds an atox (ascii to hex) string utility, and uses it when parsing hex strings for colors from the configuration file. Also ensured that people who have colors saved in the old, raw integer format can get their colors converted to hex values. Signed-off-by: Tametomo <irarice@gmail.com> Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
2009-04-13Fixed @'s in a user's nickDavid Athay1-0/+13
2009-03-26Changed includes in utils/ dictory to new guidelinesBjørn Lindeijer1-1/+1
2009-02-18Introduced a toLower method and grouped string utilsBjørn Lindeijer1-0/+63
The string utility methods are now grouped together in the stringutils.h header. Also, a toLower method was added for convenience.