MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / SetFilePath

Method SetFilePath

external/zep/src/buffer.cpp:668–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

666 }
667
668 void ZepBuffer::SetFilePath(const fs::path& path) {
669 auto testPath = path;
670 if (GetEditor().GetFileSystem().Exists(testPath)) {
671 testPath = GetEditor().GetFileSystem().Canonical(testPath);
672 } else {
673 if (!path.is_absolute()) {
674 auto full = GetEditor().GetFileSystem().GetWorkingDirectory() / path;
675 if (GetEditor().GetFileSystem().Exists(full)) {
676 testPath = GetEditor().GetFileSystem().Canonical(full);
677 } else {
678 testPath = full;
679 }
680 }
681 }
682
683 if (!GetEditor().GetFileSystem().Equivalent(testPath, m_filePath)) {
684 m_filePath = testPath;
685 }
686 GetEditor().SetBufferSyntax(*this);
687 }
688
689 // Remember that we updated the buffer and dirty the state
690 // Clients can use these values to figure out update times and dirty state

Callers 1

SaveBufferAsMethod · 0.80

Calls 4

ExistsMethod · 0.80
CanonicalMethod · 0.80
EquivalentMethod · 0.80
SetBufferSyntaxMethod · 0.80

Tested by

no test coverage detected