MCPcopy Create free account
hub / github.com/WinDurango/WinDurango / EraCreateFileW

Function EraCreateFileW

projects/WinDurango.KernelX/src/kernelx.cpp:760–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758 if (fileName[0] == '.' && fileName[1] == '\\')
759 {
760 static std::wstring trimPath{};
761 trimPath = fileName.substr(2);
762 fileName = trimPath.data();
763 convert = std::filesystem::current_path().c_str();
764 if (convert.back() != '\\')
765 {
766 convert.append(L"\\");
767 }
768 convert.append(fileName);
769 std::replace(convert.begin(), convert.end(), L'\\', L'/');
770 std::replace(convert.begin(), convert.end(), L'//', L'/');
771
772 lpFileName = convert.data();
773 return;
774 }
775 if (fileName[1] != ':')
776 {
777 convert = std::filesystem::current_path().c_str();
778 convert.append(L"\\");
779 convert.append(fileName);
780 std::replace(convert.begin(), convert.end(), L'\\', L'/');
781 std::replace(convert.begin(), convert.end(), L'//', L'/');
782
783 lpFileName = convert.data();
784 }
785
786 if ((fileName[0] == 'G' || fileName[0] == 'g') && fileName[1] == ':')
787 {
788 static std::wstring trimPath{};
789 trimPath = fileName.substr(2);
790 fileName = trimPath.data();
791 convert = std::filesystem::current_path().c_str();
792 convert.append(fileName);
793 std::replace(convert.begin(), convert.end(), L'\\', L'/');
794 std::replace(convert.begin(), convert.end(), L'//', L'/');
795
796 lpFileName = convert.data();
797 }
798 else if ((fileName[0] == 'T' || fileName[0] == 't') && fileName[1] == ':')
799 {
800
801 static std::wstring trimPath{};
802 trimPath = fileName.substr(2);
803 fileName = trimPath.data();
804 convert = winrt::Windows::Storage::ApplicationData::Current().TemporaryFolder().Path();
805 convert.append(fileName);
806 std::replace(convert.begin(), convert.end(), L'\\', L'/');
807 std::replace(convert.begin(), convert.end(), L'//', L'/');
808
809 lpFileName = convert.data();
810 }
811}
812

Callers

nothing calls this directly

Calls 7

LoganInitFunction · 0.85
SetLastErrorFunction · 0.85
FixRelativePathFunction · 0.85
dataMethod · 0.80
c_strMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected