Files
VisualSapfor/src/files/Text.h

30 lines
624 B
C
Raw Normal View History

2023-12-03 19:43:41 +03:00
#pragma once
2023-09-17 22:13:42 +03:00
#include "String.h"
#include "Array.h"
2023-12-03 19:43:41 +03:00
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;
}
2023-09-17 22:13:42 +03:00
}
//printf("no matches for [%s]\n", s.getCharArray());
return false;
}
2023-12-03 19:43:41 +03:00
};