aboutsummaryrefslogtreecommitdiff
path: root/common/str.h
AgeCommit message (Collapse)Author
2018-10-14COMMON: Add mutex to protect access to the String memory poolThierry Crozat
This fixes a crash due to concurrent access to the global MemoryPool used by the String class when String objects are used simultaneously from several threads (as is for example the case when enabling the cloud features). See bug #10524: Thread safety issue with MemoryPool
2018-08-18COMMON: Move new_strdup to common/str.cppCameron Cawley
2018-04-30GUI: Make the tab completion case insensitive in the debug consoleBastien Bouclet
It made little sense for the tab-completion to be case sensitive while command execution itself is case insensitive.
2018-04-15JANITORIAL: Fix whitespaceAdrian Frühwirth
2017-11-10COMMON: Add basic fixed-width word wrap to Common::StringColin Snover
2017-01-05COMMON: Add strnlen for safer C string length readsColin Snover
This API is intended for use in cases where C strings come from untrusted sources like game files, where malformed data missing the null terminator would cause strlen to read out of bounds.
2016-08-24JANITORIAL: Remove spaces at the end of the lineAlexander Tkachev
I knew there were some, but I wanted to fix them once, instead of doing it all the time.
2016-08-24COMMON: Add replace(String, String, String)Alexander Tkachev
Searches for a substring in the string and replaces it with the other string.
2016-08-24COMMON: Add String::asUint64()Alexander Tkachev
Instead of all these atoull() I've added everywhere.
2016-05-16COMMON: Add replace functions to Common and String.Borja Lorente Escobar
COMMON: Add replacement to common/algorithm.h COMMON: Intermediate commit to show doubts. COMMON: Basic String::replace() methods implemented. COMMON: Fix typo in the algorithm.h documentation. COMMON: Fix documentation of String::replace() COMMON: Fix formatting issues in method signatures. COMMON: Add assert and reformat loops in str and algorithm. COMMON: Fix typo in comment. COMMON: Fix style in string test cases. COMMON: Add Doxygen documentation to algorithm and String. COMMON: Add Doxygen documentation to algorithm and String. COMMON: Add Doxygen documentation to algorithm. COMMON: Fix style in algorithm comments. COMMON: Add Doxygen comments to String. COMMON: Add Doxygen comments to algorithm test function. COMMON: Add String support for substring replace. COMMON: Fix string replace to comply with STL COMMON: Fix documentation on string replace COMMON: Fix style in string replace COMMON: Fix unwanted reference problem in String::replace(). COMMON: Fix indentation in comments for replace COMMON: Fix indentation in replace COMMON: Fix comments in String::replace to match implementation. COMMON: Remove assert to allow for not-null-terminated character arrays COMMON: Add new test for String::replace COMMON: Fix broken comments on String::replace COMMON: Fix sharing bug on ensureCapacity COMMON: Remove superfluous call to makeUnique()
2016-01-26COMMON: Allow '#' to only match digits in matchString.Johannes Schickel
2016-01-06IOS: Moves the helper function were it is used.Vincent Bénony
2016-01-06IOS: Adds two helper functions on stringsVincent Bénony
2014-08-29COMMON: Fix some Doxygen comments that seem wrong.Einar Johan Trøan Sømåen
2014-02-18COMMON: Make GPL headers consistent in themselves.Johannes Schickel
2013-11-23COMMON: Document Common::String::unsigned_type.Johannes Schickel
2013-11-23COMMON: Add underlying type names to Common::String.Johannes Schickel
The value_type is analogous to std::basic_string::value_type. The unsigned_type on the other hand is an unsigned type of the value_type which allows to obtain an character without nasty sign extension.
2013-06-20COMMON: Add erase method to String classrichiesams
2011-08-07COMMON: Remove superfluous Common:: qualifiers.Christoph Mallon
2011-06-18COMMON: Add vformat() function (Common::String analog to vsprintf)Max Horn
2011-05-31COMMON: Move scumm_str(n)icmp declaration to str.hMax Horn
2011-05-25ALL: behaviour -> behaviorMatthew Hoops
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2010-12-01ALL: Fix a few typosJordi Vilalta Prat
svn-id: r54716
2010-11-01COMMON: Rename String::printf() to String::format()Max Horn
This is a first step towards getting rid of all uses of regular printf, fprintf, vprintf, vfprintf, puts, fputs, etc. in our codebase. The name format() reflects the purpose of the function, and parallels String.format() in Java, boost::format, and others. svn-id: r54004
2010-10-18Revert "COMMON: Implement Common::vprintf(). Patch by littleboy"Eugene Sandulenko
svn-id: r53586
2010-10-18COMMON: Implement Common::vprintf(). Patch by littleboyEugene Sandulenko
svn-id: r53576
2010-07-05Note Common::String's behaviour may be undefined with \0 characters.Willem Jan Palenstijn
Also make operator=(char) and String(char) behave the same. svn-id: r50712
2010-05-30Typo fixes.Johannes Schickel
svn-id: r49324
2010-05-30Fix non-const version of Common::String::begin.Johannes Schickel
Common::String::begin now assures the storage is a unique one, i.e. there are no other Common::String objects pointing at it. This allows for safe use of the writable iterators (and thus fixes the test case added with my last commit) svn-id: r49323
2010-05-05Add a custom implementation of OpenBSD's strlcat and strlcpy.Johannes Schickel
This includes both an implementation and some basic unit tests for the above mentioned functions. svn-id: r48953
2010-03-18COMMON: Move typedef StringList from str.h to new header str-array.hMax Horn
This removes the dependency on array.h from str.h. Also, begun migration from the confusing type name "StringList" to the more appropriate StringArray. svn-id: r48282
2010-03-18COMMON: Move tag2str from util.h to str.hMax Horn
svn-id: r48281
2010-01-31Slight formatting fixes to comply to our coding guidelines.Johannes Schickel
svn-id: r47744
2009-12-30Get rid of Common::String::emptyString, and also of some port specific ↵Max Horn
hackery (getting rid of certain global C++ objs) svn-id: r46781
2009-09-23COMMON: Add "ignoreCase" parameter to matchString.Johannes Schickel
svn-id: r44265
2009-07-25Add Common::String::printf to format a stringWillem Jan Palenstijn
svn-id: r42743
2009-06-07Added some new method variants to Common::StringMax Horn
svn-id: r41333
2009-05-08Clarified docstring for String::insertCharMax Horn
svn-id: r40382
2009-04-22COMMON: changed class StringList to a simple typedef; enhanced the ↵Max Horn
Common::Array constructor which converts regular arrays to Array objects to be more flexible in its type (allows e.g. to assign an array of char* to a StringList svn-id: r40077
2009-04-01Formatting.Johannes Schickel
svn-id: r39789
2009-02-15Merged internal 'matchPath' method of class Archive into global matchString ↵Max Horn
function (via an optional 'path mode' in the latter). Also changed Archive::listMatchingMembers to use path mode when matching, just like FSDirectory::listMatchingMembers svn-id: r38277
2008-12-22Fixed indentation and removed whitespaces at the end of lineJordi Vilalta Prat
svn-id: r35481
2008-09-27Fixed a nasty bug in SearchManager::addDirectory; made the 'char' ↵Max Horn
constructor of Common::String explicit, to avoid such bugs in the future svn-id: r34660
2008-09-24Changed builtin Common::String capacity to 24 (on 32 bit systems), to make ↵Max Horn
sizeof(String) 32; reduces overall memory req by 200k on my system; overall # of mallocs after this + the refcount memory pool change is almost unchanged svn-id: r34644
2008-09-05Moved matchString from util.* to str.*; added new String::matchString ↵Max Horn
method; fixed matchString doxygen comment (it confused pattern & string); added unit tests for matchString svn-id: r34364
2008-09-02Added two new global funcs which ease proper handling of 'path' strings: ↵Max Horn
Common::lastPathComponent() and Common::normalizePath() svn-id: r34272
2008-08-26And for all of those who love recompiling most of ScummVM... fixed typo ↵Johannes Schickel
properly :-P svn-id: r34188
2008-08-26Fixed typo. (Thanks to salty-horse for spotting it).Johannes Schickel
svn-id: r34187
2008-08-20Unified member names in container/storage classes Array, HashMap and String: ↵Max Horn
_storage, _size, _capacity svn-id: r34052