Mercurial > hg > octave-lyh
annotate libinterp/interp-core/ls-mat-ascii.h @ 16555:04fb96f4bea1
allow double-click in file browser to load data files
* files-dock-widget.cc (files_dock_widget::display_directory): If file
looks like Octave data file, load it instead of opening with editor.
* ls-mat-ascii.h, ls-mat-ascii.cc (get_lines_and_columns): New option
to supress error messages. New option to check for numeric values.
(looks_like_mat_ascii_file): New function.
* load-save.h load-save.cc (is_octave_data_file): New function.
(get_file_format): Don't return LS_MAT_ASCII unless the file really
looks like it is a numeric data file.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 23 Apr 2013 12:57:16 -0400 |
parents | 2fc554ffbc28 |
children |
rev | line source |
---|---|
4634 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
3 Copyright (C) 2003-2012 John W. Eaton |
4634 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
4634 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
4634 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_ls_mat_ascii_h) | |
24 #define octave_ls_mat_ascii_h 1 | |
25 | |
26 extern std::string | |
27 read_mat_ascii_data (std::istream& is, const std::string& filename, | |
10313 | 28 octave_value& tc); |
4634 | 29 |
5938 | 30 extern bool |
31 save_mat_ascii_data (std::ostream& os, const octave_value& val_arg, | |
10313 | 32 int precision, bool tabs = false); |
5938 | 33 |
16555
04fb96f4bea1
allow double-click in file browser to load data files
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
34 extern bool looks_like_mat_ascii_file (const std::string& filename); |
04fb96f4bea1
allow double-click in file browser to load data files
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
35 |
4634 | 36 #endif |