summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-01-11zlib -> libdeflate (#5085)Tiger Wang1-11/+17
+ Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite
2020-07-23Update submodulesTiger Wang1-12/+12
2020-07-06Update fmtlib to 7.0.0Peter Bell1-2/+2
2020-05-15Enable some more clang-tidy linter checks (#4738)peterbell101-11/+3
* Avoid inefficient AString -> c_str() -> AString round trip * Avoid redundant string init expressions * Avoid unnecessary return, continue, etc. * Add .clang-format to help with clang-tidy fix-its * Avoid unnecessary passing by value * Avoid unnecessary local copying * Avoid copying in range-for loops * Avoid over-complicated boolean expressions * Some violations missed by my local clang-tidy * Allow unnecessary continue statements * Add brackets * Another expression missed locally * Move BindingsProcessor call into clang-tidy.sh and add space * Fix pushd not found error * Different grouping of CheckBlockInteractionRate
2020-05-05Update fmt to 6.2.0 (#4718)peterbell101-10/+33
* Update fmt to 6.2.0
2019-09-13GCC: Added pragma to ignore fallthrough warnings within Unicode Inc. code (#4392)E141-0/+7
2019-06-11Ignore whitespace only lines in brewing and furnace recipes (#4332)peterbell101-0/+8
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell101-1/+9
Add check for number of empty lines between functions and fix the corresponding failures
2018-05-02Prefer static_cast to reinterpret_cast (#4223)peterbell101-1/+1
* Change reinterpret_cast -> static_cast wherever possible * Remove more unnecessary `const_cast`s. reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-04-11Smelting Gives Experience (#4094)Alex Sweet1-0/+12
* Smelting Exp Smelting now gives experience * Furnace.txt update Exp rewards are entered in furnace.txt, Reward calculation is now done is the furnaceentity class * furnace.txt update Changed alignment tabs to spaces Included documentation of exp in recipe * Updated StringToFloat changed strtod to strtof * Explicit Float to Int * Reworked Smelting Rewards * No C casts -Adds new function to the api -Sets reward counter to 0 in furnace constructor * Style and exp lock removed -Fixed style mistakes accoring to PR notes -XP isn't locked to a single player anymore * No Smelter API -Removed SetLastSmelter and GetLastSmelter -Fixed comments -Fixed log reward amounts
2018-01-03Add the fmt library (#4065)peterbell101-123/+30
* Replaces AppendVPrintf with fmt::sprintf * fmt::ArgList now used as a type safe alternative to varargs. * Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu. * Adds FLOG functions to log with fmt's native formatting style.
2017-08-18Represent cItem::m_Lore as an AStringVector (#3882)peterbell101-0/+36
* Replace cItem::m_Lore with AStringVector * Reword deprecation warning * Fix lua bindings
2017-07-21Remove stricmp macro in favour of NoCaseComparepeterbell101-3/+1
2017-04-01fix endless loop in StringReplace (#3658)Marvin Kopf1-1/+7
* Fixed a recursive loop where the replacement would again be searched for the needle. * Skip if the needle is empty. Find(needle) always matches if needle is empty.
2017-02-13StringUtils: Dropped an unneeded copy in lower-/upper-casing. (#3512)Mattes D1-4/+6
2016-12-25Refactored to put URL Encoding / Decoding in a single place. (#3491)Mattes D1-57/+163
2016-12-12Use CMake's Android generators to crosscompileTiger Wang1-4/+0
2016-08-24Fixed type-casting-related warnings.Mattes D1-2/+2
2016-02-16Fix unicode handling in StringUtils::TrimStringLogicParrot1-2/+2
2015-12-19Added HTTPS links wherever they are supported.Alexander Harkness1-13/+9
2015-10-02Improved types of utf 16 stringstycho1-9/+9
2015-07-31Unified the doxy-comment format.Mattes D1-1/+1
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-23/+23
2015-05-10StringUtils: Fixed StringSplitWithQuotes().Mattes D1-0/+7
The function would crash when given a string that started with the delimiter.
2015-03-12Performance improvements for #1807flx51-3/+3
2015-03-11Fixed coding conventions for Pull Request #1807flx51-1/+6
2015-03-11Fixed issue with quotes not appearing in pairsflx51-4/+5
2015-03-11Fixed some markup issuesflx51-3/+4
2015-03-11Fixed some markup issuesflx51-3/+5
2015-03-11Fixes #493 and #490flx51-0/+39
2015-01-27StringUtils: Fixed bad predicate in MergeStringVectors().Mattes D1-1/+1
Instead of preventing duplicates it was allowing only duplicates.
2015-01-27StringUtils: Added string vector manipulation.Mattes D1-0/+44
2015-01-21Fixed warnings in StringUtils.Mattes D1-29/+28
2014-12-05BasicStyle: Added missing braces to control statements.Mattes D1-2/+8
2014-12-05Fixed reported parentheses around comparisons.Mattes D1-15/+18
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-2/+2
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-2/+2
2014-09-27Bug fixTiger Wang1-10/+10
2014-09-17Initial BungeeCord support.madmaxoft1-0/+28
Ref.: #1392
2014-08-04Refactored case-conversion functions.madmaxoft1-8/+17
StrToLower() returns a modified copy of the string, InPlaceLowercase() modifies the string in-place.
2014-08-04Rewritten string case manipulation to use std::transform.madmaxoft1-22/+4
2014-08-03Attempting a compilation fix for gcc / clang.madmaxoft1-0/+15
2014-07-19Code style: Fixed braces on separate lines.madmaxoft1-3/+5
2014-07-19Fixed style: spaces after commas.madmaxoft1-4/+4
2014-07-17Normalized comments.madmaxoft1-4/+4
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-17Fixed basic whitespace problems.madmaxoft1-36/+35
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-05-09Fixed MSVC 64-bit build warnings.Mattes D1-10/+14
2014-05-08Fixed MSVC 64-bit build warnings.Mattes D1-10/+14
2014-04-04Fixed CreateHexDump's format string.madmaxoft1-2/+2
2014-04-04Fixed CreateHexDump's signedness.madmaxoft1-9/+9
2014-04-04More Clang warning fixes in the protocols.madmaxoft1-1/+1
2014-03-14Fixed a few unneeded breaksTycho1-1/+0
2014-03-10Fixed xofts issuesTycho1-1/+1
2014-03-10Fixed Alignment issue in ByteBufferTycho1-5/+2
2014-01-26Fixed Byte-order reading.madmaxoft1-2/+4
The functions would fail on bytes that were above 127.
2014-01-16Yet another attempt at VarArgs.madmaxoft1-10/+15
2014-01-16Another VarArgs fix.madmaxoft1-18/+26
This time using va_copy() on platforms that have it and simple assignment on platforms that don't.
2014-01-15Using a 2nd argument instead of va_copy().madmaxoft1-13/+15
This seems to be the only reasonable C++03-only solution.
2014-01-15Fixed varargs modification.madmaxoft1-1/+5
Ref.: #541.
2014-01-08Fixed AppendVPrintf() handling for large strings.madmaxoft1-6/+4
This caused a failure in server favicons.
2014-01-07Fixed faviconsTiger Wang1-3/+4
2014-01-07More MSVC warning fixes.madmaxoft1-1/+1
2014-01-07Added Base64Encode().madmaxoft1-0/+48
2014-01-02Fixed unaligned memory access in FastNBT.madmaxoft1-0/+30
This should fix #420.
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-22Added cFile:GetFolderContents().madmaxoft1-49/+0
Fix 162.
2013-10-05Fixed Base64Decode() returning wrong value.madmaxoft1-1/+1
2013-10-04Added Basic auth support to cHTTPRequest.madmaxoft1-0/+68
2013-10-04Added StrToLower(), URLDecode() and ReplaceAllCharOccurrences().madmaxoft1-0/+17
2013-09-28Added URLDecode() and ReplaceAllCharOccurrences() to StringUtils.madmaxoft1-0/+70
2013-08-24Added Unicode, Inc.'s notice.madmaxoft1-5/+38
Fixes #123.
2013-07-07Added StringUtils functions to Lua API; added StripColorCodes(); ChatLog now strips color codes from logged messages.madmaxoft@gmail.com1-2/+21
Fixes FS #398 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1661 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-07Fixed sprinting in 1.6.1, made speeds available through API; fixed messages containing quotes.madmaxoft@gmail.com1-0/+37
Fixes FS #415 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1660 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-29Advanced RCON: Command output is sent to the RCON client.madmaxoft@gmail.com1-23/+0
RCON authentication is now required before executing commands. Console command handlers now return two values, bool (IsHandled) and string (CommandOutput). API change: removed cRoot:ExecuteConsoleCommand(), added cRoot:QueueExecuteConsoleCommand(). API change: removed cPluginManager:ExecuteConsoleCommand(), use cRoot:QueueExecuteConsoleCommand() instead git-svn-id: http://mc-server.googlecode.com/svn/trunk@1631 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04ToLuaDoxy: initial importmadmaxoft@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1544 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-02StringUtils: Fixed the HexDump in DEBUG modemadmaxoft@gmail.com1-4/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1538 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-01StringUtils: Fixed StringSplit to work with multiple delimitersmadmaxoft@gmail.com1-2/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1438 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-04Fixed CreateHexDump() filling the string with garbagemadmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1357 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-14Added water and lava springs.madmaxoft@gmail.com1-0/+24
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1269 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-04Moved client socket accepting into a separate thread object, cListenThreadmadmaxoft@gmail.com1-0/+23
MCServer can now listen on multiple ports FS #312 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1252 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-15Added a Printf() function that returns a new AString by value.madmaxoft@gmail.com1-1/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1041 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-02Added a CreateHexDump() function for easier raw data debuggingmadmaxoft@gmail.com1-1/+57
git-svn-id: http://mc-server.googlecode.com/svn/trunk@818 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-28Moved all packet-serializing code into cProtocol125; half the packet classes aren't needed anymore.madmaxoft@gmail.com1-0/+159
git-svn-id: http://mc-server.googlecode.com/svn/trunk@800 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Added a RateCompareString function to StringUtilsfaketruth1-0/+27
Created a preprocessor template (define) for DoWith* functions Exported cWorld::FindAndDoWithPlayer(), cRoot::FindAndDoWithPlayer() and cRoot::ForEachPlayer() to Lua Added a function FindAndDoWithPlayer to cRoot and cWorld. It takes a part of a player name and finds a single player based on that. Fixed Core's MOTD to contain the correct URL to the MCServer site Fixed Core /kick command Fixed Core's WebAdmin kick git-svn-id: http://mc-server.googlecode.com/svn/trunk@779 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-17Packets now parse themselves from a cByteBuffer object (1st part of packeting rewrite, http://forum.mc-server.org/showthread.php?tid=524 )madmaxoft@gmail.com1-0/+46
git-svn-id: http://mc-server.googlecode.com/svn/trunk@744 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-15Compiles on Android! Added Eclipse project, import it into your workspace and it should be runnable on Android!faketruth1-0/+3
Disabled Squirrel for Android cLog now logs to Android LogCat as well Fixed Lua so it compiles on Android Removed/commented out exceptions in JsonCpp so it compiles on Android git-svn-id: http://mc-server.googlecode.com/svn/trunk@741 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-232/+232
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-04Added the new recipe parser, parsing the crafting.txt file. Included are a few recipes. The old parser still works, but will be replaced soon.madmaxoft@gmail.com1-4/+35
git-svn-id: http://mc-server.googlecode.com/svn/trunk@549 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-14/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-04StringUtils' GetDirectoryContents() now accepts empty string and interprets it as "current directory" (*nix fix)madmaxoft@gmail.com1-1/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@450 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-25A globally-accessible OS-independent GetDirectoryContents() function for listing all objects in a folder as an AStringListmadmaxoft@gmail.com1-0/+44
git-svn-id: http://mc-server.googlecode.com/svn/trunk@433 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients;madmaxoft@gmail.com1-0/+13
Global player-kicking function (cServer, cRoot); More char * -> AString conversion git-svn-id: http://mc-server.googlecode.com/svn/trunk@221 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01StringUtils: SplitString() fixmadmaxoft@gmail.com1-2/+21
git-svn-id: http://mc-server.googlecode.com/svn/trunk@212 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Introducing StringUtils - the place to be if you are a generic string routine :) No more sprintf()!madmaxoft@gmail.com1-0/+129
git-svn-id: http://mc-server.googlecode.com/svn/trunk@209 0a769ca7-a7f5-676a-18bf-c427514a06d6