Mercurial > octave-nkf
diff src/oct-stream.h @ 6757:c3cd7d14fc5e
[project @ 2007-06-25 19:06:42 by jwe]
author | jwe |
---|---|
date | Mon, 25 Jun 2007 19:13:06 +0000 |
parents | 85eb75190e01 |
children | 93c65f2a5668 |
line wrap: on
line diff
--- a/src/oct-stream.h Mon Jun 25 18:40:21 2007 +0000 +++ b/src/oct-stream.h Mon Jun 25 19:13:06 2007 +0000 @@ -32,6 +32,7 @@ #include <iostream> #include <sstream> #include <string> +#include <map> #include "Array.h" #include "data-conv.h" @@ -583,9 +584,15 @@ static std::string mode_as_string (int mode); - std::istream *input_stream (void) { return rep ? rep->input_stream () : 0; } + std::istream *input_stream (void) + { + return rep ? rep->input_stream () : 0; + } - std::ostream *output_stream (void) { return rep ? rep->output_stream () : 0; } + std::ostream *output_stream (void) + { + return rep ? rep->output_stream () : 0; + } void clearerr (void) { if (rep) rep->clearerr (); } @@ -622,7 +629,7 @@ { protected: - octave_stream_list (void) : list (32), curr_len (0) { } + octave_stream_list (void) : list () { } public: @@ -630,7 +637,7 @@ static bool instance_ok (void); - static int insert (const octave_stream& os); + static int insert (octave_stream& os); static octave_stream lookup (int fid, const std::string& who = std::string ()); @@ -655,13 +662,13 @@ private: - Array<octave_stream> list; + typedef std::map<int, octave_stream> ostrl_map; - int curr_len; + ostrl_map list; static octave_stream_list *instance; - int do_insert (const octave_stream& os); + int do_insert (octave_stream& os); octave_stream do_lookup (int fid, const std::string& who = std::string ()) const; octave_stream do_lookup (const octave_value& fid,