everything is ready for start signal filtering ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4810,6 +4810,109 @@ int GetBars(
|
|||||||
//
|
//
|
||||||
// String ...
|
// String ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Search a Content Contains Specific String or not ...
|
||||||
|
bool Contains(
|
||||||
|
string mQuery, // Search String
|
||||||
|
string mContent, // Search Content
|
||||||
|
bool ignoreCase = true // Ignore Case
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Query ...
|
||||||
|
result = IsValid(mQuery);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Content ...
|
||||||
|
result = IsValid(mContent);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize Inputs ...
|
||||||
|
string query = mQuery;
|
||||||
|
string content = mContent;
|
||||||
|
if (ignoreCase)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
StringToLower(query);
|
||||||
|
StringToLower(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
int queryIdx = StringFind(
|
||||||
|
content,
|
||||||
|
query);
|
||||||
|
|
||||||
|
//
|
||||||
|
result = queryIdx >= 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool Contains(
|
||||||
|
string &mQueries[], // Search Strings
|
||||||
|
string mContent, // Search Content
|
||||||
|
bool ignoreCase = true // Ignore Case
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Queries ...
|
||||||
|
int queriesCount = ArraySize(mQueries);
|
||||||
|
result = queriesCount > 0;
|
||||||
|
if (!result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Content ...
|
||||||
|
result = IsValid(mContent);
|
||||||
|
if (!result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
int containsCount = 0;
|
||||||
|
for (int i = 0; i < queriesCount; i++) {
|
||||||
|
//
|
||||||
|
bool isContains = Contains(
|
||||||
|
mQueries[i],
|
||||||
|
mContent,
|
||||||
|
ignoreCase
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!isContains) {
|
||||||
|
//
|
||||||
|
result = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
containsCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = containsCount == queriesCount;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert From String ...
|
// Convert From String ...
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|||||||
Reference in New Issue
Block a user