GNU Octave
7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
filepos.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2019-2022 The Octave Project Developers
4
//
5
// See the file COPYRIGHT.md in the top-level directory of this
6
// distribution or <https://octave.org/copyright/>.
7
//
8
// This file is part of Octave.
9
//
10
// Octave is free software: you can redistribute it and/or modify it
11
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
14
//
15
// Octave is distributed in the hope that it will be useful, but
16
// WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU General Public License for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with Octave; see the file COPYING. If not, see
22
// <https://www.gnu.org/licenses/>.
23
//
24
////////////////////////////////////////////////////////////////////////
25
26
#if ! defined (octave_filepos_h)
27
#define octave_filepos_h 1
28
29
#include "octave-config.h"
30
31
namespace
octave
32
{
33
class
filepos
34
{
35
public
:
36
37
filepos
(
void
) :
m_line
(0),
m_column
(0) { }
38
39
filepos
(
int
l,
int
c) :
m_line
(l),
m_column
(c) { }
40
41
filepos
(
const
filepos
&) =
default
;
42
43
filepos
&
operator =
(
const
filepos
&) =
default
;
44
45
~filepos
(
void
) =
default
;
46
47
operator
bool
() {
return
m_line
> 0 &&
m_column
> 0; }
48
49
void
line
(
int
l) {
m_line
= l; }
50
void
column
(
int
c) {
m_column
= c; }
51
52
int
line
(
void
)
const
{
return
m_line
; }
53
int
column
(
void
)
const
{
return
m_column
; }
54
55
void
increment_line
(
int
val = 1) {
m_line
+= val; }
56
void
increment_column
(
int
val = 1) {
m_column
+= val; }
57
58
void
decrement_line
(
int
val = 1) {
m_line
-= val; }
59
void
decrement_column
(
int
val = 1) {
m_column
-= val; }
60
61
void
next_line
(
void
)
62
{
63
m_line
++;
64
m_column
= 1;
65
}
66
67
private
:
68
69
int
m_line
;
70
int
m_column
;
71
};
72
}
73
74
#endif
bool
octave::filepos
Definition:
filepos.h:34
octave::filepos::operator=
filepos & operator=(const filepos &)=default
octave::filepos::increment_column
void increment_column(int val=1)
Definition:
filepos.h:56
octave::filepos::decrement_column
void decrement_column(int val=1)
Definition:
filepos.h:59
octave::filepos::line
void line(int l)
Definition:
filepos.h:49
octave::filepos::decrement_line
void decrement_line(int val=1)
Definition:
filepos.h:58
octave::filepos::next_line
void next_line(void)
Definition:
filepos.h:61
octave::filepos::column
void column(int c)
Definition:
filepos.h:50
octave::filepos::m_column
int m_column
Definition:
filepos.h:70
octave::filepos::filepos
filepos(int l, int c)
Definition:
filepos.h:39
octave::filepos::filepos
filepos(void)
Definition:
filepos.h:37
octave::filepos::column
int column(void) const
Definition:
filepos.h:53
octave::filepos::m_line
int m_line
Definition:
filepos.h:69
octave::filepos::filepos
filepos(const filepos &)=default
octave::filepos::~filepos
~filepos(void)=default
octave::filepos::line
int line(void) const
Definition:
filepos.h:52
octave::filepos::increment_line
void increment_line(int val=1)
Definition:
filepos.h:55
octave
Definition:
idx-vector.cc:46
libinterp
parse-tree
filepos.h
Generated on Sun Jun 26 2022 01:27:49 for GNU Octave by
1.9.4