GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-colon.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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_ov_colon_h)
27#define octave_ov_colon_h 1
28
29#include "octave-config.h"
30
31#include <cstdlib>
32
33#include <iosfwd>
34#include <string>
35
36#include "mx-base.h"
37#include "str-vec.h"
38
39#include "error.h"
40#include "ov-base.h"
41#include "ov-typeinfo.h"
42
44
45// A type to represent ':' as used for indexing.
46
48{
49public:
50
53
56
57 ~octave_magic_colon () = default;
58
60 { return new octave_magic_colon (*this); }
62 { return new octave_magic_colon (); }
63
64 octave::idx_vector index_vector (bool /* require_integers */ = false) const
65 { return octave::idx_vector (':'); }
66
67 bool is_defined () const { return true; }
68
69 bool is_constant () const { return true; }
70
71 bool is_magic_colon () const { return true; }
72
73 OCTINTERP_API void print (std::ostream& os, bool pr_as_read_syntax = false);
74
75 OCTINTERP_API void print_raw (std::ostream& os,
76 bool pr_as_read_syntax = false) const;
77
78private:
79
81};
82
83#endif
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition ov-colon.cc:48
void print(std::ostream &os, bool pr_as_read_syntax=false)
Definition ov-colon.cc:41
octave_base_value * clone() const
Definition ov-colon.h:59
octave::idx_vector index_vector(bool=false) const
Definition ov-colon.h:64
bool is_constant() const
Definition ov-colon.h:69
bool is_defined() const
Definition ov-colon.h:67
octave_base_value * empty_clone() const
Definition ov-colon.h:61
bool is_magic_colon() const
Definition ov-colon.h:71
octave_magic_colon(const octave_magic_colon &)
Definition ov-colon.h:54
~octave_magic_colon()=default
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition ov-base.h:185