23 #if !defined (octave_ls_oct_ascii_h)
24 #define octave_ls_oct_ascii_h 1
36 #define CELL_ELT_TAG "<cell-element>"
41 #define OCT_RBV (std::numeric_limits<double>::max () / 100.0)
46 const bool next_only =
false);
49 read_ascii_data (std::istream& is,
const std::string& filename,
bool& global,
54 const std::string& name,
bool mark_as_global,
int precision);
58 const std::string& name);
62 bool parametric =
false);
74 const bool next_only =
false)
82 if (c ==
'%' || c ==
'#')
84 std::ostringstream buf;
86 while (is.get (c) && (c ==
' ' || c ==
'\t' || c ==
'%' || c ==
'#'))
92 while (is.get (c) && isalpha (c))
95 std::string tmp = buf.str ();
96 bool match = (tmp.compare (0, strlen (keyword), keyword) == 0);
100 while (is.get (c) && (c ==
' ' || c ==
'\t' || c ==
':'))
104 if (c !=
'\n' && c !=
'\r')
121 const bool next_only =
false)
137 std::string& kw, T& value,
const bool next_only =
false)
146 if (c ==
'%' || c ==
'#')
148 std::ostringstream buf;
150 while (is.get (c) && (c ==
' ' || c ==
'\t' || c ==
'%' || c ==
'#'))
156 while (is.get (c) && isalpha (c))
159 std::string tmp = buf.str ();
161 for (
int i = 0; i < keywords.
length (); i++)
163 int match = (tmp == keywords[i]);
169 while (is.get (c) && (c ==
' ' || c ==
'\t' || c ==
':'))
173 if (c !=
'\n' && c !=
'\r')
void skip_until_newline(std::istream &is, bool keep_newline)
OCTINTERP_API std::string read_ascii_data(std::istream &is, const std::string &filename, bool &global, octave_value &tc, octave_idx_type count)
OCTINTERP_API std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only=false)
octave_idx_type length(void) const
Number of elements in the array.
OCTINTERP_API bool save_three_d(std::ostream &os, const octave_value &t, bool parametric=false)
OCTINTERP_API bool save_ascii_data(std::ostream &os, const octave_value &val_arg, const std::string &name, bool mark_as_global, int precision)
static const pair_type keywords[]
static bool match(const std::string &filename_arg, const std::string &path_elt_arg)
OCTINTERP_API bool save_ascii_data_for_plotting(std::ostream &os, const octave_value &t, const std::string &name)