Mercurial > hg > octave-lyh
diff src/oct-stream.h @ 10313:f3b65e1ae355
untabify src header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:16:43 -0500 |
parents | a44d15813a39 |
children | 594adb99a25e |
line wrap: on
line diff
--- a/src/oct-stream.h +++ b/src/oct-stream.h @@ -52,8 +52,8 @@ }; scanf_format_elt (const char *txt = 0, int w = 0, bool d = false, - char typ = '\0', char mod = '\0', - const std::string& ch_class = std::string ()) + char typ = '\0', char mod = '\0', + const std::string& ch_class = std::string ()) : text (strsave (txt)), width (w), discard (d), type (typ), modifier (mod), char_class (ch_class) { } @@ -64,14 +64,14 @@ scanf_format_elt& operator = (const scanf_format_elt& e) { if (this != &e) - { - text = strsave (e.text); - width = e.width; - discard = e.discard; - type = e.type; - modifier = e.modifier; - char_class = e.char_class; - } + { + text = strsave (e.text); + width = e.width; + discard = e.discard; + type = e.type; + modifier = e.modifier; + char_class = e.char_class; + } return *this; } @@ -131,12 +131,12 @@ curr_idx++; if (curr_idx >= list.length ()) - { - if (cycle) - curr_idx = 0; - else - return 0; - } + { + if (cycle) + curr_idx = 0; + else + return 0; + } return current (); } @@ -166,8 +166,8 @@ std::ostringstream *buf; void add_elt_to_list (int width, bool discard, char type, char modifier, - octave_idx_type& num_elts, - const std::string& char_class = std::string ()); + octave_idx_type& num_elts, + const std::string& char_class = std::string ()); void process_conversion (const std::string& s, size_t& i, size_t n, int& width, bool& discard, char& type, @@ -189,8 +189,8 @@ public: printf_format_elt (const char *txt = 0, int n = 0, int w = 0, - int p = 0, const std::string& f = std::string (), - char typ = '\0', char mod = '\0') + int p = 0, const std::string& f = std::string (), + char typ = '\0', char mod = '\0') : text (strsave (txt)), args (n), fw (w), prec (p), flags (f), type (typ), modifier (mod) { } @@ -201,15 +201,15 @@ printf_format_elt& operator = (const printf_format_elt& e) { if (this != &e) - { - text = strsave (e.text); - args = e.args; - fw = e.fw; - prec = e.prec; - flags = e.flags; - type = e.type; - modifier = e.modifier; - } + { + text = strsave (e.text); + args = e.args; + fw = e.fw; + prec = e.prec; + flags = e.flags; + type = e.type; + modifier = e.modifier; + } return *this; } @@ -265,12 +265,12 @@ curr_idx++; if (curr_idx >= list.length ()) - { - if (cycle) - curr_idx = 0; - else - return 0; - } + { + if (cycle) + curr_idx = 0; + else + return 0; + } return current (); } @@ -299,17 +299,17 @@ std::ostringstream *buf; void add_elt_to_list (int args, const std::string& flags, int fw, - int prec, char type, char modifier, - octave_idx_type& num_elts); + int prec, char type, char modifier, + octave_idx_type& num_elts); void process_conversion (const std::string& s, size_t& i, size_t n, - int& args, std::string& flags, int& fw, - int& prec, char& modifier, char& type, - octave_idx_type& num_elts); + int& args, std::string& flags, int& fw, + int& prec, char& modifier, char& type, + octave_idx_type& num_elts); void finish_conversion (const std::string& s, size_t& i, int args, - const std::string& flags, int fw, int prec, - char modifier, char& type, + const std::string& flags, int fw, int prec, + char modifier, char& type, octave_idx_type& num_elts); // No copying! @@ -330,8 +330,8 @@ public: octave_base_stream (std::ios::openmode arg_md = std::ios::in|std::ios::out, - oct_mach_info::float_format ff - = oct_mach_info::native_float_format ()) + oct_mach_info::float_format ff + = oct_mach_info::native_float_format ()) : count (0), md (arg_md), flt_fmt (ff), fail (false), open_state (true) { } @@ -377,10 +377,10 @@ void close (void) { if (is_open ()) - { - open_state = false; - do_close (); - } + { + open_state = false; + do_close (); + } } int file_number (void); @@ -435,24 +435,24 @@ // are those that define is). std::string do_gets (octave_idx_type max_len, bool& err, bool strip_newline, - const std::string& who /* = "gets" */); + const std::string& who /* = "gets" */); std::string getl (octave_idx_type max_len, bool& err, const std::string& who /* = "getl" */); std::string gets (octave_idx_type max_len, bool& err, const std::string& who /* = "gets" */); long skipl (long count, bool& err, const std::string& who /* = "skipl" */); octave_value do_scanf (scanf_format_list& fmt_list, octave_idx_type nr, octave_idx_type nc, - bool one_elt_size_spec, octave_idx_type& count, - const std::string& who /* = "scanf" */); + bool one_elt_size_spec, octave_idx_type& count, + const std::string& who /* = "scanf" */); octave_value scanf (const std::string& fmt, const Array<double>& size, - octave_idx_type& count, const std::string& who /* = "scanf" */); + octave_idx_type& count, const std::string& who /* = "scanf" */); bool do_oscanf (const scanf_format_elt *elt, octave_value&, - const std::string& who /* = "scanf" */); + const std::string& who /* = "scanf" */); octave_value_list oscanf (const std::string& fmt, - const std::string& who /* = "scanf" */); + const std::string& who /* = "scanf" */); // Functions that are defined for all output streams (output streams // are those that define os). @@ -460,10 +460,10 @@ int flush (void); int do_printf (printf_format_list& fmt_list, const octave_value_list& args, - const std::string& who /* = "printf" */); + const std::string& who /* = "printf" */); int printf (const std::string& fmt, const octave_value_list& args, - const std::string& who /* = "printf" */); + const std::string& who /* = "printf" */); int puts (const std::string& s, const std::string& who /* = "puts" */); @@ -497,11 +497,11 @@ std::string getl (octave_idx_type max_len, bool& err, const std::string& who /* = "getl" */); std::string getl (const octave_value& max_len, bool& err, - const std::string& who /* = "getl" */); + const std::string& who /* = "getl" */); std::string gets (octave_idx_type max_len, bool& err, const std::string& who /* = "gets" */); std::string gets (const octave_value& max_len, bool& err, - const std::string& who /* = "gets" */); + const std::string& who /* = "gets" */); long skipl (long count, bool& err, const std::string& who /* = "skipl" */); long skipl (const octave_value& count, bool& err, const std::string& who /* = "skipl" */); @@ -518,37 +518,37 @@ void close (void); octave_value read (const Array<double>& size, octave_idx_type block_size, - oct_data_conv::data_type input_type, - oct_data_conv::data_type output_type, - octave_idx_type skip, oct_mach_info::float_format flt_fmt, - octave_idx_type& count); + oct_data_conv::data_type input_type, + oct_data_conv::data_type output_type, + octave_idx_type skip, oct_mach_info::float_format flt_fmt, + octave_idx_type& count); octave_idx_type write (const octave_value& data, octave_idx_type block_size, - oct_data_conv::data_type output_type, - octave_idx_type skip, oct_mach_info::float_format flt_fmt); + oct_data_conv::data_type output_type, + octave_idx_type skip, oct_mach_info::float_format flt_fmt); template <class T> octave_idx_type write (const Array<T>&, octave_idx_type block_size, - oct_data_conv::data_type output_type, - octave_idx_type skip, oct_mach_info::float_format flt_fmt); + oct_data_conv::data_type output_type, + octave_idx_type skip, oct_mach_info::float_format flt_fmt); octave_value scanf (const std::string& fmt, const Array<double>& size, - octave_idx_type& count, const std::string& who /* = "scanf" */); + octave_idx_type& count, const std::string& who /* = "scanf" */); octave_value scanf (const octave_value& fmt, const Array<double>& size, - octave_idx_type& count, const std::string& who /* = "scanf" */); + octave_idx_type& count, const std::string& who /* = "scanf" */); octave_value_list oscanf (const std::string& fmt, - const std::string& who /* = "scanf" */); + const std::string& who /* = "scanf" */); octave_value_list oscanf (const octave_value& fmt, - const std::string& who /* = "scanf" */); + const std::string& who /* = "scanf" */); int printf (const std::string& fmt, const octave_value_list& args, - const std::string& who /* = "printf" */); + const std::string& who /* = "printf" */); int printf (const octave_value& fmt, const octave_value_list& args, - const std::string& who /* = "printf" */); + const std::string& who /* = "printf" */); int puts (const std::string& s, const std::string& who /* = "puts" */); int puts (const octave_value& s, const std::string& who /* = "puts" */); @@ -568,7 +568,7 @@ void error (const std::string& msg) { if (rep) - rep->error (msg); + rep->error (msg); } void error (const char *msg) { error (std::string (msg)); } @@ -611,12 +611,12 @@ bool retval = true; if (rep) - { - if (clear) - rep->clear (); - } + { + if (clear) + rep->clear (); + } else - retval = false; + retval = false; return retval; } @@ -624,7 +624,7 @@ void invalid_operation (const std::string& who, const char *rw) { if (rep) - rep->invalid_operation (who, rw); + rep->invalid_operation (who, rw); } }; @@ -652,7 +652,7 @@ static int remove (int fid, const std::string& who = std::string ()); static int remove (const octave_value& fid, - const std::string& who = std::string ()); + const std::string& who = std::string ()); static void clear (bool flush = true); @@ -679,7 +679,7 @@ octave_stream do_lookup (int fid, const std::string& who = std::string ()) const; octave_stream do_lookup (const octave_value& fid, - const std::string& who = std::string ()) const; + const std::string& who = std::string ()) const; int do_remove (int fid, const std::string& who = std::string ()); int do_remove (const octave_value& fid, const std::string& who = std::string ());