Age | Commit message (Collapse) | Author |
|
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.
|
|
returned reference when the index is out of bound."
|
|
|
|
|
|
|
|
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)).
|
|
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.
|
|
We use a dummy static field as the returned reference when
the index is out of bound.
|
|
Added the sstream header file the stringbuf and stringstream classes.
Added missing openmode flags in ios_base.h
|
|
Moved the class used in vector test to common.h to track memory leaks.
|
|
|
|
In <limits> added support for unsigned long and unsigned long long.
|
|
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
The new inner class Init will be in charge of constructing the
streams cout and cerr.
|
|
|
|
Fixed a bug in the memory uninitialized_fill to work with iterators.
|
|
Some libraries expect it to be so.
Left the base definition empty to generate
an error when something other than char is used.
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
Added skeleton for ostream and the iosfwd header files.
iomanip is referenced in the comment but not included in this CL.
|
|
|
|
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.
|
|
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).
|
|
In iterator, implemented the iterator diff operator.
Minor renaming of some parameters in the iterator functions.
More tests to exercise the iterator arithmetic.
|
|
Added basic iterator support for strings.
|
|
Only float and double support (partial implementation).
|
|
Cosmetic in type_traits.h: renamed _Tp to _T for consistency.
|
|
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 ....
|
|
* changes:
Trivial: renamed the parameters to be inline with the standard.
|
|
This reverts commit fd56a38d5dcb569b146634bb22c5d9cb1e138e3f.
|
|
idx -> pos
num -> n
len -> n
|
|
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.
|
|
|
|
* changes:
Use realloc to implement the reserve call.
|
|
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
|
|
equal is needed for the vector implementation.
|
|
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.
|
|
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.
|
|
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)
|