STORMM Source Documentation
Loading...
Searching...
No Matches
textguard.h
1// -*-c++-*-
2#ifndef STORMM_TEXTGUARD_H
3#define STORMM_TEXTGUARD_H
4
5#include <string>
6#include "copyright.h"
7
8namespace stormm {
9namespace parse {
10
13enum class LineSpan {
14 SINGLE, MULTIPLE
15};
16
18class TextGuard {
19public:
20
26 TextGuard(const std::string &left_in, const std::string &right_in = std::string(""),
27 LineSpan spans_in = LineSpan::SINGLE);
28
30 ~TextGuard() = default;
31
33 const std::string& getLeft() const;
34
36 const std::string& getRight() const;
37
39 int leftSize() const;
40
42 int rightSize() const;
43
46 LineSpan getSpan() const;
47
51 bool getTerminationRequirement() const;
52
53private:
54 std::string left;
55 std::string right;
56 int left_length;
57 int right_length;
58 LineSpan line_span;
60 bool requires_termination;
61};
62
63} // namespace parse
64} // namespace stormm
65
66#endif
TextGuard(const std::string &left_in, const std::string &right_in=std::string(""), LineSpan spans_in=LineSpan::SINGLE)
Constructor for text comment records.
Definition textguard.cpp:9
~TextGuard()=default
Default destructor.
const std::string & getRight() const
Get the right-hand guard.
Definition textguard.cpp:34
bool getTerminationRequirement() const
Get the (boolean) termination requirement: yes or no, does guarded text need to end with an explicit ...
Definition textguard.cpp:54
int rightSize() const
Get the size of the right-hand guard, in terms of the number of characters.
Definition textguard.cpp:44
TextGuard(const std::string &left_in, const std::string &right_in=std::string(""), LineSpan spans_in=LineSpan::SINGLE)
Constructor for text comment records.
Definition textguard.cpp:9
const std::string & getLeft() const
Get the left-hand guard.
Definition textguard.cpp:29
int leftSize() const
Get the size of the left-hand guard, in terms of the number of characters.
Definition textguard.cpp:39
LineSpan getSpan() const
Get the line span of this TextGuard object: is it limited to a single line, or can it span multiple l...
Definition textguard.cpp:49