MCPcopy Create free account
hub / github.com/chrxh/alien / isStringValidForDatabase

Method isStringValidForDatabase

source/Network/NetworkValidationService.cpp:3–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "NetworkValidationService.h"
2
3bool NetworkValidationService::isStringValidForDatabase(std::string const& s)
4{
5 for (char const& ch : s) {
6 if (!std::isalnum(ch) && ch != ' ' && ch != '\n' && ch != '\r' && ch != '\t' && ch != '-' && ch != '+' && ch != '_' && ch != '/' && ch != '*'
7 && ch != '~' && ch != '#' && ch != '.' && ch != '\'' && ch != '`' && ch != ':' && ch != ',' && ch != '<' && ch != '>' && ch != '=' && ch != '|'
8 && ch != '!' && ch != '&' && ch != '(' && ch != ')' && ch != '[' && ch != ']' && ch != '{' && ch != '}' && ch != '?' && ch != '@' && ch != ';') {
9 return false;
10 }
11 }
12 return true;
13}

Callers 3

processInternMethod · 0.80
processForLeafMethod · 0.80
processForFolderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected