MCPcopy Create free account
hub / github.com/Segs/Segs / buildFromFileSystem

Method buildFromFileSystem

Utilities/slav/ProjectManifest.cpp:49–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 return default_val;
48}
49void AppVersionManifest::buildFromFileSystem(const QString &basePath)
50{
51 // + - included in project manifest
52 // - - not included in manifest.
53 // schema is :
54 // + project_dir/project.manifest - must contain at least Channel data for selected_channel
55 // - project_dir/selected_channel - if missing 'release' is assumed
56 // + project_dir/version - if missing '0.0.0' is assumed
57 // - project_dir/*_backup - backup for given project channel,
58 // - project_dir/install_temp - most recently downloaded update/channel change data
59 // + project_dir/** project data
60 QDir baseDir(basePath);
61 m_version=ifExistsGetContents(baseDir.filePath("version"),"0.0.0");
62 m_files.clear();
63
64 QStringList files;
65 QDirIterator it(basePath, QDir::Files,QDirIterator::Subdirectories);
66 while(it.hasNext()) {
67 QString fpath = it.next();
68 // add paths relative to basePath
69 files << fpath.mid(basePath.size()+1);
70 }
71 QRegExp backupRegex(".*_backup");
72 for(auto iter=files.begin(); iter!=files.end(); ) {
73 if(iter->contains(backupRegex))
74 iter = files.erase(iter);
75 else
76 ++iter;
77 }
78 files.removeAll("selected_channel");
79 files.removeAll("install_temp");
80 for(const QString &flp : files) {
81 m_files.emplace(FileDescription {flp,""});
82 }
83}
84bool AppVersionManifest::operator==(const AppVersionManifest & other) const
85{
86 if(m_version!=other.m_version)

Callers 2

Calls 8

ifExistsGetContentsFunction · 0.85
clearMethod · 0.45
nextMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected