Replaced all tabs with 4 spaces

This commit is contained in:
WolverinDEV
2020-01-24 02:49:59 +01:00
parent 735e427376
commit b85c51951c
84 changed files with 9824 additions and 9824 deletions
+26 -26
View File
@@ -7,32 +7,32 @@ using namespace std;
using namespace bbcode;
bool bbcode::sloppy::has_tag(std::string message, std::deque<std::string> tag) {
std::transform(message.begin(), message.end(), message.begin(), ::tolower);
for(auto& entry : tag)
std::transform(entry.begin(), entry.end(), entry.begin(), ::tolower);
std::transform(message.begin(), message.end(), message.begin(), ::tolower);
for(auto& entry : tag)
std::transform(entry.begin(), entry.end(), entry.begin(), ::tolower);
std::deque<std::string> begins;
size_t index = 0, found, length = 0;
do {
found = string::npos;
for(auto it = tag.begin(); it != tag.end() && found == string::npos; it++) {
found = message.find(*it, index);
length = it->length();
};
if(found > 0 && found + length < message.length()) {
if(message[found + length] == ']' || (message[found + length] == '=' && message.find(']', found + length) != string::npos)) {
if(message[found - 1] == '/') {
auto found_tag = message.substr(found, length);
for(const auto& entry : begins)
if(entry == found_tag) return true;
} else if(message[found - 1] == '[' && (found < 2 || message[found - 2] != '\\'))
begins.push_back(message.substr(found, length));
if(message[found + length] != ']')
found = message.find(']', found + length);
}
}
index = found + 1;
} while(index != 0);
std::deque<std::string> begins;
size_t index = 0, found, length = 0;
do {
found = string::npos;
for(auto it = tag.begin(); it != tag.end() && found == string::npos; it++) {
found = message.find(*it, index);
length = it->length();
};
if(found > 0 && found + length < message.length()) {
if(message[found + length] == ']' || (message[found + length] == '=' && message.find(']', found + length) != string::npos)) {
if(message[found - 1] == '/') {
auto found_tag = message.substr(found, length);
for(const auto& entry : begins)
if(entry == found_tag) return true;
} else if(message[found - 1] == '[' && (found < 2 || message[found - 2] != '\\'))
begins.push_back(message.substr(found, length));
if(message[found + length] != ']')
found = message.find(']', found + length);
}
}
index = found + 1;
} while(index != 0);
return false;
return false;
}
+4 -4
View File
@@ -4,8 +4,8 @@
#include <memory>
namespace bbcode::sloppy {
extern bool has_tag(std::string message, std::deque<std::string> tag);
extern bool has_tag(std::string message, std::deque<std::string> tag);
inline bool has_url(const std::string& message) { return has_tag(message, {"url"}); }
inline bool has_image(const std::string& message) { return has_tag(message, {"img"}); }
}
inline bool has_url(const std::string& message) { return has_tag(message, {"url"}); }
inline bool has_image(const std::string& message) { return has_tag(message, {"img"}); }
}