Mercurial > hg > octave-nkf
diff src/ls-oct-ascii.h @ 10313:f3b65e1ae355
untabify src header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:16:43 -0500 |
parents | cd96d29c5efa |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/src/ls-oct-ascii.h +++ b/src/ls-oct-ascii.h @@ -43,23 +43,23 @@ extern OCTINTERP_API std::string extract_keyword (std::istream& is, const char *keyword, - const bool next_only = false); + const bool next_only = false); extern OCTINTERP_API std::string read_ascii_data (std::istream& is, const std::string& filename, bool& global, - octave_value& tc, octave_idx_type count); + octave_value& tc, octave_idx_type count); extern OCTINTERP_API bool save_ascii_data (std::ostream& os, const octave_value& val_arg, - const std::string& name, bool mark_as_global, int precision); + const std::string& name, bool mark_as_global, int precision); extern OCTINTERP_API bool save_ascii_data_for_plotting (std::ostream& os, const octave_value& t, - const std::string& name); + const std::string& name); extern OCTINTERP_API bool save_three_d (std::ostream& os, const octave_value& t, - bool parametric = false); + bool parametric = false); // Match KEYWORD on stream IS, placing the associated value in VALUE, // returning TRUE if successful and FALSE otherwise. @@ -71,7 +71,7 @@ template <class T> bool extract_keyword (std::istream& is, const char *keyword, T& value, - const bool next_only = false) + const bool next_only = false) { bool status = false; value = T(); @@ -80,37 +80,37 @@ while (is.get (c)) { if (c == '%' || c == '#') - { - std::ostringstream buf; + { + std::ostringstream buf; - while (is.get (c) && (c == ' ' || c == '\t' || c == '%' || c == '#')) - ; // Skip whitespace and comment characters. + while (is.get (c) && (c == ' ' || c == '\t' || c == '%' || c == '#')) + ; // Skip whitespace and comment characters. - if (isalpha (c)) - buf << c; + if (isalpha (c)) + buf << c; - while (is.get (c) && isalpha (c)) - buf << c; + while (is.get (c) && isalpha (c)) + buf << c; - std::string tmp = buf.str (); - bool match = (tmp.compare (0, strlen (keyword), keyword) == 0); + std::string tmp = buf.str (); + bool match = (tmp.compare (0, strlen (keyword), keyword) == 0); - if (match) - { - while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) - ; // Skip whitespace and the colon. + if (match) + { + while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) + ; // Skip whitespace and the colon. - is.putback (c); - if (c != '\n' && c != '\r') - is >> value; - if (is) - status = true; - skip_until_newline (is, false); - break; - } - else if (next_only) - break; - } + is.putback (c); + if (c != '\n' && c != '\r') + is >> value; + if (is) + status = true; + skip_until_newline (is, false); + break; + } + else if (next_only) + break; + } } return status; } @@ -118,7 +118,7 @@ template <class T> bool extract_keyword (std::istream& is, const std::string& kw, T& value, - const bool next_only = false) + const bool next_only = false) { return extract_keyword (is, kw.c_str (), value, next_only); } @@ -134,7 +134,7 @@ template <class T> bool extract_keyword (std::istream& is, const string_vector& keywords, - std::string& kw, T& value, const bool next_only = false) + std::string& kw, T& value, const bool next_only = false) { bool status = false; kw = ""; @@ -144,44 +144,44 @@ while (is.get (c)) { if (c == '%' || c == '#') - { - std::ostringstream buf; + { + std::ostringstream buf; - while (is.get (c) && (c == ' ' || c == '\t' || c == '%' || c == '#')) - ; // Skip whitespace and comment characters. + while (is.get (c) && (c == ' ' || c == '\t' || c == '%' || c == '#')) + ; // Skip whitespace and comment characters. - if (isalpha (c)) - buf << c; + if (isalpha (c)) + buf << c; - while (is.get (c) && isalpha (c)) - buf << c; + while (is.get (c) && isalpha (c)) + buf << c; - std::string tmp = buf.str (); + std::string tmp = buf.str (); - for (int i = 0; i < keywords.length (); i++) - { - int match = (tmp == keywords[i]); + for (int i = 0; i < keywords.length (); i++) + { + int match = (tmp == keywords[i]); - if (match) - { - kw = keywords[i]; + if (match) + { + kw = keywords[i]; - while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) - ; // Skip whitespace and the colon. + while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) + ; // Skip whitespace and the colon. - is.putback (c); - if (c != '\n' && c != '\r') - is >> value; - if (is) - status = true; - skip_until_newline (is, false); - return status; - } - } + is.putback (c); + if (c != '\n' && c != '\r') + is >> value; + if (is) + status = true; + skip_until_newline (is, false); + return status; + } + } - if (next_only) - break; - } + if (next_only) + break; + } } return status; }