[complement-svn] SF.net SVN: complement: [1773] trunk/complement/explore/inquiry/STLport
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2007-10-24 16:52:50
|
Revision: 1773 http://complement.svn.sourceforge.net/complement/?rev=1773&view=rev Author: complement Date: 2007-10-24 09:52:49 -0700 (Wed, 24 Oct 2007) Log Message: ----------- istreambuf_iterator Added Paths: ----------- trunk/complement/explore/inquiry/STLport/istreambuf_iter/ trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile.inc trunk/complement/explore/inquiry/STLport/istreambuf_iter/test.cc Property changes on: trunk/complement/explore/inquiry/STLport/istreambuf_iter ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile (rev 0) +++ trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile 2007-10-24 16:52:49 UTC (rev 1773) @@ -0,0 +1,14 @@ +# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr> + +SRCROOT := ../../.. +# COMPILER_NAME := gcc + +STLPORT_DIR := /export/home/ptr/STLport.lab/STLport +include Makefile.inc +include ${SRCROOT}/Makefiles/gmake/top.mak + + +INCLUDES += -I$(SRCROOT)/include + +LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) + Added: trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/STLport/istreambuf_iter/Makefile.inc 2007-10-24 16:52:49 UTC (rev 1773) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = test +SRC_CC = test.cc Added: trunk/complement/explore/inquiry/STLport/istreambuf_iter/test.cc =================================================================== --- trunk/complement/explore/inquiry/STLport/istreambuf_iter/test.cc (rev 0) +++ trunk/complement/explore/inquiry/STLport/istreambuf_iter/test.cc 2007-10-24 16:52:49 UTC (rev 1773) @@ -0,0 +1,52 @@ +#include <iostream> +// #include <fstream> +#include <string> +#include <vector> +#include <iterator> +#include <sstream> + +using namespace std; + +int main() +{ + // ifstream f; + stringstream s( "1234567890" ); + stringstream g( "1234567890xx" ); + char buf[] = "12345678901234"; + string line; + vector<char> v; + + // f.open( "test.txt", fstream::in ); + // v.assign( istreambuf_iterator<char>(f), istreambuf_iterator<char>() ); + + v.assign( istreambuf_iterator<char>(s), istreambuf_iterator<char>() ); + cerr << v.size() << endl; + + for ( vector<char>::const_iterator i = v.begin(); i != v.end(); ++i ) { + cerr << *i; + } + + cerr << endl; + + vector<char>::const_iterator j = v.begin() + 5; + + v.assign( istreambuf_iterator<char>(g), istreambuf_iterator<char>() ); + + j += 1; + + cerr << *j << endl; + + v.assign( buf, buf + 14); + + for ( vector<char>::const_iterator i = v.begin(); i != v.end(); ++i ) { + cerr << *i; + } + + cerr << endl; + + j += 1; + + cerr << *j << endl; + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |