• Home
  • Raw
  • Download

Lines Matching refs:CString

21 CString ModulePathHelper::ConcatFileNameWithMerge(JSThread *thread, const JSPandaFile *jsPandaFile,  in ConcatFileNameWithMerge()
22 CString &baseFileName, CString recordName, CString requestName) in ConcatFileNameWithMerge()
39CString entryPoint = TranslateExpressionInputWithEts(thread, jsPandaFile, baseFileName, requestNam… in ConcatFileNameWithMerge()
47 CString entryPoint = ParseThirdPartyPackage(jsPandaFile, recordName, requestName); in ConcatFileNameWithMerge()
57 CString ModulePathHelper::ConcatMergeFileNameToNormalized(JSThread *thread, const JSPandaFile *jsPa… in ConcatMergeFileNameToNormalized()
58 CString &baseFileName, const CString &recordName, CString requestName) in ConcatMergeFileNameToNormalized()
60 CString prefix(1, PathHelper::NORMALIZED_OHMURL_TAG); in ConcatMergeFileNameToNormalized()
68 CString inputPath = requestName; in ConcatMergeFileNameToNormalized()
69CString entryPoint = ConcatImportFileNormalizedOhmurlWithRecordName(thread, jsPandaFile, baseFileN… in ConcatMergeFileNameToNormalized()
86 CString ModulePathHelper::ConcatImportFileNormalizedOhmurlWithRecordName(JSThread *thread, in ConcatImportFileNormalizedOhmurlWithRecordName()
87 …const JSPandaFile *jsPandaFile, CString &baseFileName, const CString &recordName, const CString &r… in ConcatImportFileNormalizedOhmurlWithRecordName()
89 CString entryPoint; in ConcatImportFileNormalizedOhmurlWithRecordName()
90 CVector<CString> res = SplitNormalizedRecordName(recordName); in ConcatImportFileNormalizedOhmurlWithRecordName()
91 CString path = PathHelper::NORMALIZED_OHMURL_TAG + res[NORMALIZED_IMPORT_PATH_INDEX]; in ConcatImportFileNormalizedOhmurlWithRecordName()
92 CString version = res[NORMALIZED_VERSION_INDEX]; in ConcatImportFileNormalizedOhmurlWithRecordName()
93 CString moduleRequestName = requestName; in ConcatImportFileNormalizedOhmurlWithRecordName()
100 if (pos != CString::npos) { in ConcatImportFileNormalizedOhmurlWithRecordName()
125 return CString(); in ConcatImportFileNormalizedOhmurlWithRecordName()
128 CString ModulePathHelper::ReformatPath(CString requestName) in ReformatPath()
130 CString normalizeStr; in ReformatPath()
134 ASSERT(pos != CString::npos); in ReformatPath()
139 ASSERT(pos != CString::npos); in ReformatPath()
156 void ModulePathHelper::ParseAbcPathAndOhmUrl(EcmaVM *vm, const CString &inputFileName, in ParseAbcPathAndOhmUrl()
157 CString &outBaseFileName, CString &outEntryPoint) in ParseAbcPathAndOhmUrl()
159 size_t pos = CString::npos; in ParseAbcPathAndOhmUrl()
164 if (pos != CString::npos) { in ParseAbcPathAndOhmUrl()
167 if (pos == CString::npos) { // LCOV_EXCL_BR_LINE in ParseAbcPathAndOhmUrl()
170CString moduleName = inputFileName.substr(BUNDLE_INSTALL_PATH_LEN, pos - BUNDLE_INSTALL_PATH_LEN); in ParseAbcPathAndOhmUrl()
208 CString ModulePathHelper::ConcatUnifiedOhmUrl(const CString &bundleName, const CString &pkgname, in ConcatUnifiedOhmUrl()
209 const CString &entryPath, const CString &path, const CString &version) in ConcatUnifiedOhmUrl()
220 CString ModulePathHelper::ConcatUnifiedOhmUrl(const CString &bundleName, const CString &normalizedp… in ConcatUnifiedOhmUrl()
221 const CString &version) in ConcatUnifiedOhmUrl()
227 CString ModulePathHelper::ConcatPreviewTestUnifiedOhmUrl(const CString &bundleName, const CString &… in ConcatPreviewTestUnifiedOhmUrl()
228 const CString &path, const CString &version) in ConcatPreviewTestUnifiedOhmUrl()
234 CString ModulePathHelper::ConcatHspFileNameCrossBundle(const CString &bundleName, const CString &mo… in ConcatHspFileNameCrossBundle()
236 CString bundlePath = BUNDLE_INSTALL_PATH; in ConcatHspFileNameCrossBundle()
241 CString ModulePathHelper::ConcatHspFileName(const CString &moduleName) in ConcatHspFileName()
243 CString bundlePath = BUNDLE_INSTALL_PATH; in ConcatHspFileName()
247 CString ModulePathHelper::TransformToNormalizedOhmUrl(EcmaVM *vm, const CString &inputFileName, in TransformToNormalizedOhmUrl()
248 const CString &baseFileName, const CString &oldEntryPoint) in TransformToNormalizedOhmUrl()
250 CString prefix(1, PathHelper::NORMALIZED_OHMURL_TAG); in TransformToNormalizedOhmUrl()
258 if (pos == CString::npos || pathPos == CString::npos) { in TransformToNormalizedOhmUrl()
259CString errorMsg = "TransformToNormalizedOhmUrl Invalid Ohmurl: " + oldEntryPoint + ", please chec… in TransformToNormalizedOhmUrl()
263 CString path = oldEntryPoint.substr(pathPos); in TransformToNormalizedOhmUrl()
264 CString moduleName = oldEntryPoint.substr(pos + 1, pathPos - pos - 1); in TransformToNormalizedOhmUrl()
265 if (moduleName.find(PathHelper::NAME_SPACE_TAG) != CString::npos) { in TransformToNormalizedOhmUrl()
268 CString pkgname = vm->GetPkgName(moduleName); in TransformToNormalizedOhmUrl()
269 CString currentModuleName = GetModuleNameWithBaseFile(baseFileName); in TransformToNormalizedOhmUrl()
273 CVector<CString> data = GetPkgContextInfoListElements(vm, currentModuleName, pkgname); in TransformToNormalizedOhmUrl()
274 CString version; in TransformToNormalizedOhmUrl()
275 CString entryPath; in TransformToNormalizedOhmUrl()
283 CString subPath = oldEntryPoint.substr(pathPos + 1); in TransformToNormalizedOhmUrl()
288 CString endStr(1, PathHelper::SLASH_TAG); in TransformToNormalizedOhmUrl()
303 CString ModulePathHelper::ParseUrl(EcmaVM *vm, const CString &recordName) in ParseUrl()
305 CVector<CString> vec; in ParseUrl()
309 return CString(); in ParseUrl()
311 CString bundleName = vec[0]; in ParseUrl()
312 CString moduleName = vec[1]; in ParseUrl()
315 CString baseFileName; in ParseUrl()
333 CString ModulePathHelper::ParsePrefixBundle(JSThread *thread, const JSPandaFile *jsPandaFile, in ParsePrefixBundle()
334 …[[maybe_unused]] CString &baseFileName, CString moduleRequestName, [[maybe_unused]] CString record… in ParsePrefixBundle()
338 CString entryPoint = moduleRequestName; in ParsePrefixBundle()
340 CVector<CString> vec; in ParsePrefixBundle()
346 CString bundleName = vec[0]; in ParsePrefixBundle()
347 CString moduleName = vec[1]; in ParsePrefixBundle()
361 CVector<CString> currentVec; in ParsePrefixBundle()
367 CString currentModuleName = currentVec[1]; in ParsePrefixBundle()
383 CString ModulePathHelper::ParseNormalizedOhmUrl(JSThread *thread, CString &baseFileName, const CStr… in ParseNormalizedOhmUrl()
384 CString requestName) in ParseNormalizedOhmUrl()
387 CVector<CString> res = SplitNormalizedOhmurl(requestName); in ParseNormalizedOhmUrl()
391 CString moduleName = res[NORMALIZED_MODULE_NAME_INDEX]; in ParseNormalizedOhmUrl()
392 CString bundleName = res[NORMALIZED_BUNDLE_NAME_INDEX]; in ParseNormalizedOhmUrl()
402 CString importPath = res[NORMALIZED_IMPORT_PATH_INDEX]; in ParseNormalizedOhmUrl()
403 CString version = res[NORMALIZED_VERSION_INDEX]; in ParseNormalizedOhmUrl()
413 CString ModulePathHelper::MakeNewRecord(JSThread *thread, const JSPandaFile *jsPandaFile, CString &… in MakeNewRecord()
414 const CString &recordName, const CString &requestName) in MakeNewRecord()
416 CString entryPoint; in MakeNewRecord()
417 CString moduleRequestName = RemoveSuffix(requestName); in MakeNewRecord()
423 if (pos != CString::npos) { in MakeNewRecord()
447 if (pos != CString::npos) { in MakeNewRecord()
453 if (pos != CString::npos) { in MakeNewRecord()
461 CString ModulePathHelper::FindOhpmEntryPoint(const JSPandaFile *jsPandaFile, in FindOhpmEntryPoint()
462 const CString& ohpmPath, const CString& requestName) in FindOhpmEntryPoint()
464 CVector<CString> vec; in FindOhpmEntryPoint()
468 CString ohpmKey; in FindOhpmEntryPoint()
472CString maybeKey = ohpmPath + PathHelper::SLASH_TAG + StringHelper::JoinString(vec, 0, index); in FindOhpmEntryPoint()
479 return CString(); in FindOhpmEntryPoint()
482 CString entryPoint; in FindOhpmEntryPoint()
494 CString ModulePathHelper::FindPackageInTopLevelWithNamespace(const JSPandaFile *jsPandaFile, in FindPackageInTopLevelWithNamespace()
495 const CString& requestName, const CString &recordName) in FindPackageInTopLevelWithNamespace()
498 CString entryPoint; in FindPackageInTopLevelWithNamespace()
499 CString ohpmPath; in FindPackageInTopLevelWithNamespace()
502 if (pos == CString::npos) { in FindPackageInTopLevelWithNamespace()
504 return CString(); in FindPackageInTopLevelWithNamespace()
510 CVector<CString> vec; in FindPackageInTopLevelWithNamespace()
514 return CString(); in FindPackageInTopLevelWithNamespace()
516 CString moduleName = vec[1]; in FindPackageInTopLevelWithNamespace()
519 if (pos != CString::npos) { in FindPackageInTopLevelWithNamespace()
522 ohpmPath = CString(PACKAGE_PATH_SEGMENT) + PathHelper::NAME_SPACE_TAG + moduleName; in FindPackageInTopLevelWithNamespace()
525 if ((pos != CString::npos) && entryPoint.empty()) { in FindPackageInTopLevelWithNamespace()
527 ohpmPath = CString(PACKAGE_PATH_SEGMENT) + PathHelper::NAME_SPACE_TAG + moduleName; in FindPackageInTopLevelWithNamespace()
543 CString ModulePathHelper::ParseOhpmPackage(const JSPandaFile *jsPandaFile, in ParseOhpmPackage()
544 const CString &recordName, const CString &requestName) in ParseOhpmPackage()
546 CString entryPoint; in ParseOhpmPackage()
551 CString packageName = info.npmPackageName; in ParseOhpmPackage()
553 if (pos != CString::npos) { in ParseOhpmPackage()
556 CString ohpmPath = packageName + PACKAGE_PATH_SEGMENT; in ParseOhpmPackage()
574 CString ModulePathHelper::ParseThirdPartyPackage(const JSPandaFile *jsPandaFile, in ParseThirdPartyPackage()
575 const CString &recordName, const CString &requestName, const CString &packagePath) in ParseThirdPartyPackage()
577 CString entryPoint; in ParseThirdPartyPackage()
580 CString packageName = info.npmPackageName; // pkg_modules/.ohpm/pkgName/pkg_modules/pkgName in ParseThirdPartyPackage()
583CString key = packageName + PathHelper::SLASH_TAG + packagePath + PathHelper::SLASH_TAG + requestN… in ParseThirdPartyPackage()
591 if (pos == CString::npos || pos < 0) { in ParseThirdPartyPackage()
605 CString ModulePathHelper::ParseThirdPartyPackage(const JSPandaFile *jsPandaFile, in ParseThirdPartyPackage()
606 const CString &recordName, const CString &requestName) in ParseThirdPartyPackage()
609 CString normalizeRequestName = PathHelper::NormalizePath(requestName); in ParseThirdPartyPackage()
610 CString entryPoint = ParseOhpmPackage(jsPandaFile, recordName, normalizeRequestName); in ParseThirdPartyPackage()
615 … static CVector<CString> packagePaths = {CString(PACKAGE_PATH_SEGMENT), CString(NPM_PATH_SEGMENT)}; in ParseThirdPartyPackage()
623 return CString(); in ParseThirdPartyPackage()
632 void ModulePathHelper::ResolveCurrentPath(CString &dirPath, CString &fileName, const JSPandaFile *j… in ResolveCurrentPath()
639 CString ModulePathHelper::FindNpmEntryPoint(const JSPandaFile *jsPandaFile, const CString &packageE… in FindNpmEntryPoint()
642 CString entryPoint = ConfirmLoadingIndexOrNot(jsPandaFile, packageEntryPoint); in FindNpmEntryPoint()
655 CString ModulePathHelper::FindPackageInTopLevel(const JSPandaFile *jsPandaFile, in FindPackageInTopLevel()
656 const CString& requestName, const CString &packagePath) in FindPackageInTopLevel()
659 CString entryPoint; in FindPackageInTopLevel()
661 CString levelStr = std::to_string(level).c_str(); in FindPackageInTopLevel()
662CString key = packagePath + PathHelper::SLASH_TAG + levelStr + PathHelper::SLASH_TAG + requestName; in FindPackageInTopLevel()
668 return CString(); in FindPackageInTopLevel()
671 bool ModulePathHelper::IsImportFile(const CString &moduleRequestName) in IsImportFile()
677 if (pos != CString::npos) { in IsImportFile()
678 CString suffix = moduleRequestName.substr(pos); in IsImportFile()
690 CString ModulePathHelper::RemoveSuffix(const CString &requestName) in RemoveSuffix()
692 CString res = requestName; in RemoveSuffix()
694 if (pos != CString::npos) { in RemoveSuffix()
695 CString suffix = res.substr(pos); in RemoveSuffix()
704 bool ModulePathHelper::NeedTranstale(const CString &requestName) in NeedTranstale()
710 requestName.find(PathHelper::COLON_TAG) != CString::npos)) { in NeedTranstale()
717 void ModulePathHelper::TranstaleExpressionInput(const JSPandaFile *jsPandaFile, CString &requestPat… in TranstaleExpressionInput()
724 CString outEntryPoint; in TranstaleExpressionInput()
744 CString ModulePathHelper::GetModuleNameWithBaseFile(const CString &baseFileName) in GetModuleNameWithBaseFile()
746 size_t pos = CString::npos; in GetModuleNameWithBaseFile()
751 CString moduleName; in GetModuleNameWithBaseFile()
752 if (pos != CString::npos) { in GetModuleNameWithBaseFile()
755 if (pos == CString::npos) { // LCOV_EXCL_BR_LINE in GetModuleNameWithBaseFile()
760 if (moduleName.find(PathHelper::POINT_STRING_TAG) != CString::npos) { in GetModuleNameWithBaseFile()
774 CString ModulePathHelper::TranslateExpressionInputWithEts(JSThread *thread, const JSPandaFile *jsPa… in TranslateExpressionInputWithEts()
775CString &baseFileName, const CString &requestName) in TranslateExpressionInputWithEts()
777 CString entryPoint; in TranslateExpressionInputWithEts()
779 CString moduleName = GetModuleNameWithBaseFile(baseFileName); in TranslateExpressionInputWithEts()
782 return CString(); in TranslateExpressionInputWithEts()
794 void ModulePathHelper::ParseCrossModuleFile(const JSPandaFile *jsPandaFile, CString &requestPath) in ParseCrossModuleFile()
797 if (pos == CString::npos) { in ParseCrossModuleFile()
800 CString moduleName = requestPath.substr(0, pos); in ParseCrossModuleFile()
801 CString outEntryPoint; in ParseCrossModuleFile()
807 if (pos == CString::npos) { in ParseCrossModuleFile()
815 CString relativePath = requestPath.substr(pos); in ParseCrossModuleFile()
828 CString ModulePathHelper::ParseFileNameToVMAName(const CString &filename) in ParseFileNameToVMAName()
830 CString tag = VMA_NAME_ARKTS_CODE; in ParseFileNameToVMAName()
831 size_t pos = CString::npos; in ParseFileNameToVMAName()
836 if (filename.find(EXT_NAME_JS) != CString::npos) { in ParseFileNameToVMAName()
838 if (pos == CString::npos) { in ParseFileNameToVMAName()
841 CString moduleName = filename.substr(0, pos); in ParseFileNameToVMAName()
843 if (pos == CString::npos) { in ParseFileNameToVMAName()
846 CString realModuleName = moduleName.substr(pos + 1); in ParseFileNameToVMAName()
847 CString realFileName = realModuleName; in ParseFileNameToVMAName()
849CString file = PREFIX_LIB + realFileName + EXT_NAME_Z_SO + PathHelper::SLASH_TAG + realModuleName … in ParseFileNameToVMAName()
853 if (filename.find(EXT_NAME_ABC) != CString::npos) { in ParseFileNameToVMAName()
855 if (pos == CString::npos) { in ParseFileNameToVMAName()
858 CString file = filename.substr(BUNDLE_INSTALL_PATH_LEN); in ParseFileNameToVMAName()
865 CVector<CString> ModulePathHelper::GetPkgContextInfoListElements(EcmaVM *vm, CString &moduleName, in GetPkgContextInfoListElements()
866 CString &packageName) in GetPkgContextInfoListElements()
868 CVector<CString> resultList; in GetPkgContextInfoListElements()
872 CMap<CString, CMap<CString, CVector<CString>>> pkgContextList = vm->GetPkgContextInfoLit(); in GetPkgContextInfoListElements()
876 CMap<CString, CVector<CString>> pkgList = pkgContextList[moduleName]; in GetPkgContextInfoListElements()
884 CString ModulePathHelper::ConcatImportFileNormalizedOhmurl(const CString &recordPath, const CString in ConcatImportFileNormalizedOhmurl()
885 const CString &version) in ConcatImportFileNormalizedOhmurl()
890 CString ModulePathHelper::ConcatNativeSoNormalizedOhmurl(const CString &moduleName, const CString &… in ConcatNativeSoNormalizedOhmurl()
891 const CString &pkgName, const CString &version) in ConcatNativeSoNormalizedOhmurl()
893 CString prefix = PREFIX_NORMALIZED_SO; in ConcatNativeSoNormalizedOhmurl()
898 CString ModulePathHelper::ConcatNotSoNormalizedOhmurl(const CString &moduleName, const CString &bun… in ConcatNotSoNormalizedOhmurl()
899 const CString &pkgName, const CString &entryPath, const CString &version) in ConcatNotSoNormalizedOhmurl()
901 CString prefix = PREFIX_NORMALIZED_NOT_SO; in ConcatNotSoNormalizedOhmurl()
907 bool ModulePathHelper::NeedTranslateToNormalized(const CString &requestName) in NeedTranslateToNormalized()
913 requestName.find(PathHelper::COLON_TAG) != CString::npos)) { in NeedTranslateToNormalized()
919 CString ModulePathHelper::TranslateExpressionToNormalized(JSThread *thread, const JSPandaFile *jsPa… in TranslateExpressionToNormalized()
920 [[maybe_unused]] CString &baseFileName, const CString &recordName, CString &requestPath) in TranslateExpressionToNormalized()
929 CString inputPath = requestPath; in TranslateExpressionToNormalized()
931CString entryPoint = ConcatImportFileNormalizedOhmurlWithRecordName(thread, jsPandaFile, baseFileN… in TranslateExpressionToNormalized()
938 if (pos != CString::npos) { in TranslateExpressionToNormalized()
961 [[maybe_unused]] CString &baseFileName, CString &requestPath) in ConcatOtherNormalizedOhmurl()
963 CString entryPath; in ConcatOtherNormalizedOhmurl()
964 CString currentModuleName = GetModuleNameWithBaseFile(baseFileName); in ConcatOtherNormalizedOhmurl()
965 CString pkgName = vm->GetPkgNameWithAlias(requestPath); in ConcatOtherNormalizedOhmurl()
966 CVector<CString> data = GetPkgContextInfoListElements(vm, currentModuleName, pkgName); in ConcatOtherNormalizedOhmurl()
972 CString result; in ConcatOtherNormalizedOhmurl()
974 if (filePathPos != CString::npos) { in ConcatOtherNormalizedOhmurl()
979 if (filePathPos != CString::npos) { in ConcatOtherNormalizedOhmurl()
985 CString outEntryPoint; in ConcatOtherNormalizedOhmurl()
995 CString ModulePathHelper::ConcatOtherNormalizedOhmurlWithFilePath(EcmaVM *vm, size_t filePathPos, in ConcatOtherNormalizedOhmurlWithFilePath()
996 CString &moduleName, const CString &requestPath) in ConcatOtherNormalizedOhmurlWithFilePath()
998 CString result; in ConcatOtherNormalizedOhmurlWithFilePath()
999 CString alias = requestPath.substr(0, filePathPos); in ConcatOtherNormalizedOhmurlWithFilePath()
1000 CString entryPath = requestPath.substr(filePathPos + 1); in ConcatOtherNormalizedOhmurlWithFilePath()
1001 CString pkgName = vm->GetPkgNameWithAlias(alias); in ConcatOtherNormalizedOhmurlWithFilePath()
1002 CVector<CString> data = GetPkgContextInfoListElements(vm, moduleName, pkgName); in ConcatOtherNormalizedOhmurlWithFilePath()
1009 CString ModulePathHelper::ConcatNormalizedOhmurlWithData(CVector<CString> &data, CString &pkgName, in ConcatNormalizedOhmurlWithData()
1011 CString bundleName = data[PKGINFO_BUDNLE_NAME_INDEX]; in ConcatNormalizedOhmurlWithData()
1012 CString moduleName = data[PKGINFO_MODULE_NAME_INDEX]; in ConcatNormalizedOhmurlWithData()
1013 CString version = data[PKGINFO_VERSION_INDEX]; in ConcatNormalizedOhmurlWithData()
1017 CString isSO = data[PKGINFO_IS_SO_INDEX]; in ConcatNormalizedOhmurlWithData()
1030 CString ModulePathHelper::TranslateNapiFileRequestPath(JSThread *thread, const CString &modulePath, in TranslateNapiFileRequestPath()
1031 const CString &requestName) in TranslateNapiFileRequestPath()
1034 CString moduleName = GetModuleNameWithPath(modulePath); in TranslateNapiFileRequestPath()
1042 CVector<CString> ModulePathHelper::SplitNormalizedOhmurl(const CString &ohmurl) in SplitNormalizedOhmurl()
1044 CVector<CString> res; in SplitNormalizedOhmurl()
1047 while (pos != CString::npos) { in SplitNormalizedOhmurl()
1048 CString element = ohmurl.substr(start, pos - start); in SplitNormalizedOhmurl()
1053 CString tail = ohmurl.substr(start); in SplitNormalizedOhmurl()
1058 CVector<CString> ModulePathHelper::SplitNormalizedRecordName(const CString &recordName) in SplitNormalizedRecordName()
1060 CVector<CString> res(NORMALIZED_OHMURL_ARGS_NUM); in SplitNormalizedRecordName()
1062 CString temp; in SplitNormalizedRecordName()
1085 CString ModulePathHelper::GetBundleNameWithRecordName(EcmaVM *vm, const CString &recordName) in GetBundleNameWithRecordName()
1087 CString bundleName; in GetBundleNameWithRecordName()
1089 CVector<CString> res = ModulePathHelper::SplitNormalizedRecordName(recordName); in GetBundleNameWithRecordName()
1102 CString ModulePathHelper::Utf8ConvertToString(JSTaggedValue str) in Utf8ConvertToString()
1108 bool ModulePathHelper::IsOhmUrl(const CString &str) in IsOhmUrl()
1118 bool ModulePathHelper::CheckAndGetRecordName(JSThread *thread, const CString &ohmUrl, CString &reco… in CheckAndGetRecordName()
1127 CString str; in CheckAndGetRecordName()
1140 bool ModulePathHelper::ValidateAbcPath(const CString &baseFileName, ValidateFilePath checkMode) in ValidateAbcPath()
1145 baseFileName.rfind(MERGE_ABC_ETS_MODULES) != CString::npos) { in ValidateAbcPath()
1149 baseFileName.rfind(ABC) != CString::npos) { in ValidateAbcPath()