MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / selectSingleFile

Method selectSingleFile

apps/tools/Studio/StudioApp.cpp:125–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void StudioApp::selectSingleFile(const std::string& absPath)
126{
127 namespace fs = std::filesystem;
128 FileEntry f;
129 f.fullPath = absPath;
130 f.name = fs::path(absPath).filename().string();
131 f.extension = fs::path(absPath).extension().string();
132 std::transform(f.extension.begin(), f.extension.end(), f.extension.begin(), ::tolower);
133 std::error_code ec;
134 f.size = (int64_t)fs::file_size(absPath, ec);
135
136 selectedFile = f.name;
137 selectedEntry = f;
138 selectedIndex = -1;
139 previewInfo.clear();
140 clearPreviewTexture();
141 stopSound();
142 cachedInfoFile.clear();
143 cachedInfoText.clear();
144 configFile.reset();
145 configFilePath.clear();
146 configSearchActive = false;
147 memset(configSearch, 0, sizeof(configSearch));
148 configSearchResults.clear();
149 currentPreview = previewTypeFromExtension(f.extension);
150 singleFileMode = true;
151
152 log("Single-file: " + f.name);
153}
154
155void StudioApp::playSoundFile(const std::string& path)
156{

Callers 1

mainFunction · 0.80

Calls 3

logFunction · 0.85
clearMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected