Lines Matching refs:std
24 std::map<std::string, int> g_head = {
29 std::vector<std::string> g_doubleSegment = {
34 std::vector<std::string> g_singlesegment = { ".", "%2e", "%2E" };
35 std::vector<std::string> g_specialSymbols = {
39 std::vector<char> g_specialcharacter = {
44 std::bitset<static_cast<size_t>(BitsetStatusFlag::MAX_BIT_SIZE)> g_specialCharForBit;
48 std::vector<char> g_specialSymbolsTmp = {'#', '%', '/', ':', '?', '@', '[', '\\', ']', '<', '>', '^', '|'};
60 bool CheckCharacter(std::string data, std::bitset<static_cast<size_t>(BitsetStatusFlag::MAX_BIT_SIZE)> rule)
75 void ReplaceSpecialSymbols(std::string& input, std::string& oldstr, std::string& newstr)
80 if ((pos = input.find(oldstr)) != std::string::npos) {
102 std::string DecodeSpecialChars(std::string input)
104 std::string temp = input;
110 while (pos != std::string::npos && pos < len - 2) { // 2:end subscript backspace
112 std::string subStr = temp.substr(pos + 1, 2); // 2:Truncate the last two digits of the %
118 std::string convertedChar(1, static_cast<char>(octNum));
127 void DeleteC0OrSpace(std::string& str)
155 void DeleteTabOrNewline(std::string& str1)
166 bool IsSpecial(std::string scheme)
175 bool AnalysisScheme(std::string& input, std::string& scheme,
176 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
202 void AnalysisFragment(const std::string& input, std::string& fragment,
203 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
209 void AnalysisQuery(const std::string& input, std::string& query,
210 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
215 void AnalysisUsernameAndPasswd(std::string& input, std::string& username, std::string& password,
216 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
224 std::string userAndPasswd = input.substr(0, pos);
229 if (userAndPasswd.find('@') != std::string::npos) {
232 if ((posTmp = userAndPasswd.find('@')) != std::string::npos) {
239 if (userAndPasswd.find(':') != std::string::npos) {
241 std::string user = userAndPasswd.substr(0, position);
242 std::string keyWord = userAndPasswd.substr(position + 1);
257 void AnalysisPath(std::string& input, std::vector<std::string>& path,
258 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags, bool isSpecial)
260 std::vector<std::string> temp;
262 while (((pos = input.find('/')) != std::string::npos) ||
263 ((pos = input.find('\\')) != std::string::npos && isSpecial)) {
299 void AnalysisPort(std::string input, UrlData& urlinfo,
300 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
332 void AnalysisOpaqueHost(std::string input, std::string& host,
333 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
348 std::string DealIpv4(std::string str)
350 std::vector<std::string> temp;
355 std::string val = "";
356 while ((pos = str.find(".", left)) != std::string::npos) {
372 std::string res = str.substr(0, index);
377 void FormatIpv6(std::string& str)
381 if (pos != std::string::npos) {
384 while ((pos = str.find(":", left)) != std::string::npos) {
389 std::string temp = "";
401 void RemoveLeadingZeros(std::vector<std::string> &ipv6)
422 std::string ZeroCompression(std::vector<std::string> &ipv6)
443 std::string res = "";
461 void ToLower(std::string &str)
471 std::string Compress(std::string str)
473 std::vector<std::string> temp;
476 while ((pos = str.find(":", left)) != std::string::npos) {
482 std::string res = ZeroCompression(temp);
487 void IPv6Host(std::string& input, std::string& host,
488 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
490 std::regex ipv6("(::|(:((:[0-9A-Fa-f]{1,4}){1,7}))|(([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|"
500 if (!std::regex_match(input, ipv6)) {
506 if (pos != std::string::npos) {
516 bool IsRadix(std::string num, std::string radix)
520 if (radix.find(num[i]) == std::string::npos) {
527 bool IsNumber(std::string num, int &radix)
532 std::string subStr = num.substr(2); // 2:jump 0x
539 std::string subStr = num.substr(1);
551 std::string BinaryConversion(std::string num, int radix)
562 return std::to_string(val);
571 return std::to_string(val);
577 bool RemovalIpv4(std::vector<std::string> &temp, std::string str,
578 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> &flags)
582 while ((pos = str.find(".", left)) != std::string::npos) {
592 std::vector<std::string> res;
616 int IsFormatIpv4(std::vector<std::string> nums)
630 std::string SplitNum(std::string num, size_t& number)
637 std::vector<std::string> nums;
638 std::string res = "";
641 nums.push_back(std::to_string(numConver));
651 void FormatIpv4(std::vector<std::string> nums, std::string& host,
652 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> &flags)
656 std::string res = "";
672 std::string temp = SplitNum(nums[index], number);
688 void AnalyseIPv4(const std::string& input, std::string& host,
689 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
692 std::vector<std::string> temp;
700 std::string res = "";
729 void AnalysisHost(std::string& input, std::string& host,
730 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags, bool special)
751 std::string decodeInput = DecodeSpecialChars(input);
759 bool ISFileNohost(const std::string& input)
767 void AnalysisFilePath(std::string& input, UrlData& urlinfo,
768 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
770 std::vector<std::string> temp;
772 while (((pos = input.find('/')) != std::string::npos) || ((pos = input.find('\\')) != std::string::npos)) {
802 std::string it = urlinfo.path[0];
812 void AnalysisSpecialFile(std::string& temp, size_t pos, UrlData& urlinfo,
813 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
815 std::string strHost = temp.substr(0, pos);
816 std::string strPath = temp.substr(pos + 1);
829 void AnalysisFile(std::string& input, UrlData& urlinfo,
830 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
834 std::string temp = input.substr(2); // 2:Intercept from 2 subscripts
836 if ((((pos = temp.find('/')) != std::string::npos) ||
837 ((pos = temp.find('\\')) != std::string::npos)) && pos == 0) {
840 } else if ((((pos = temp.find('/')) != std::string::npos) ||
841 ((pos = temp.find('\\')) != std::string::npos)) && pos != 0) {
859 void AnalysisFilescheme(const std::string& input, UrlData& urlinfo,
860 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
862 std::string strPath = urlinfo.scheme + input;
868 void AnalyInfoPath(std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> &flags,
869 UrlData& urlinfo, const std::string& input)
880 void AnalyHostPath(std::string &strHost, std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags,
884 if (strHost[strHost.size() - 1] != ']' && (pos = strHost.find_last_of(':')) != std::string::npos) {
885 std::string port = strHost.substr(pos + 1);
893 void AnalyStrHost(std::string &strHost, UrlData& urlinfo,
894 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> &flags)
896 if (strHost.find('@') != std::string::npos) {
905 void AnalysisNoDefaultProtocol(std::string& input, UrlData& urlinfo,
906 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
913 std::string hostandpath = input.substr(2); // 2:Intercept from 2 subscripts
919 std::string strHost = "";
920 if (hostandpath.find('/') != std::string::npos) {
923 std::string strPath = hostandpath.substr(i + 1);
924 if (strHost.find('@') != std::string::npos) {
932 if (strHost[strHost.size() - 1] != ']' && (pos = strHost.find_last_of(':')) != std::string::npos) {
933 std::string port = strHost.substr(pos + 1);
937 if (strHost[strHost.size() - 1] != ']' && (pos = strHost.find_last_of(':')) != std::string::npos &&
950 std::string strOfPath = input.substr(1);
957 void AnalysisOnlyHost(const std::string& input, UrlData& urlinfo,
958 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags, size_t pos)
960 std::string strHost = input;
961 if (strHost.find('@') != std::string::npos) {
969 if ((pos = strHost.find_last_of(':')) != std::string::npos) {
970 std::string port = strHost.substr(pos + 1);
974 if ((pos = strHost.find_last_of(':')) != std::string::npos &&
982 void JudgePos(size_t &pos, const size_t &length, const std::string& input)
991 void SkipSlashSymbol(std::string& input, size_t& pos)
1004 void ParsingHostAndPath(std::string& input, UrlData& urlinfo, size_t& pos,
1005 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
1010 std::string strHost = input.substr(0, pos);
1011 std::string strPath = input.substr(pos + 1);
1012 if (strHost.find('@') != std::string::npos) {
1019 if (strHost[strHost.size() - 1] != ']' && (pos = strHost.find_last_of(':')) != std::string::npos) {
1021 if (pos != std::string::npos) {
1022 std::string port = strHost.substr(pos + 1);
1027 if (strHost[strHost.size() - 1] != ']' && strHost.find_last_of(':') != std::string::npos &&
1035 void AnalysisHostAndPath(std::string& input, UrlData& urlinfo,
1036 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
1044 } else if ((input.find('/') != std::string::npos || input.find('\\') != std::string::npos)) {
1046 } else if (input.size() != 0 && input.find('/') == std::string::npos &&
1047 input.find('\\') == std::string::npos) {
1059 void AnalysisInput(std::string& input, UrlData& urlData,
1060 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
1063 if (input.find('#') != std::string::npos) {
1065 std::string fragment = input.substr(pos);
1069 if (input.find('?') != std::string::npos) {
1071 std::string query = input.substr(pos);
1076 std::string pathStr = input;
1081 const std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& baseflags, UrlData& urlData,
1082 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags, bool inputIsEmpty)
1131 void InitOnlyInput(std::string& input, UrlData& urlData,
1132 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)>& flags)
1138 if (input.find(':') != std::string::npos) {
1141 std::string scheme = input.substr(0, pos);
1145 if (input.find('#') != std::string::npos) {
1147 std::string fragment = input.substr(posTmp);
1151 if (input.find('?') != std::string::npos) {
1153 std::string query = input.substr(position);
1157 std::string str = input.substr(pos);
1169 void ToolHasBase(std::string input, std::string &strInput, UrlData &urlData,
1170 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> &flags)
1180 std::string BasePathToStr(UrlData &urlData)
1182 std::string temp = "";
1194 URL::URL(const std::string& input)
1196 std::string str = input;
1203 void DelCont(std::string strBase, std::string &strInput, UrlData &baseInfo,
1204 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> &baseflags)
1213 URL::URL(const std::string& input, const std::string& base)
1216 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> baseflags;
1217 std::string strBase = base;
1218 std::string strInput = input;
1233 std::string newInput = baseInfo.scheme + input;
1250 std::string basePathStr = BasePathToStr(baseInfo);
1263 URL::URL(const std::string& input, const URL& base)
1265 std::string strInput = input;
1267 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> baseflags = base.flags_;
1276 std::string newInput = baseInfo.scheme + input;
1293 std::string basePathStr = BasePathToStr(baseInfo);
1308 std::string temp = "";
1319 std::string temp = "";
1330 std::string temp = "";
1341 std::string temp = "";
1352 std::string temp = "";
1363 std::string temp = "";
1374 std::string temp = "/";
1401 std::string temp = "";
1403 temp = std::to_string(urlData_.port);
1412 std::string temp = urlData_.host;
1415 temp += std::to_string(urlData_.port);
1445 void URL::SetHostname(const std::string& input)
1450 std::string strHost = input;
1463 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisFlags;
1464 std::string thisHostname = "";
1475 void URL::SetHref(const std::string& input)
1477 std::string str = input;
1481 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisNewFlags;
1489 void URL::SetPath(const std::string& input)
1491 std::string strPath = input;
1495 std::string oldstr = "%3A";
1496 std::string newstr = ":";
1501 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisFileFlag;
1512 std::vector<std::string> thisPath;
1513 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisFlags;
1526 void SplitString(const std::string& input, std::string& strHost, std::string& port)
1542 void URL::SetHost(const std::string& input)
1547 std::string strHost = input;
1548 std::string port = "";
1554 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> hostnameflags;
1555 std::string thisHostname = "";
1575 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisFlags;
1586 void URL::SetPort(const std::string& input)
1588 std::string port = input;
1597 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisFlags;
1607 void URL::SetSearch(const std::string& input)
1609 std::string temp;
1620 std::string oldstr = "#";
1621 std::string newstr = "%23";
1627 void URL::SetFragment(const std::string& input)
1629 std::string temp;
1644 void URL::SetScheme(const std::string& input)
1646 std::string strInput = input;
1655 std::string thisScheme = "";
1656 std::bitset<static_cast<size_t>(BitsetStatusFlag::BIT_STATUS_11)> thisFlags;
1665 void URL::SetUsername(const std::string& input)
1671 std::string usname = input;
1681 void URL::SetPassword(const std::string& input)
1687 std::string keyWord = input;
1697 bool ContainsWideOrUnicodeChars(const std::string& str)
1707 void URLSearchParams::HandleIllegalChar(std::wstring& inputStr, std::wstring::const_iterator it)
1709 std::wstring::iterator iter = inputStr.begin();
1710 advance(iter, std::distance<std::wstring::const_iterator>(iter, it));
1729 std::string URLSearchParams::ToUSVString(std::string inputStr)
1731 std::wstring winput(inputStr.length(), L' ');
1732 std::copy(inputStr.begin(), inputStr.end(), winput.begin());
1733 std::wregex wexpr(L"(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])");
1734 std::wsmatch result;
1735 std::wstring::const_iterator iterStart = winput.begin();
1736 std::wstring::const_iterator iterEnd = winput.end();
1743 std::string reStr = "";
1746 rePtr = new (std::nothrow) char[reSize];
1765 std::string name = "";
1777 std::string sname = name;
1796 std::string name = "";
1808 std::string sname = name;
1831 std::string name = "";
1843 std::string tempName = name;
1844 std::string value = "";
1856 std::string tempValue = value;
1862 std::string name = "";
1874 std::string sname = name;
1915 std::string buf = "";
1936 std::string buffer = "";
1948 std::string cppName = buffer;
1949 std::string temp = "";
1961 std::string cppValue = temp;
1993 const std::string curKey = searchParams[i];
1994 const std::string curVal = searchParams[i + 1];
2005 std::vector<std::string> toKeys;
2025 std::vector<std::string> toKeys;
2045 void URLSearchParams::SetArray(napi_env env, const std::vector<std::string> vec)