Mercurial > hg > octave-lyh
annotate libinterp/interp-core/oct-errno.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 |
---|---|
5465 | 1 // oct-errno.h.in |
2 /* | |
3 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13992
diff
changeset
|
4 Copyright (C) 2005-2012 John W. Eaton |
5465 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5465 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5465 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_errno_h) | |
25 #define octave_errno_h 1 | |
26 | |
8020
1d2bcc163c4d
oct-errno.h: include <cerrno>
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
27 #include <cerrno> |
5465 | 28 #include <map> |
29 #include <string> | |
30 | |
31 #include "oct-map.h" | |
32 | |
33 class | |
34 octave_errno | |
35 { | |
36 protected: | |
37 | |
38 octave_errno (void); | |
39 | |
40 public: | |
41 | |
42 ~octave_errno (void) { } | |
43 | |
44 static bool instance_ok (void); | |
45 | |
13992
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
46 static void cleanup_instance (void) { delete instance; instance = 0; } |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
47 |
5465 | 48 static int lookup (const std::string& name); |
49 | |
11057
4d9f310b32bb
replace Octave_map->octave_map in oct-errno
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
50 static octave_scalar_map list (void); |
5465 | 51 |
52 static int get (void) { return errno; } | |
53 | |
54 static int set (int val) | |
55 { | |
56 int retval = errno; | |
57 errno = val; | |
58 return retval; | |
59 } | |
60 | |
61 private: | |
62 | |
63 std::map<std::string, int> errno_tbl; | |
64 | |
65 static octave_errno *instance; | |
66 | |
67 int do_lookup (const std::string& name); | |
68 | |
11057
4d9f310b32bb
replace Octave_map->octave_map in oct-errno
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
69 octave_scalar_map do_list (void); |
5465 | 70 }; |
71 | |
72 #endif |