diff options
author | Nicolas Catania <niko@google.com> | 2010-02-04 10:10:46 -0800 |
---|---|---|
committer | Nicolas Catania <niko@google.com> | 2010-02-04 10:20:29 -0800 |
commit | 44d38f3d1ae0fd02030e259c4f93a265f91e96fc (patch) | |
tree | b1499d3a6cfaab3d5a14f588c166e8d4140f37f5 /include | |
parent | e5b7af0c3c5af401b46d34987cbd8a65f45454de (diff) | |
download | astl-44d38f3d1ae0fd02030e259c4f93a265f91e96fc.tar.gz |
Added support to output int, void* and std::string.
Diffstat (limited to 'include')
-rw-r--r-- | include/ostream | 12 | ||||
-rw-r--r-- | include/string | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/include/ostream b/include/ostream index 35ff8dc..f7f2734 100644 --- a/include/ostream +++ b/include/ostream @@ -62,6 +62,7 @@ class ostream: public basic_ios // Synchronize the stream buffer. ostream& flush(); + // Formatted output. /** * Interface for manipulators (e.g std::endl, std::hex in * expression like "std::cout << std::endl"). See iomanip header. @@ -73,11 +74,16 @@ class ostream: public basic_ios } ostream& operator<<(const char_type *str); + ostream& operator<<(int val); + ostream& operator<<(unsigned int val); + ostream& operator<<(const void *p); - /** - * Tries to insert a char. - */ + // This is non standard, used by string. + ostream& write_formatted(const char_type *str, streamsize num); + + // Unformatted output. ostream& put(char_type c); + ostream& write(const char_type *str, streamsize num); }; /** diff --git a/include/string b/include/string index 7c2f474..0f6de29 100644 --- a/include/string +++ b/include/string @@ -36,6 +36,8 @@ namespace std { +class ostream; + // Simple string implementation. Its purpose is to be able to compile code that // uses the STL and requires std::string. // @@ -278,6 +280,9 @@ class string size_type mLength; // len of the string excl. null-terminator. }; +// I/O +ostream& operator<<(ostream& os, const string& str); + } // namespace std #endif // ANDROID_ASTL_STRING__ |