Skip to content
Snippets Groups Projects
Commit 9ae327e9 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

RegExp: const getter versions

parent 47bc32ab
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,10 @@ list<RegExpElement*>& Alternation::getElements() {
return elements;
}
 
const list<RegExpElement*>& Alternation::getElements() const {
return elements;
}
RegExpElement* Alternation::clone() const {
return new Alternation(*this);
}
......
......@@ -33,6 +33,11 @@ public:
*/
list<RegExpElement*>& getElements();
 
/**
* @return list of operands
*/
const list<RegExpElement*>& getElements() const;
/**
* @copydoc RegExpElement::clone() const
*/
......
......@@ -46,6 +46,10 @@ list<RegExpElement*>& Concatenation::getElements() {
return elements;
}
 
const list<RegExpElement*>& Concatenation::getElements() const {
return elements;
}
RegExpElement* Concatenation::clone() const {
return new Concatenation(*this);
}
......
......@@ -33,6 +33,11 @@ public:
*/
list<RegExpElement*>& getElements();
 
/**
* @return list of operands
*/
const list<RegExpElement*>& getElements() const;
/**
* @copydoc RegExpElement::clone() const
*/
......
......@@ -53,6 +53,10 @@ RegExpElement* Iteration::getElement() {
return element;
}
 
const RegExpElement* Iteration::getElement() const {
return element;
}
void Iteration::setElement(RegExpElement* element) {
this->element = element;
}
......
......@@ -33,6 +33,11 @@ public:
*/
RegExpElement* getElement();
 
/**
* @return element to iterate
*/
const RegExpElement* getElement() const;
/**
* Sets the element to iterate. Doesn't perform the copy, just stores the pointer!
* @param element RegExpElement to set
......
......@@ -62,6 +62,10 @@ RegExpElement* RegExp::getRegExp() {
return regExp;
}
 
const RegExpElement* RegExp::getRegExp() const {
return regExp;
}
void RegExp::setRegExp(RegExpElement* regExp) {
this->regExp = regExp;
}
......
......@@ -12,6 +12,7 @@
#include <list>
#include <string>
#include "RegExpElement.h"
#include "RegExpEmpty.h"
 
namespace regexp {
 
......@@ -42,6 +43,11 @@ public:
*/
RegExpElement* getRegExp();
 
/**
* @return Root node of the regular expression tree
*/
const RegExpElement* getRegExp() const;
/**
* Sets the root node of the regular expression tree. Doesn't perform copy of the regExp param,
* just stores it!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment