Lines Matching refs:input

75     void ReplaceSpecialSymbols(std::string& input, std::string& oldstr, std::string& newstr)  in ReplaceSpecialSymbols()  argument
80 if ((pos = input.find(oldstr)) != std::string::npos) { in ReplaceSpecialSymbols()
81 input.replace(pos, oldlen, newstr); in ReplaceSpecialSymbols()
102 std::string DecodeSpecialChars(std::string input) in DecodeSpecialChars() argument
104 std::string temp = input; in DecodeSpecialChars()
106 if (input.empty()) { in DecodeSpecialChars()
175 bool AnalysisScheme(std::string& input, std::string& scheme, in AnalysisScheme() argument
178 if (!isalpha(input[0])) { in AnalysisScheme()
182 size_t strlen = input.size(); in AnalysisScheme()
184 if ((isalnum(input[i]) || input[i] == '+' || input[i] == '-' || input[i] == '.') && in AnalysisScheme()
185 isupper(input[i])) { in AnalysisScheme()
186 input[i] = static_cast<size_t>(tolower(input[i])); in AnalysisScheme()
188 if (!isalnum(input[i]) && input[i] != '+' && input[i] != '-' && input[i] != '.') { in AnalysisScheme()
194 scheme = input; in AnalysisScheme()
202 void AnalysisFragment(const std::string& input, std::string& fragment, in AnalysisFragment() argument
205 fragment = input; in AnalysisFragment()
209 void AnalysisQuery(const std::string& input, std::string& query, in AnalysisQuery() argument
212 query = input; in AnalysisQuery()
215 void AnalysisUsernameAndPasswd(std::string& input, std::string& username, std::string& password, in AnalysisUsernameAndPasswd() argument
218 int pos = static_cast<int>(input.size()) - 1; in AnalysisUsernameAndPasswd()
220 if (input[pos] == '@') { in AnalysisUsernameAndPasswd()
224 std::string userAndPasswd = input.substr(0, pos); in AnalysisUsernameAndPasswd()
225 input = input.substr(pos + 1); in AnalysisUsernameAndPasswd()
257 void AnalysisPath(std::string& input, std::vector<std::string>& path, in AnalysisPath() argument
262 while (((pos = input.find('/')) != std::string::npos) || in AnalysisPath()
263 ((pos = input.find('\\')) != std::string::npos && isSpecial)) { in AnalysisPath()
264 temp.push_back(input.substr(0, pos)); in AnalysisPath()
265 input = input.substr(pos + 1); in AnalysisPath()
267 temp.push_back(input); in AnalysisPath()
299 void AnalysisPort(std::string input, UrlData& urlinfo, in AnalysisPort() argument
302 if (input.size() == 0) { in AnalysisPort()
305 for (auto i : input) { in AnalysisPort()
311 if (input.size() >= 6) { //6:Maximum port number size in AnalysisPort()
315 int it = stoi(input); in AnalysisPort()
332 void AnalysisOpaqueHost(std::string input, std::string& host, in AnalysisOpaqueHost() argument
335 size_t strlen = input.size(); in AnalysisOpaqueHost()
337 char ch = input[i]; in AnalysisOpaqueHost()
344 host = input; in AnalysisOpaqueHost()
487 void IPv6Host(std::string& input, std::string& host, in IPv6Host() argument
500 if (!std::regex_match(input, ipv6)) { in IPv6Host()
505 pos = input.find('.'); in IPv6Host()
507 input = DealIpv4(input); in IPv6Host()
509 FormatIpv6(input); in IPv6Host()
510 input = Compress(input); in IPv6Host()
511 host = "[" + input + "]"; in IPv6Host()
688 void AnalyseIPv4(const std::string& input, std::string& host, in AnalyseIPv4() argument
693 isipv4 = RemovalIpv4(temp, input, flags); in AnalyseIPv4()
729 void AnalysisHost(std::string& input, std::string& host, in AnalysisHost() argument
732 if (input.empty()) { in AnalysisHost()
736 if (input[0] == '[') { in AnalysisHost()
737 if ((input[input.length() - 1]) == ']') { in AnalysisHost()
738 size_t b = input.length(); in AnalysisHost()
739 input = input.substr(1, b - 2); // 2:Truncating Strings in AnalysisHost()
740 IPv6Host(input, host, flags); in AnalysisHost()
748 AnalysisOpaqueHost(input, host, flags); in AnalysisHost()
751 std::string decodeInput = DecodeSpecialChars(input); in AnalysisHost()
759 bool ISFileNohost(const std::string& input) in ISFileNohost() argument
761 if ((isalpha(input[0]) && (input[1] == ':' || input[1] == '|'))) { in ISFileNohost()
767 void AnalysisFilePath(std::string& input, UrlData& urlinfo, in AnalysisFilePath() argument
772 …while (((pos = input.find('/')) != std::string::npos) || ((pos = input.find('\\')) != std::string:… in AnalysisFilePath()
773 temp.push_back(input.substr(0, pos)); in AnalysisFilePath()
774 input = input.substr(pos + 1); in AnalysisFilePath()
776 temp.push_back(input); in AnalysisFilePath()
829 void AnalysisFile(std::string& input, UrlData& urlinfo, in AnalysisFile() argument
833 if ((input[0] == '/' || input[0] == '\\') && (input[1] == '/' || input[1] == '\\')) { in AnalysisFile()
834 std::string temp = input.substr(2); // 2:Intercept from 2 subscripts in AnalysisFile()
852 if (input[0] == '/' || input[0] == '\\') { in AnalysisFile()
853 input = input.substr(1); in AnalysisFile()
855 AnalysisFilePath(input, urlinfo, flags); in AnalysisFile()
859 void AnalysisFilescheme(const std::string& input, UrlData& urlinfo, in AnalysisFilescheme() argument
862 std::string strPath = urlinfo.scheme + input; in AnalysisFilescheme()
869 UrlData& urlinfo, const std::string& input) in AnalyInfoPath() argument
875 urlinfo.path[0] = input; in AnalyInfoPath()
905 void AnalysisNoDefaultProtocol(std::string& input, UrlData& urlinfo, in AnalysisNoDefaultProtocol() argument
909 AnalysisFilescheme(input, urlinfo, flags); in AnalysisNoDefaultProtocol()
912 … if (input[0] == '/' && input[1] == '/' && input[2] != '/') { // 2:The third character of the input in AnalysisNoDefaultProtocol()
913 std::string hostandpath = input.substr(2); // 2:Intercept from 2 subscripts in AnalysisNoDefaultProtocol()
949 } else if (input[0] == '/' && input[1] == '/') { in AnalysisNoDefaultProtocol()
950 std::string strOfPath = input.substr(1); in AnalysisNoDefaultProtocol()
953 AnalyInfoPath(flags, urlinfo, input); in AnalysisNoDefaultProtocol()
957 void AnalysisOnlyHost(const std::string& input, UrlData& urlinfo, in AnalysisOnlyHost() argument
960 std::string strHost = input; in AnalysisOnlyHost()
982 void JudgePos(size_t &pos, const size_t &length, const std::string& input) in JudgePos() argument
985 if (input[pos] == '/' || input[pos] == '\\') { in JudgePos()
991 void SkipSlashSymbol(std::string& input, size_t& pos) in SkipSlashSymbol() argument
993 size_t inputLen = input.size(); in SkipSlashSymbol()
995 if (input[pos] == '/' || input[pos] == '\\') { in SkipSlashSymbol()
1001 input = input.substr(pos); in SkipSlashSymbol()
1004 void ParsingHostAndPath(std::string& input, UrlData& urlinfo, size_t& pos, in ParsingHostAndPath() argument
1008 size_t length = input.size(); in ParsingHostAndPath()
1009 JudgePos(pos, length, input); in ParsingHostAndPath()
1010 std::string strHost = input.substr(0, pos); in ParsingHostAndPath()
1011 std::string strPath = input.substr(pos + 1); in ParsingHostAndPath()
1035 void AnalysisHostAndPath(std::string& input, UrlData& urlinfo, in AnalysisHostAndPath() argument
1040 SkipSlashSymbol(input, pos); in AnalysisHostAndPath()
1041 if (input.size() == 0) { in AnalysisHostAndPath()
1044 … } else if ((input.find('/') != std::string::npos || input.find('\\') != std::string::npos)) { in AnalysisHostAndPath()
1045 ParsingHostAndPath(input, urlinfo, pos, flags); in AnalysisHostAndPath()
1046 } else if (input.size() != 0 && input.find('/') == std::string::npos && in AnalysisHostAndPath()
1047 input.find('\\') == std::string::npos) { in AnalysisHostAndPath()
1048 AnalysisOnlyHost(input, urlinfo, flags, pos); in AnalysisHostAndPath()
1051 size_t inputLen = input.size(); in AnalysisHostAndPath()
1053 urlinfo.isSpecialPath = input[0] != '/' ? true : false; in AnalysisHostAndPath()
1055 AnalysisNoDefaultProtocol(input, urlinfo, flags); in AnalysisHostAndPath()
1059 void AnalysisInput(std::string& input, UrlData& urlData, in AnalysisInput() argument
1063 if (input.find('#') != std::string::npos) { in AnalysisInput()
1064 pos = input.find('#'); in AnalysisInput()
1065 std::string fragment = input.substr(pos); in AnalysisInput()
1067 input = input.substr(0, pos); in AnalysisInput()
1069 if (input.find('?') != std::string::npos) { in AnalysisInput()
1070 pos = input.find('?'); in AnalysisInput()
1071 std::string query = input.substr(pos); in AnalysisInput()
1073 input = input.substr(0, pos); in AnalysisInput()
1076 std::string pathStr = input; in AnalysisInput()
1131 void InitOnlyInput(std::string& input, UrlData& urlData, in InitOnlyInput() argument
1134 if (input.empty()) { in InitOnlyInput()
1138 if (input.find(':') != std::string::npos) { in InitOnlyInput()
1139 size_t pos = input.find(':'); in InitOnlyInput()
1141 std::string scheme = input.substr(0, pos); in InitOnlyInput()
1145 if (input.find('#') != std::string::npos) { in InitOnlyInput()
1146 size_t posTmp = input.find('#'); in InitOnlyInput()
1147 std::string fragment = input.substr(posTmp); in InitOnlyInput()
1149 input = input.substr(0, posTmp); in InitOnlyInput()
1151 if (input.find('?') != std::string::npos) { in InitOnlyInput()
1152 size_t position = input.find('?'); in InitOnlyInput()
1153 std::string query = input.substr(position); in InitOnlyInput()
1155 input = input.substr(0, position); in InitOnlyInput()
1157 std::string str = input.substr(pos); in InitOnlyInput()
1169 void ToolHasBase(std::string input, std::string &strInput, UrlData &urlData, in ToolHasBase() argument
1172 if (!input.empty() && input[0] == '/') { in ToolHasBase()
1173 strInput = input.substr(1); in ToolHasBase()
1175 } else if (!input.empty() && input[0] != '/') { in ToolHasBase()
1194 URL::URL(const std::string& input) in URL() argument
1196 std::string str = input; in URL()
1213 URL::URL(const std::string& input, const std::string& base) in URL() argument
1218 std::string strInput = input; in URL()
1231 if ((input[0] == '/') && (input[1] == '/' || (input[1] == '\\' && in URL()
1233 std::string newInput = baseInfo.scheme + input; in URL()
1240 BaseInfoToUrl(baseInfo, baseflags, urlData_, flags_, input.empty()); in URL()
1241 ToolHasBase(input, strInput, urlData_, flags_); in URL()
1242 if (!input.empty() && input[0] != '/' && urlData_.path.empty()) { in URL()
1247 if (!input.empty() && input[0] != '/' && !urlData_.path.empty()) { in URL()
1263 URL::URL(const std::string& input, const URL& base) in URL() argument
1265 std::string strInput = input; in URL()
1274 if ((input[0] == '/') && (input[1] == '/' || (input[1] == '\\' && in URL()
1276 std::string newInput = baseInfo.scheme + input; in URL()
1283 BaseInfoToUrl(baseInfo, baseflags, urlData_, flags_, input.empty()); in URL()
1284 ToolHasBase(input, strInput, urlData_, flags_); in URL()
1285 if (!input.empty() && input[0] != '/' && urlData_.path.empty()) { in URL()
1290 if (!input.empty() && input[0] != '/' && !urlData_.path.empty()) { in URL()
1445 void URL::SetHostname(const std::string& input) in SetHostname() argument
1450 std::string strHost = input; in SetHostname()
1475 void URL::SetHref(const std::string& input) in SetHref() argument
1477 std::string str = input; in SetHref()
1489 void URL::SetPath(const std::string& input) in SetPath() argument
1491 std::string strPath = input; in SetPath()
1526 void SplitString(const std::string& input, std::string& strHost, std::string& port) in SplitString() argument
1528 size_t strlen = input.size(); in SplitString()
1530 if ((input[pos] == ':') || (input[pos] == '?') || (input[pos] == '#') || in SplitString()
1531 (input[pos] == '/') || (input[pos] == '\\')) { in SplitString()
1532 strHost = input.substr(0, pos); in SplitString()
1533 if (input[pos] == ':') { in SplitString()
1535 port = input.substr(pos); in SplitString()
1542 void URL::SetHost(const std::string& input) in SetHost() argument
1544 if (input.empty() || flags_.test(static_cast<size_t>(BitsetStatusFlag::BIT9))) { in SetHost()
1547 std::string strHost = input; in SetHost()
1549 SplitString(input, strHost, port); in SetHost()
1586 void URL::SetPort(const std::string& input) in SetPort() argument
1588 std::string port = input; in SetPort()
1607 void URL::SetSearch(const std::string& input) in SetSearch() argument
1610 if (input.size() == 0) { in SetSearch()
1614 if (input[0] != '?') { in SetSearch()
1616 temp += input; in SetSearch()
1618 temp = input; in SetSearch()
1627 void URL::SetFragment(const std::string& input) in SetFragment() argument
1630 if (input.size() == 0) { in SetFragment()
1634 if (input[0] != '#') { in SetFragment()
1636 temp += input; in SetFragment()
1638 temp = input; in SetFragment()
1644 void URL::SetScheme(const std::string& input) in SetScheme() argument
1646 std::string strInput = input; in SetScheme()
1648 bool inputIsSpecial = IsSpecial(input); in SetScheme()
1649 if ((special != inputIsSpecial) || ((input == "file") && in SetScheme()
1665 void URL::SetUsername(const std::string& input) in SetUsername() argument
1667 if (input.size() == 0) { in SetUsername()
1671 std::string usname = input; in SetUsername()
1681 void URL::SetPassword(const std::string& input) in SetPassword() argument
1683 if (input.size() == 0) { in SetPassword()
1687 std::string keyWord = input; in SetPassword()