aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2010-02-11Added string::append method that takes iterators as args.Nicolas Catania
Provided 2 specialization when the iterators comes from another string (e.g begin(), end(), some search results...) There is a test showing how iterators on a list of char can be used to insert the list's content to a string.
2010-02-11Merge "Added at() method to vector. We use a dummy static field as the ↵Niko Catania
returned reference when the index is out of bound."
2010-02-10Added erase to list.Nicolas Catania
2010-02-09Added insert(iterator, char); method.Nicolas Catania
2010-02-08Added <,>,<= and >= operators functions for strings.Nicolas Catania
2010-02-08Added the methods to find a char in a string:Nicolas Catania
find_first_of, find_first_not_of find_last_of, find_last_not_of. Added rfind and find for char (equivalent to find_last_of and find_first_of when a char is used instead of a set of char (string)).
2010-02-07Added string::substr support.Nicolas Catania
Fixed a bug in the copy constructor. If pos is valid but the number of char greater than the on available, we need to cap it to the max number of chars available.
2010-02-07Added at() method to vector.Nicolas Catania
We use a dummy static field as the returned reference when the index is out of bound.
2010-02-05First cut of the sstream implementation.Nicolas Catania
Added the sstream header file the stringbuf and stringstream classes. Added missing openmode flags in ios_base.h
2010-02-05Basic implementation of the std::list.Nicolas Catania
Moved the class used in vector test to common.h to track memory leaks.
2010-02-04Merge "Added basic support for the streams flags and iomanip."Niko Catania
2010-02-04iostream support for unsigned ints,float,double,boolNicolas Catania
In <limits> added support for unsigned long and unsigned long long.
2010-02-04Added basic support for the streams flags and iomanip.Nicolas Catania
2010-02-04Added support to output int, void* and std::string.Nicolas Catania
2010-02-03Added support for endl ends and flush.Nicolas Catania
2010-02-03Added basic_ios abstraction and finished cout/cerr implementation.Nicolas Catania
basic_ios was missing. we should have: ostream -> basic_ios -> ios_base basic_ios's role is very minor for us, it just holds the streambuf where the writes happen. In a real STL it does a bit more, it deals with the numerous flags that can be set on a stream. The ostream implementation is now complete since it can get the streambuf from its base class to perform the 2 ops supported: - flush() - operator<<(char*) The final piece was a concrete implementation of a streambuf to output the strings to stdout or stderr. This is done in a new class stdio_filebuf which wraps a regular stdio.h stream. For cerr we use stderr to build the stdio_filebuf instance that cerr will wrap. Same for cout and stdout.
2010-02-02Merge "In ostream, added code to do the one time init of the stdio streams."Niko Catania
2010-02-02Implementation of vector::erase.Nicolas Catania
Added std::copy, needed to shift the element down during an erase call. Squashed commit of the following: commit e534509bd709350e585f722e525eb2b63ade5831 Author: Nicolas Catania <niko@google.com> Date: Mon Feb 1 10:38:21 2010 -0800 implementation of std::copy commit f94dad514c54c66da85d9492452610285b5ee446 Author: Nicolas Catania <niko@google.com> Date: Sun Jan 31 14:58:15 2010 -0800 Added support for erase. Erase element and erase range of elements.
2010-02-01In ostream, added code to do the one time init of the stdio streams.Nicolas Catania
The new inner class Init will be in charge of constructing the streams cout and cerr.
2010-01-30Added the 'at' method to string.Nicolas Catania
2010-01-29Added resize call to vector.Nicolas Catania
Fixed a bug in the memory uninitialized_fill to work with iterators.
2010-01-29Changed char_traits to be a template.Nicolas Catania
Some libraries expect it to be so. Left the base definition empty to generate an error when something other than char is used.
2010-01-28Basic streambuf implementation.Nicolas Catania
Needed to finish the ostream. We are not expected to use this class a lot since we are going to rely on the stdio implementation for all the work. Still needed to make the compiler happy but did not spent too much effort on it. For instance only output buffer operations are supported.
2010-01-28Merge "Added iterator based vector constructor."Niko Catania
2010-01-27Add char_traits support (needed for sstream).Nicolas Catania
2010-01-26Added iterator based vector constructor.Nicolas Catania
The new range based constructors degrades to one reserve and one memmove call for pod types referenced using random access iterators. There is an extra step to disambiguate between range and repeat initializers. Basically for some type combination, the range form can be called when the repeat form was the one targetted. We check if the type is an integer to find out which one was called.
2010-01-26Use iterators in unitialized_copy.Nicolas Catania
Previously, unitialized_copy assumed the args were pointers. Replace the const * with iterators. Fixed a bug, uninitialized_copy must return an iterator pass the last element inserted in dest. Previously we were returning the start of dest. Fixed a bug, we can use memmove only when the types pointed are POD but also when both source AND dest iterators are random access ones (i.e both source and dest use a contiguous array to store the values) The prev code would call memmove if the input was a vector<int> and output a linked list<int> which is wrong since the list element are stored in nodes, non contiguous area. Added a specialization when the 2 types are pod but the iterator are not random access ones (think linked list of ints). I was not sure if placement new degrades to assignement in that case so I provided a specialization that explicitly uses '='. In limits, added support for int and unsigned int. replaced C style casts with static_cast.
2010-01-25Added std::distance.Nicolas Catania
2010-01-24Basic support of the ios_base, the root of all streams.Nicolas Catania
Added skeleton for ostream and the iosfwd header files. iomanip is referenced in the comment but not included in this CL.
2010-01-22New fpos class for the stream position.Nicolas Catania
2010-01-22Basic implementation of set.Nicolas Catania
This impl uses vector (non-sorted) to provide a basic level of functionality to build gtest (blocker). The poor performance is not a concern for now, an RB tree replacement is being worked on.
2010-01-21Use copy constructor to push new non-pod element in the vector.Nicolas Catania
In the push_back method: Previously we used the assignment operator for both pod and non pod types. This was broken for non pod since the memory at the end of the vector where we tried to assign to was not initialized (lhs cw not a valid instance). Instead we use placement new to copy the element to the new location. In the reserve method: Fix line length. Do not try to copy from the old memory area to the new one if the area is non existent (mBegin is NULL).
2010-01-20Added iterator support to the vector class.Nicolas Catania
In iterator, implemented the iterator diff operator. Minor renaming of some parameters in the iterator functions. More tests to exercise the iterator arithmetic.
2010-01-13Basic implementation of iterators.Nicolas Catania
Added basic iterator support for strings.
2010-01-12Partial implementation of the std::limits header file.Nicolas Catania
Only float and double support (partial implementation).
2009-07-07Added binary comparators needed for the set implementation.niko
Cosmetic in type_traits.h: renamed _Tp to _T for consistency.
2009-06-15Basic implementation of vector.Nicolas Catania
Uses malloc/realloc for pod type. For classes uses placement new to insert new copies of the data. In the test package, renamed macros.h to common.h New memory file with uninitialized_copy and uninitialized_fill. Disabled the host target since it is used only on linux to run the valgrind tool and that I don't want to spend time making it compile on mac, cygwin ....
2009-06-15Merge change 4060 into donutAndroid (Google) Code Review
* changes: Trivial: renamed the parameters to be inline with the standard.
2009-06-12Revert "Basic implementation of vector."Nicolas Catania
This reverts commit fd56a38d5dcb569b146634bb22c5d9cb1e138e3f.
2009-06-12Trivial: renamed the parameters to be inline with the standard.Nicolas Catania
idx -> pos num -> n len -> n
2009-06-10Basic implementation of vector.Nicolas Catania
Uses malloc/realloc for pod type. For classes uses placement new to insert new copies of the data. In the test package, renamed macros.h to common.h New memory file with uninitialized_copy and uninitialized_fill.
2009-05-26Implementation of string::eraseNicolas Catania
2009-05-22Merge change 1846 into donutAndroid (Google) Code Review
* changes: Use realloc to implement the reserve call.
2009-05-18Use realloc to implement the reserve call.Nicolas Catania
Minor cleanup of the type used to identify size type and the basic char type used: - size_t is now string::size_type - char is now string::value_type
2009-05-17Added equal method to compare ranges of objects.Nicolas Catania
equal is needed for the vector implementation.
2009-05-11Added find method to the string class.Nicolas Catania
Implemented find method including tests. Cleaned up the Android.mk file to remove the host target per discussion with dbort. The simulator target should be used to run host tests under valgrind.
2009-05-05Added a header file + test for the type traitsNicolas Catania
Added fill and fill_n template functions in algorithm + test. Since we don't have iterators yet, I used plain pointers. This change is required to build the vector class.
2009-05-02Added 2 new files: algorithm and string.Niko Catania
Added tests but will submit change to runtest_py separately. Added more description to the README file. Check for unsigned overflows. Added Android.mk in the top dir. Removed the reserve() method and made the size default to 0 in reserve(size_t)