Files
VisualSapfor/Planner/Text.h
2023-12-03 15:31:50 +03:00

30 lines
624 B
C++

#pragma once
#include "String.h"
#include "Array.h"
class Text : public Array<String> {
public:
void Print() const {
printf("text length=%ld\n", this->getLength());
auto elems = this->getElements();
for (long i = 0; i < elems.size(); ++i) {
printf("i=%ld; [%s]\n", i, elems[i]->getCharArray());
// elements[i]->println();
}
}
bool hasMatch(const String& s) const {
for (auto& elem : this->getElements()) {
if (s.contains(*elem)) {
//printf("match: [%s]\n", elements[i]->getCharArray());
return true;
}
}
//printf("no matches for [%s]\n", s.getCharArray());
return false;
}
};