промежуточный. частичный рефакторинг инициализации. еще не готов.
This commit is contained in:
29
src/files/Text.h
Normal file
29
src/files/Text.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user